fix: retry stale regular index hints across CNs - #28641
Open
gouhongshen wants to merge 2 commits into
Open
Conversation
1 task
gouhongshen
force-pushed
the
agent/issue-28639-94d7deef
branch
from
September 10, 2026 14:52
e5a9038 to
c30779e
Compare
This was referenced Sep 11, 2026
Contributor
Author
|
Unrelated CI blockers from MatrixOne ALL CI run 34491898016 (attempt 1):
|
gouhongshen
force-pushed
the
agent/issue-28639-94d7deef
branch
from
September 11, 2026 03:09
afb5dad to
04b61e8
Compare
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
gouhongshen
force-pushed
the
agent/issue-28639-94d7deef
branch
from
September 11, 2026 05:48
435e98d to
b264c48
Compare
gouhongshen
force-pushed
the
agent/issue-28639-94d7deef
branch
from
September 11, 2026 06:10
b264c48 to
dd95a4d
Compare
gouhongshen
force-pushed
the
agent/issue-28639-94d7deef
branch
from
September 11, 2026 06:17
dd95a4d to
2f7921e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28639
What this PR does / why we need it:
A verifier CN can plan a regular
FORCE INDEXquery from a table definition received before a concurrentCREATE INDEX. The planner then returned MySQL 1176 before the compiler could take its existing metadata lock and request a definition-change retry.This PR adds an additive query-plan marker for an unresolved permanent index hint and carries the parent table object reference. Compilation takes the existing metadata-lock path for that marker. A committed DDL change rebuilds the statement from the current definition; without a definition change, compilation returns the original 1176 before any data source starts. Temporary tables, prepared statements, and metadata-unlocked scans retain immediate planner validation. Sirius offload rejects marked plans so it cannot bypass the native metadata boundary.
The CI follow-up makes the terminal missing-index error select the first recorded unresolved hint directly rather than using a range whose first iteration always returned. It preserves the error contract and satisfies staticcheck without adding a retry or fallback path.
Rebased onto
origin/mainatee0c2bf563bf27ff2c80891bb57a1de5886bf90b. The generated plan binding was regenerated from the merged schema during rebase, preserving both upstream schema changes and this PR’s additive marker; current head:435e98df14.Issue-to-test proof:
TestIssue27487ConcurrentInsertIsIncludedInNewIndex/regular_secondary_indexpauses a verifier CN after it has compiled a regular-index query from the old definition, releases the writer soCREATE INDEXcommits, then proves the retried query andEXPLAIN FORCE INDEXuseidx_kand include the concurrent committed row.regular_secondary_index_writer_rollbackexercises the same DDL boundary with a rolled-back writer and proves the new index is visible while neither forced nor base-table reads expose the uncommitted row.USE,FORCE, andIGNOREmissing hints; protobuf round-trip; temporary-table and PREPARE immediate 1176 behavior; and order-scopedFORCE. Compiler tests cover parent metadata locking, first-hint error preservation across multiple markers, and the empty-marker path.Tests:
make generate-pb.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 ./pkg/pb/plan.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 ./pkg/sql/plan.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 ./pkg/sql/compile.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=10m -run ^TestIssue27487ConcurrentInsertIsIncludedInNewIndex$ ./pkg/tests/issues.agents/skills/mo-dev/scripts/mo-cgo-test -race -v -count=2 -timeout=8m -run ^TestIssue27487ConcurrentInsertIsIncludedInNewIndex$ ./pkg/tests/issues.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/sql/compileCGO_CFLAGS="-I$PWD/cgo -I$PWD/thirdparties/install/include" GOWORK=off go vet -mod=readonly ./pkg/pb/plan ./pkg/sql/compile ./pkg/sql/plan ./pkg/tests/issuesCGO_CFLAGS="-I$PWD/cgo -I$PWD/thirdparties/install/include" golangci-lint run --concurrency 1 -c .golangci.yml ./pkg/sql/compileBVT was not applicable: the proof requires two authenticated embedded CN connections, a held writer transaction, and a deterministic compiler fault boundary, which the single-endpoint mo-tester workflow cannot express.
Residual risks:
The new protobuf field is additive and is covered by generated-code and marshal/unmarshal tests. The production retry uses the existing metadata-lock definition-change path; only an unresolved permanent, lockable index hint enters that path.