Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

fix: replace vacuum delay with epoch grace period - #184

Closed
pathscale wants to merge 1 commit into
masterfrom
fix/epoch-vacuum-reclamation
Closed

fix: replace vacuum delay with epoch grace period#184
pathscale wants to merge 1 commit into
masterfrom
fix/epoch-vacuum-reclamation

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Summary

  • replace vacuum's fixed 100 ms grace delay with a two-epoch quiescence protocol
  • reserve reused free links with an RAII lease and keep the lease through index publication/unghosting in insert, CDC insert, reinsert, and CDC reinsert
  • close reuse admission before advancing the epoch, then asynchronously wait for every prior-epoch lease to finish
  • take the fragmentation snapshot after the grace period
  • preserve the public EmptyLinkRegistry::pop_max signature

This closes the in-flight free-link reuse race that the old sleep attempted to cover. It does not claim a general reader epoch across index lookup and row deserialization; that broader read-vs-vacuum validation remains separate work.

Performance

Added simple_delete_insert_reuse, which measures the delete/insert churn path where the epoch atomics execute. Five alternating copied-binary pairs (30 samples, 0.5 s warm-up, 1 s measurement) produced paired changes of:

  • +1.2%
  • -1.3%
  • +1.8%
  • +0.0%
  • -0.5%

Median change was approximately +0.0%, with no consistent regression, so this is not feature-gated. Vacuum also no longer pays the unconditional 100 ms delay.

Verification

  • cargo test (117 unit; 324 integration passed, 5 existing ignores)
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check
  • regression: vacuum cannot finish its grace period while a prior-epoch reuse lease is alive
  • regression: a reused-link lease remains alive until its caller completes publication

@pathscale

Copy link
Copy Markdown
Owner Author

Superseded by #187, which consolidated and merged the backend-selection and publication hardening work after the combined review and validation rounds.

@pathscale pathscale closed this Aug 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant