You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BugFix] Retain lake vacuum files by version interval across tablet reshard
Auto-vacuum stalled and could lose snapshot data on shared-data
range-distribution partitions after a tablet split/merge when a cluster
snapshot pinned a pre-reshard version V:
- TabletRetainInfo::init read {tablet}_{V}.meta for each retained version to
build its protect set. On a reshard child, a pinned pre-reshard version V
predates the child's earliest metadata, so the read returned NotFound and
init failed. vacuum_tablet_metadata runs init before any deletion, so the
whole partition's vacuum RPC failed every cycle and expired metadata / data
files / txn logs accumulated for as long as the snapshot existed.
- Skipping the NotFound version, or only suppressing shared-file cleanup, is
unsafe: the incremental vacuum can delete a pre-reshard file the snapshot
still needs, and the reshard "identical tablet" path does not mark inherited
files shared, so a shared-flag-based guard misses them.
Decide retention by version interval instead of by reading the pinned version's
metadata. A garbage file is kept iff it was live at a retained version, i.e.
there is a retained version V with create_version <= V < remove_version, where
remove_version is the metadata version that moved it into compaction_inputs /
orphan_files.
- TabletRetainInfo now holds only the retained-version set (no metadata reads,
so the NotFound stall cannot occur) and answers
retained_by_version(create, remove) and contains_version(v).
- collect_garbage_files decides each garbage file's creation version:
- compaction_inputs segments share the rowset's version and are retained by
rowset.version(). Lake partial-segment compaction can carry older segments
into a higher-versioned rowset, but it is config-gated (off by default),
non-PK, and being retired in favor of parallel compaction, so it is
deliberately not special-cased;
- del files can be transferred by cloud-native PK compaction onto a
higher-versioned rowset, so they carry a new optional DelfileWithRowsetId
.version and are retained per file;
- orphan files carry a new optional FileMetaPB.version, stamped at each
orphaning site from the source object's own version.
An unset/0 version means "unknown -> retain conservatively", never a false
delete. Keyed on version rather than the per-file shared flag, this protects
both shared and exclusive/identical inherited files.
No user-facing SQL/config/API/metric change; adds two backward-compatible
optional fields to the storage metadata proto. Range distribution is a new,
new-tables-only feature with no on-disk compatibility burden.
Signed-off-by: xiangguangyxg <xiangguangyxg@gmail.com>
0 commit comments