-
Notifications
You must be signed in to change notification settings - Fork 772
chore: tweak transient table data retention settings #15346
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
base: main
Are you sure you want to change the base?
chore: tweak transient table data retention settings #15346
Conversation
- introduce new setting `transient_data_retention_time_in_minutes` which set the retention period (in minutes) of transient table - during purging data of transient table use the value of setting `transient_data_retention_time_in_minutes` in table navigation
6aedc87
to
66e66ac
Compare
66e66ac
to
730a84c
Compare
@dantengsky |
Thanks for asking! This PR aims to use a more conservative (longer) retention period when purging history for transient tables, instead of the current value of "0". Once merged, this should mean that transient tables will keep more historical data by default than they do now. Currently, the smallest unit for the retention period is a day, which is a bit too large for transient tables. Right now, the way transient table purging taking a risk of corrupting the target table in scenarios with concurrent modifications (including append-only writes). Basically, it might purge data from pending transactions that might be successfully committed later. Although this PR can mitigate the issue for now, it doesn't completely solve it. We need to further refine it (by checking the table's least visible timestamp at commit time) to fully fix the problem. |
Why not save the settings into table option rather than a dynamic global setting.
|
Good idea, at least |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Tweak transient table data retention settings
This PR introduces a new setting,
transient_data_retention_time_in_minutes
, to customize the retention period for transient table. This setting defines how long the historical data should be retained, with a default value of 60 minutes (i.e. 1 hour).Additionally, when purging data from transient tables, the retention period specified by
transient_data_retention_time_in_minutes
will now be utilized.Set
transient_data_retention_time_in_minutes
to 0 will "restore" the behavior of transient table before this PR.Tests
Type of change
This change is