Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: (backport) purge may not work on tables after a flash back operation (#16812) #16816

Merged

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Nov 12, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Backport PR #16812

On tables that have undergone a FLASHBACK operation, this assumption is broken:

// Take the prev snapshot as base snapshot to avoid get orphan snapshot.

In this PR, the garbage collection root is determined by starting from the current snapshot and traversing backward to the target time point using the prev relation between snapshots. This approach enhances safety (allowing tables modified by the ALTER ... FLASHBACK operation to be handled correctly) but may require traversing a (much) longer history of the table being purged.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe): backport

This change is Reviewable

…endlabs#16812)

* fix: purge may not work on tables after a flash back operation

* fix

* fix test

* fix test
@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Nov 12, 2024
@dantengsky dantengsky marked this pull request as ready for review November 12, 2024 10:20
@dantengsky dantengsky merged commit c54c413 into databendlabs:release/v1.2.636-rc5 Nov 12, 2024
76 checks passed
dantengsky added a commit that referenced this pull request Nov 25, 2024
…tion (#16812) (#16816)

fix: purge may not work on tables after a flash back operation (#16812)

* fix: purge may not work on tables after a flash back operation

* fix

* fix test

* fix test

Co-authored-by: Sky Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants