Skip to content

fix table clone visibility for repeated alter#24987

Draft
gouhongshen wants to merge 1 commit into
matrixorigin:mainfrom
gouhongshen:codex/issue-24762-main
Draft

fix table clone visibility for repeated alter#24987
gouhongshen wants to merge 1 commit into
matrixorigin:mainfrom
gouhongshen:codex/issue-24762-main

Conversation

@gouhongshen

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

fixes #24762

What this PR does / why we need it:

Repeated ALTER TABLE statements in one transaction can clone from a table or hidden index table that was produced by an earlier ALTER in the same transaction. The old TableMetaReader only read the committed partition snapshot and constructed the local reader without the current transaction write offset, so the second clone could miss uncommitted object stats from the first clone. The base table data remained visible, but secondary index data could be missing after commit.

This PR keeps the clone path and makes the clone source reader transaction-visible:

  • capture the TableMetaReader transaction write offset
  • include uncommitted data and tombstone object stats when collecting clone metadata
  • use NewLocalDataSource with the same txnOffset for appendable/in-memory clone reads
  • include row-level uncommitted tombstones when collecting tombstone rows
  • reuse a common helper for collecting uncommitted data/tombstone object stats

It also extends git4data clone BVT coverage with repeated ALTER cases, including a stress case with secondary, unique, fulltext, and ivfflat vector indexes plus multiple ALTER operations in one transaction.

Validation:

  • make build
  • clone_in_alter_table_2: 81/81 passed
  • git4data/clone: 1177/1177 passed
  • full git4data: 4403/4403 passed
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working 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.

[Bug]: 一些ddl操作之后,字符串列进行字符串比较失效。只能通过binary方式比较

2 participants