Skip to content

fix(storage): avoid collecting vacuum2 result files - #20419

Open
dantengsky wants to merge 8 commits into
databendlabs:mainfrom
dantengsky:fix/vacuum2-result-memory
Open

fix(storage): avoid collecting vacuum2 result files#20419
dantengsky wants to merge 8 commits into
databendlabs:mainfrom
dantengsky:fix/vacuum2-result-memory

Conversation

@dantengsky

@dantengsky dantengsky commented Sep 1, 2026

Copy link
Copy Markdown
Member

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

Summary

vacuum2 previously accumulated every deleted block, index, segment, and snapshot path in a Vec<String>, even when invoked through CALL system$fuse_vacuum2(...), where the result was discarded. This made peak memory grow with the total number of deleted files.

This PR:

  • Changes the vacuum2 handler result from Result<Vec<String>> to Result<()>
  • Removes deleted-path accumulation from block GC and metadata cleanup
  • Retains count-based status reporting through BlockGcStats
  • Makes direct SELECT * FROM fuse_vacuum2(...) return zero rows instead of per-file paths
  • Adds Rust and SQL regression coverage for the zero-row result while continuing to verify storage cleanup

The disabled fake-time harness (8_faked_time_prepare / 9_faked_time) and its dead CI action/script are removed. Its useful coverage now runs in the normal Rust unit-test CI: deterministic retention-cutoff boundary tests plus an EE integration test that persists a middle-snapshot LVT and verifies respect_flash_back=true selects that snapshot as the GC root.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

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

The behavior change is limited to callers that consume per-file rows from SELECT * FROM fuse_vacuum2(...); the documented operational CALL system$fuse_vacuum2(...) path continues to report success without file details.

AI assistance

  • AI usage: An AI coding agent investigated the vacuum2 result construction, drafted the implementation and regression tests, and ran the validation commands listed above
  • Responsible human: @dantengsky
  • The responsible human has read every line of this diff and can explain each change

This change is Reviewable

@github-actions github-actions Bot added the pr-bugfix this PR patches a bug in codebase label Sep 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e6ec9ff95

ℹ️ 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".

@dantengsky

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: b1b53c8dbb

ℹ️ 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".

@dantengsky
dantengsky added this pull request to the merge queue Sep 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 2, 2026
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.

2 participants