refactor(storage): stream vacuum2 block gc - #20402
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f81aa48312
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
2c40df1 to
8e9550e
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
b50286e to
ec8f22b
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
ec8f22b to
28ec851
Compare
28ec851 to
295b3f1
Compare
295b3f1 to
ed176b4
Compare
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Reduce peak memory usage in
fuse_vacuum2block garbage collection for very large tables.This PR is a follow-up to the protected-segment chunking change. It avoids materializing all candidate block listing results in memory before deletion while preserving the existing
vacuumedresult contract.The main memory reduction is to avoid keeping all listed block
Entryvalues and intermediate block path vectors in memory at once. This matters for very large_b/directories because each OpenDALEntrycarries both the object path and metadata; the metadata portion is significant and should not be treated as negligible when millions of entries are listed.This PR intentionally preserves the existing result contract and still returns the complete list of removed files. The remaining memory pressure from retaining all removed file paths for the result set will be addressed in a follow-up PR with an explicit API/behavior design.
Changes:
untilprefix as before.Vec<Entry>/ candidate block path vectors.untilboundary, because FS listing order is not guaranteed.last_modifiedhandling.vacuumedfile list.Safety notes:
Tests
cargo test -p databend-enterprise-query vacuum_table_v2 --lib -- --nocapturecargo test -p databend-enterprise-query --test it storages::fuse::operations::vacuum2 -- --nocapturecargo check -p databend-common-storages-fuseType of change
AI assistance
This change is