Skip to content

Leaked pre-delete sealed file must not resurrect keys - #19

Open
paulocsanz wants to merge 2 commits into
beyondoss:mainfrom
paulocsanz:dst/b51-reclaim-leak
Open

Leaked pre-delete sealed file must not resurrect keys#19
paulocsanz wants to merge 2 commits into
beyondoss:mainfrom
paulocsanz:dst/b51-reclaim-leak

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

Reclaim unlinks old sealed files best-effort and returns Ok on leak. apply_footer_entries only inserts. A data-0.log that comes back after a compact (crash between rename and unlink, or remove_file Err) puts tombstoned keys back in the index.

Two commits: failing leak-and-reopen test, then a durable data-N.log.replaces sidecar written before unlink. Open skips those file ids. Sidecars union parent replaces so a later compact still hides the original inputs.

  • Live keys come from the compact footer
  • Leaked pre-delete files are ignored

apply_footer_entries is insert-only. An unlinked pre-delete file
that reappears on disk puts the tombstoned key back in the index.
apply_footer is insert-only. If unlink of an input fails (or a
crash leaves the file), reopen applies the old footer and
resurrects deletes. Write data-N.log.replaces before unlink;
open ignores those ids even if the log reappears.
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.

1 participant