Skip to content

test: guard ODKU metadata admission during concurrent DROP INDEX - #29747

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-29715-odku-index
Oct 9, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-29715-odku-index

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Test and CI

Which issue(s) this PR fixes:

Related to #29715, reported on 4.2. This adds main regression coverage; it does not close the 4.2 issue or backport its existing fix.

What this PR does / why we need it:

ODKU concurrent with DROP INDEX must preserve write metadata admission and rebuild a stale plan before touching a removed hidden index. Main already contains #27792's scan ObjectRef copying correction. This PR guards that ownership boundary and the public ALTER TABLE DROP INDEX path.

  • Extend the existing compiler ownership UT with a hidden unique-index scan/write alias and verify both write metadata dependencies.
  • Reuse the authenticated two-CN fixture with one seeded row. Check DROP waiting on the writer's base metadata lock under commit and rollback, and force DROP to commit between writer compilation and metadata admission.
  • Bind the CN-wide hook to the public autocommit writer's connection and active transaction. Reuse existing identity matching with an identity-only projection from locked transaction UUID getters, avoiding mutable session status reads.
  • Exercise an unrelated CN0 transaction before writer launch and while it is paused. Its real INSERT/UPDATE statements must complete without capturing the barrier or increasing writer admission counts.
  • Retain exactly-once row/value checks, dropped-index catalog checks, and a later ODKU that reuses the formerly unique value. Register bounded cancellation, barrier release, worker joining and hook/resource cleanup before the first hooked statement.

The probe adds one row/table to the existing cluster; late admission took 0.08s in the focused normal run, excluding shared-cluster setup. Production behavior and runtime overhead are unchanged. The exact historical failing stack/first bad commit remain unproved; the controlled isolation test does not depend on actual cron scheduling.

Validation

Base: 83d82b8. Go 1.27.1, darwin/arm64, repository CGo runner with fresh worktree-native artifacts.

  • Compiler ownership/metadata controls, all three public DROP orderings, identity adapter UT, and existing concurrent CREATE INDEX/DDL-consistency controls pass in normal and race modes.
  • Exact public regression passes -race -count=3 in one process: nine subscenarios, one shared-cluster setup.
  • Removing only the writer identity predicate makes late admission fail at the competing INSERT's bounded deadline; commit/rollback controls still pass and cleanup terminates.
  • Final incremental formatting, diff check, go vet, pinned molint and configured golangci-lint 2.14.0 pass on both owning packages. No new molint diagnostics; existing compiler diagnostics are in source identical to the base.
  • gpt-6.1-sol / xhigh design and final overall review evidence is retained in the task record.

Historical author-reported Linux main diagnostics at this base observed no hidden-table 1146 under the frozen workload, and scan-copy-removal overlays failed ownership assertions. These remain historical evidence, separate from the current checks above.

Focused reproduction:

.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=3 -timeout=180s -run '^TestIssue29715ODKUConcurrentDropIndex$' ./pkg/tests/issues

CI has not been awaited for this update.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit e17557d against 83d82b8.

Changes needed: one P2 finding, attached inline. The late-admission barrier must identify the actual public writer transaction before pausing or counting metadata admission; a CN-wide first-request capture does not isolate it from the shared cluster's background SQL.

The remaining design is appropriately scoped: it extends the existing ownership UT and reuses the authenticated two-CN fixture, existing lock observation and cleanup owners without adding production execution paths or runtime overhead. Commit/rollback controls and the final public SQL oracles are useful. This adds main regression coverage; it does not establish resolution of the original 4.2 incident #29715.

Validation: formatting and diff checks passed. The local focused race test did not start because matching native CGo artifacts were unavailable. Author-reported normal/race/same-process repetition evidence was examined; the competing unrelated-transaction interleaving was verified by source tracing, not dynamically reproduced locally. CI was pending at review completion. No existing human review or inline thread was present to close.

Submitted as COMMENT because this PR is authored by the current account; this is not an independent approval.

Comment thread pkg/tests/issues/issue_29715_test.go Resolved

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review of commit 8f3dd22 against main/base 83d82b8.

Recommendation: approve from the code-review perspective. No new verified material blocker was found in the complete two-file diff.

The original P2 is addressed: the CN-wide barrier identifies the actual public autocommit writer transaction before capturing or pausing it, and result observations count only that captured transaction. The real competing CN0 transaction exercises isolation before writer launch and while the writer is paused. Removing only the writer identity predicate causes the competing INSERT to fail at its bounded deadline, with cleanup and failed-fixture quarantine completing.

The design is appropriately scoped. It extends the existing compiler ownership UT, reuses existing session identity matching, SQL/lock-observation helpers and the authenticated two-CN fixture, and adds no production state machine, storage, execution path or runtime overhead. The distinct commit, rollback and late-admission cases retain exactly-once data, dropped-index catalog and unique-value-reuse oracles. Metadata keys are acquired in one batch per attempt, so two admissions cannot simply mean two keys.

Reviewed cancellation, partial failure before worker launch, barrier release, worker joining, hook removal, session close/reset identity safety and same-instance fixture reuse. No unreachable added branch, unused field, redundant fixture or unjustified abstraction was identified. The added probe and narrow adapter UT prove different contracts and justify their maintenance cost.

Validation evidence was inspected and reused after confirming current source fingerprints and relevant inputs: focused normal/race compiler and public tests, unchanged CREATE INDEX/DDL consistency controls, exact public regression under -race -count=3 (nine subscenarios in one process), the negative identity-filter control, and incremental formatting/vet/molint/golangci checks. This review did not rerun those unchanged checks. Ubuntu/x86 UT and Linux/arm64 SCA CI remain in progress; this recommendation does not claim full CI success.

All substantive existing review comments are closed: one P2 thread, verified against code and control evidence. This PR adds main regression coverage; resolution/backport of the original 4.2 incident #29715 remains unproved and outside this change's scope.

Submitted as COMMENT because the current account is the PR author. This records a no-blocker recommendation, not an independent GitHub approval. No subagents were used.

This branch was previously deployed

1 inactive deployment
ci — 66918454 Deployed Oct 9, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants