Skip to content

Conversation

@sryanyuan
Copy link
Contributor

PurgeObsoleteFiles will be called during compaction, flush, and similar operations, and it will be performed in the background threads (avoid-unnecessary-blocking-io is enabled).

Additionally, it may also be triggered when destroying an iterator in a user thread, in the case:

SST files will be deleted by background threads
while archived WAL log files will be unlinked directly in the user thread.
This design might cause high latency if there are many files to be deleted.

rocksdb.sst_file_delete_rate_bytes_per_sec can set the delete rate limit in bytes per second for SST files deletion.

In scenarios involving frequent database iterations (e.g., HGETALL, SCAN) obsolete WAL files may be deleted synchronously, causing latency spikes. Enabling this option activates a controlled slow deletion mechanism, which also resolves WAL deletion latency issues when an iterator is released.

@git-hulk
Copy link
Member

@sryanyuan Thanks for your contribution. Could you please add a test case in config_test.go to ensure this configuration?

@sryanyuan
Copy link
Contributor Author

@sryanyuan Thanks for your contribution. Could you please add a test case in config_test.go to ensure this configuration?

Done

Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@sonarqubecloud
Copy link

@git-hulk git-hulk merged commit 859953b into apache:unstable Jun 27, 2025
67 of 69 checks passed
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.

2 participants