Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #60166

…60166)

### What problem does this PR solve?

- Related PR: #53327 

## Problem
Queries like `FOR VERSION AS OF '<tag>'` fail when the tag points to a
snapshot whose snapshot file has expired, even though the tag is still
valid and data should be retained by tag.

## Root Cause
Doris always translated time-travel requests into `scan.snapshot-id`.
Paimon validates snapshot-id against the current snapshot range; once a
snapshot file is expired, it is out of range and the query fails.
Tag-based reads should use `scan.tag-name` instead, which bypasses that
snapshot range validation.

## Fix
Use `scan.tag-name` for tag-based time travel (`@tag` and `FOR VERSION
AS OF '<tag>'`), and keep `scan.snapshot-id` only for numeric
snapshot-id queries. Add regression coverage that:
- validates tag reads succeed after snapshot expiration
- validates direct snapshot-id reads against expired snapshots still
fail
@github-actions github-actions bot requested a review from yiguolei as a code owner January 26, 2026 02:46
@Thearas
Copy link
Contributor

Thearas commented Jan 26, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Jan 26, 2026
@Thearas
Copy link
Contributor

Thearas commented Jan 26, 2026

run buildall

@yiguolei yiguolei merged commit e4c0030 into branch-4.0 Jan 26, 2026
25 of 28 checks passed
@github-actions github-actions bot deleted the auto-pick-60166-branch-4.0 branch January 26, 2026 09:09
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.

5 participants