docs(tidb): correct stale omni bridge-removal comments by vsai12 · Pull Request #20472 · bytebase/bytebase · GitHub
Skip to content

docs(tidb): correct stale omni bridge-removal comments - #20472

Merged
vsai12 merged 1 commit into
mainfrom
fix/tidb-bridge-comments
Jun 2, 2026
Merged

vsai12 merged 1 commit into
mainfrom
fix/tidb-bridge-comments

Conversation

@vsai12

@vsai12 vsai12 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What

Corrects misleading comments in backend/plugin/parser/tidb/omni.go and backend/plugin/advisor/tidb/utils.go that claimed the pingcap bridge "will be removed once dml_dry_run migrates and the bridge is no longer needed."

Why

dml_dry_run has migrated to omni (PR #20467), but the bridge is retained, for two reasons unrelated to that advisor:

  1. advisor_builtin_prior_backup_check reads pingcap AST for authoritative DDL detection on its dual-path (cumulative Problem syncing RDS instances because rdsadmin private database #30) — it's the bridge's sole remaining getTiDBNodes/AsPingCapAST consumer.
  2. The dispatcher's Option B fallback still produces raw pingcap *AST for omni-rejected SQL (FLASHBACK / SEQUENCE / SPLIT — deferred grammar omni doesn't have). Removal there is gated on Option A retirement (telemetry, months out), not on any advisor migration.

The old comments nearly drove an incorrect follow-up ("delete the *tidbparser.AST arm in getTiDBOmniNodes, 3-arm → 2-arm") that would have broken TestGetTiDBOmniNodesSkipsPingcapFallbackAST and violated the Phase 1.5 invariant #2 soft-fail — that arm is exactly what handles the Option B fallback.

Scope

Comment-only, no behavior change. The broader "un-migrated advisors" phrasings in the bridge's implementation notes / log messages are left for the dedicated comment-cleanup pass (BYT-9396).

Testing

gofmt, go build, golangci-lint (0 issues), and go test -short (TestGetTiDBOmniNodesSkipsPingcapFallbackAST + TestTiDBRules) — all green.

🤖 Generated with Claude Code

The omni.go/utils.go comments said the pingcap bridge "will be removed once
dml_dry_run migrates." dml_dry_run has now migrated (PR #20467), but the bridge
is retained: advisor_builtin_prior_backup_check uses pingcap AST for DDL
detection on its dual-path (cumulative #30), and the dispatcher's Option B
fallback still yields pingcap *AST for omni-rejected SQL (FLASHBACK/SEQUENCE/
SPLIT — deferred grammar). Removal is gated on those, not on dml_dry_run.

These comments nearly drove an incorrect "delete the *tidbparser.AST arm"
cleanup that would have broken TestGetTiDBOmniNodesSkipsPingcapFallbackAST and
the invariant #2 soft-fail. Comment-only; no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vsai12
vsai12 requested a review from a team as a code owner June 2, 2026 03:06
@cla-bot cla-bot Bot added the cla-signed label Jun 2, 2026
@d-bytebase
d-bytebase requested a review from rebelice June 2, 2026 03:06
@vsai12
vsai12 enabled auto-merge (squash) June 2, 2026 03:13
@vsai12
vsai12 merged commit eabd60e into main Jun 2, 2026
15 checks passed
@vsai12
vsai12 deleted the fix/tidb-bridge-comments branch June 2, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants