ticdc: unquote exchange partition names when rebuilding ddl - #12762
ticdc: unquote exchange partition names when rebuilding ddl#12762haiboumich wants to merge 1 commit into
Conversation
Exchange partition DDLs may already contain quoted partition names in job.Query. Rebuilding the SQL without removing that outer quoting produces doubled backticks and invalid downstream DDL. Unquote the parsed partition name before re-quoting it, and add unit tests for both identifier helpers and the exchange partition path.
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughChangesExchange partition quoting
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cdc/model/sink_test.go (1)
463-463: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPass the expected value first to
require.Equal.Line 463 currently passes
event.Typeas the expected value and the constant as the actual value, which makes failure diagnostics misleading. Userequire.Equal(t, timodel.ActionExchangeTablePartition, event.Type)instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cdc/model/sink_test.go` at line 463, Update the require.Equal assertion in the sink test to pass timodel.ActionExchangeTablePartition as the expected value and event.Type as the actual value, preserving the existing assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@cdc/model/sink_test.go`:
- Line 463: Update the require.Equal assertion in the sink test to pass
timodel.ActionExchangeTablePartition as the expected value and event.Type as the
actual value, preserving the existing assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 49dd0dda-fd96-4048-903a-ef37d72b3c83
📒 Files selected for processing (4)
cdc/model/sink.gocdc/model/sink_test.gopkg/quotes/quotes.gopkg/quotes/quotes_test.go
What problem does this PR solve?
Issue Number: close #12761
What is changed and how it works?
EXCHANGE PARTITIONDDLs may already contain quoted partition names injob.Query. When TiCDC rebuilds the DDL directly from that SQL fragment, it may wrap an already-quoted partition name again, producing doubled backticks and invalid downstream DDL.This PR fixes the issue by unquoting the parsed partition name before quoting it again during DDL reconstruction.
Changes in this PR:
EXCHANGE PARTITIONDDLEXCHANGE PARTITIONDDL path, including quoted partition namesCheck List
Tests
Questions
Will it cause performance regression or break compatibility?
No. This change only affects the DDL reconstruction path for
EXCHANGE PARTITIONand does not change normal replication behavior for other DDLs.Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note