Repository navigation
fix: preserve clone auto-increment continuation - #27154
Conversation
4a1a0e6 to
34cfec2
Compare
|
The underlying mo-tester pairing defect remains tracked in #27164. This PR now applies a case-only mitigation to all five |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review completed on exact head 9cf7087.
The fresh-clone versus ALTER-copy allocator ownership split is consistent: visible columns on a new table are rebuilt from the transaction-consistent copied-row maximum plus schema/session floors, while retained-ID ALTER paths and hidden internal allocators preserve their fenced state. I also verified the issue reproduction against a locally built exact-head server (source next 4, clone insert 4, clone next 5), explicit AUTO_INCREMENT=100, and the clone-of-clone empty-source counterexample. Focused checked-allocator tests, the full table_clone package, and focused race tests passed. No blocking code issue found.
9cf7087 to
6ad3ad6
Compare
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 18 seconds in the queue, including 1 second running CI. Required conditions to merge
|
|
@Mergifyio queue |
☑️ Command
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #27092
What this PR does / why we need it:
Root cause
Fresh table clones copied the source row from
mo_catalog.mo_increment_columnsinto the destination allocator. That row offset is the upper bound of a reserved allocation batch (10,000 in the reproducer), not the next source-session value (4). Because a fresh clone has a new table ID and an independent allocator, transferring that reservation made its first generated ID 10,001.The persisted table definition separately carries explicit schema lower bounds such as
ALTER TABLE ... AUTO_INCREMENT = 100. Those are user-visible state and must still be preserved.Changes
AUTO_INCREMENT, explicit transactions, and historical snapshots.ORDER BY nameand@sortkey:1, while retaining@ignore:0,9,10; this changes neither the expectedproc_identries nor any non-ignored field assertion.Issue-to-test proof
4, clone next5, and first cloned-table insert4for table, database, and both Data Branch clone forms.1; a source whose largest row was deleted seeds the independent clone from the copied maximum; explicitAUTO_INCREMENT = 100inserts100; snapshot clone asserts snapshot-visible rows plus exact4 / 5inserted/next values.10and11, then assigns12to the first destination insert.40001through40006, without introducing a new 10,000-value gap at each clone.nameordering prevents ignored allocator IDs from pairing one procedure with another.Verification
Latest semantic rebase: patch-equivalent head
1c9ff2e42bc751bd0028bcfe0cd51b8704071bcbwas rebased conflict-free frommainata15139da62b938b0918c19675c619b259cd86460ontomainat07fe9a69c6a3d6ed5e2b4299fb143d10bef442c0, producing exact head23c7a20c072375324fee984c087de370ef5bd323.git range-diff a15139da62..1c9ff2e42b 07fe9a69c6..23c7a20c07: all four clone patches are equivalent.ff530dfc6cb58fd343bc0663b95c917a95aa40fc.git diff --check origin/main...HEADpassed and the worktree is clean.c3332623e5be8961a2c54bed286c888b75f82bee, an isolated local MatrixOne service and mo-tester upstream/main334d3e124bbfbdcd6b5cc63439278d172c72b706passedsys_restore_system_table_to_sys_accounttwice with CI flags-g -n -o: 313/313 statements each time. Normal metadata mode also passed 313/313.9/10versus expected1920000/1920001fail under full-row sorting, whileORDER BY nameplus@sortkey:1pairs rows correctly; mutations to each of the 14 non-ignored columns are rejected.@sortkey:1alone remains order-dependent, so it is deliberately paired with SQL ordering.07fe9a69c6 fix(embed): align HAKeeper transport timeout under race (#27849)changes only embed/logservice configuration and its tests, with no PR-file overlap. All six directly affected tests passed: three embed timeout/config tests, two logservice client-config tests, and the authenticated two-CN fixture test.pkg/sql/compile,pkg/frontend, andpkg/sql/colexec/table_clonepackages were rerun through the MatrixOne CGo wrapper and passed on exact head23c7a20c07.33283224004attempt 1 on exact head23c7a20c07passed shared build, normal Ubuntu UT, SCA, Coverage UT, and PROXY BVT. All three changed clone cases passed; PESSIMISTIC BVT reproduced only unrelated [Bug]: mo-tester sorts rows by ignored columns, causing false BVT failures #27164, and aggregate Coverage was derivative.99187224896is in progress after the single permitted failed-job rerun.CI investigation
33283224004attempt 1 reproduced its snapshot result-pairing mismatch in PESSIMISTIC BVT job99182619116on exact head23c7a20c07.snapshot/sys_restore_system_table_to_sys_account.sqlcompleted 313 statements with 311 successful; at SQL rows 167 and 183, bothmo_stored_procedurecomparisons reportedrow:0,column:1, expectedtest_if_hit_second_elseif, and receivedtest_if_hit_else. Expected ignoredproc_idvalues were1920000/1920001; actual ignored values were9/10. The final error list contains no other SQL.clone_auto_increment_state.sql65/65,table_clone.sql74/74, andtemporary_table_clone.sql163/163. This PR now adds only a case-level mitigation for all fivemo_stored_procedureselectors in the same snapshot test; it does not modify mo-tester, expectedproc_idvalues, or ignored columns. Fresh CI onc3332623e5is pending.99186546271was derivative: its direct log recordsprerequisites_ready: falsefor generation33283224004-1and exits before coverage processing.33283224004was rerun for failed jobs exactly once; its old-head results are superseded by fresh CI onc3332623e5. The rerun policy remains exhausted for that prior workflow.Residual risks
A fresh clone intentionally owns an independent allocator. If the highest generated source rows were deleted, the clone starts after the highest row it actually copied rather than inheriting an unused cached range from the source CN. Explicit schema lower bounds remain preserved. There are no catalog, wire-format, or API changes in this PR, and the fix does not read or mutate source CN allocator caches.