Skip to content

fix(table): create branches from tags with expired snapshots - #1221

Merged
JingsongLi merged 4 commits into
apache:mainfrom
QuakeWang:expired-tag
Oct 28, 2026
Merged

JingsongLi merged 4 commits into
apache:mainfrom
QuakeWang:expired-tag

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

Creating a branch from a tag fails when the live snapshot JSON has expired, even though the tag still preserves the Snapshot.

Brief change log

Keep copying live snapshots when present. Otherwise, write the Snapshot parsed from the tag into the new branch. Preserve tag/schema copies and propagate storage errors.

Tests

  • 4 regression tests and 37 existing branch tests passed with fulltext,vortex.
  • Workspace formatting and Clippy checks passed on CI-pinned Rust 1.98.0.

API and Format

Unchanged.

Documentation

Not required.

Restore snapshots preserved by tags when the live snapshot JSON has
expired. Keep live snapshot copying and propagate storage failures.

Cover tagged reads, source preservation, missing tags, and errors during
existence checks, copying, and fallback writes.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requirement fit: SUPPORTED. Implementation: FINDINGS at 5ded5e2. Restoring a branch from a retained tag after snapshot expiry has clear end-to-end value, but the serialization fallback loses current Java snapshot metadata.

Local validation: 67 branch-related library tests and all 4 branch_from_tag integration tests passed. An additional real-file probe truncates a table, adds the operation field written by current Java to the snapshot/tag, creates a live-copy control branch, deletes the live snapshot and restores a second branch. The live control preserves operation=TRUNCATE; the expired-snapshot branch drops it and fails the same assertion. Current Java's Snapshot/Tag handling, snapshots system table and RTAS commit consumer were independently checked. Details inline. No Java RTAS workload was executed. Formatting and diff checks passed.

Restore expired snapshots from the copied tag payload instead of
serializing the narrower Rust Snapshot model. Remove only tag creation
and retention metadata, preserving operation and unknown snapshot fields.

Cover a real truncate live/expired comparison and failures reading the
copied tag.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
Use the built-in file backend for fixture commits so snapshot publication
uses the atomic local-filesystem path required by current main.

Derive metadata paths from each temporary table location and scope the
fault-injection operator to that table, preserving all existing checks.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
@QuakeWang
QuakeWang requested a review from JingsongLi October 27, 2026 13:52

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JingsongLi
JingsongLi merged commit 517a948 into apache:main Oct 28, 2026
15 checks passed
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.

2 participants