Skip to content

[core] Fix snapshot expiration for chain table delta commits - #9611

Open
huyuanfeng2018 wants to merge 4 commits into
apache:masterfrom
huyuanfeng2018:fix-chain-table-snapshot-expire-9595
Open

[core] Fix snapshot expiration for chain table delta commits#9611
huyuanfeng2018 wants to merge 4 commits into
apache:masterfrom
huyuanfeng2018:fix-chain-table-snapshot-expire-9595

Conversation

@huyuanfeng2018

Copy link
Copy Markdown
Contributor

Purpose

Fix #9595.

For Chain Tables, ChainTablePartitionExpire may delete expired partitions from the Snapshot branch during a Delta commit, creating a new Snapshot-branch metadata snapshot.

However, automatic snapshot expiration currently only runs for the committing Delta branch. As a result, old Snapshot-branch snapshots may remain and continue referencing expired files.

Changes

When the current branch is the configured Chain Table Delta branch, also expire snapshots on the configured Snapshot branch after the normal Delta-branch expiration.

The maintenance order remains:

  1. Partition expiration
  2. Delta-branch snapshot expiration
  3. Snapshot-branch snapshot expiration

Tests

Added a regression test covering:

Delta commit -> ChainTablePartitionExpire -> Snapshot partition deletion -> new Snapshot metadata snapshot -> Snapshot snapshot expiration

The test verifies that expired Snapshot partitions are removed and only the latest Snapshot-branch snapshot is retained.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Chain table Delta commits do not expire Snapshot branch snapshots after partition expiration

1 participant