Repository navigation
feat: Hard delete database and table - #26553
Merged
Merged
Conversation
stuartcarnie
marked this pull request as ready for review
June 24, 2025 00:40
praveen-influx
approved these changes
Jun 24, 2025
praveen-influx
left a comment
Contributor
There was a problem hiding this comment.
Looks good - should --hard-delete-default-duration be added to serve-all.txt as well? I couldn't see that in enterprise too. It's not a blocker, if it should be added we could add it in separate PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements hard deletion functionality for databases and tables in InfluxDB 3 Core (OSS). Previously, only soft deletion was supported, which marked objects as deleted but did not remove the underlying data or schema objects. This feature enables the complete removal of
.parquetsnapshot files for the deleted tables. The schema will be completely removed after a configurable grace period.Configuration
INFLUXDB3_HARD_DELETE_DEFAULT_DURATIONINFLUXDB3_DELETE_GRACE_PERIODUsage Examples
Notes
Architecture
This builds on the existing retention-policy enforcement processing, adding files for the deleted schema. These removed files are added to the next snapshot and removed from object storage.
The
PersistedFilesstructure implements theObjectDeletertrait:influxdb/influxdb3_write/src/deleter.rs
Lines 15 to 21 in b154c83
Which ensures it is notified when it should delete the database or table. This accounts for individual hard-delete time for each table.
As a result, file deletions only happen if the node is accepting writes and therefore regularly snapshotting, which is the same for retention policy enforcement. It is possible files aren't cleaned up with the current implementation if: