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: purge may not work on tables after a flash back operation #16812

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

SkyFan2002
Copy link
Member

@SkyFan2002 SkyFan2002 commented Nov 12, 2024

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

Summary

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 - use existing tests

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):

This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Nov 12, 2024
@SkyFan2002 SkyFan2002 marked this pull request as ready for review November 12, 2024 08:21
Copy link
Member

@zhyass zhyass left a comment

Choose a reason for hiding this comment

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

LGTM
Maybe need to add some notes on possible impacts to the summary.

@dantengsky dantengsky added this pull request to the merge queue Nov 12, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Nov 12, 2024
@BohuTANG BohuTANG merged commit e35bacc into databendlabs:main Nov 12, 2024
83 checks passed
@dantengsky
Copy link
Member

LGTM Maybe need to add some notes on possible impacts to the summary.

PR summary updated, pls let me know if there are any other concerns.

dantengsky pushed a commit to dantengsky/fuse-query that referenced this pull request Nov 12, 2024
…endlabs#16812)

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

* fix

* fix test

* fix test
dantengsky added a commit that referenced this pull request Nov 12, 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]>
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.

4 participants