[BugFix] Carry forward untouched indexes into the file-bundling bundle on compaction publish (backport #76105)#76191
Conversation
|
Cherry-pick of 35c68c6 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr |
Pull request was closed
|
Not backporting this fix to branch-4.0. The carry-forward mechanism depends on the no-op empty-transaction publish path ( |
Why I'm doing:
With
file_bundlingenabled (the default for shared-data tables since 4.0), onephysical bundle file (
meta/0_<version>.meta) holds the metadata of alltablets of a partition at a given version.
PublishVersionDaemon.publishPartitionbuilds the tablet set to publish from thetransaction's point-in-time index view (
getPartitionLoadedIndexes). For a lakecompaction that index set is snapshotted at transaction begin
(
CompactionScheduler.beginTransaction). If a rollup / synchronous-MV indexbecomes visible after the compaction transaction begins but before it
publishes, the stale view omits that index, so the compaction writes the new
version's bundle without the rollup index's tablets. Their metadata then
disappears at that version, and the next publish that reads a rollup tablet at
that base version fails with
can not find tablet <id> from shared tablet metadata(a 404 on the bundle object), permanently wedging the partition'spublish queue.
Reproduced/diagnosed via StarRocksTest#11536 (file_bundling table + sync MV +
a subsequent import hangs). Confirmed on the affected cluster by reading the
bundle objects directly:
0_12.metacontained 20 tablets (base + rollup) while0_13.meta, written by a compaction, contained only the 10 base tablets.What I'm doing:
When publishing a file-bundling partition version, carry forward every
currently-visible NORMAL index that the transaction did not touch, publishing
those tablets as an empty-txn version bump within the same aggregate request
as the touched tablets — two separate aggregate publishes would each
truncate-write the same
0_<version>.metaand drop one of the two sets. Thiskeeps the new bundle a complete whole-partition snapshot.
Only affects the file-bundling path; a normal load already covers every visible
index, so nothing is carried forward and its behavior is unchanged. Added a unit
test for the carry-forward selection (
collectFileBundlingCarryForwardTablets).Fixes https://github.com/StarRocks/StarRocksTest/issues/11536
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
This is an automatic backport of pull request #76105 done by [Mergify](https://mergify.com).