Skip to content

Delay deletions of stale files#82

Draft
ctz wants to merge 1 commit intomainfrom
jbp-delay-deletions
Draft

Delay deletions of stale files#82
ctz wants to merge 1 commit intomainfrom
jbp-delay-deletions

Conversation

@ctz
Copy link
Member

@ctz ctz commented Feb 26, 2026

The race condition that this avoids is as follows: a revocation check races a fetch. The revocation first read the manifest, and finds files [A, B, C]. Now the fetch obtains the new manifest, which contains [B, C]. It saves the new manifest. It determines file A is unused, so it deletes it. Now the revocation check loads files from its (in memory manifest) and finds A to be missing.

We avoid this by having the fetch process avoid deleting files that are referenced by any prior manifest.

This is another component in fixing #31

The race condition that this avoids is as follows: a revocation
check races a fetch.  The revocation first read the manifest, and
finds files `[A, B, C]`.  Now the fetch obtains the new manifest,
which contains `[B, C]`.  It saves the new manifest.  It determines
file `A` is unused, so it deletes it.  Now the revocation check
loads files from its (in memory manifest) and finds `A` to be missing.

We avoid this by having the fetch process avoid deleting files that
are referenced by any prior manifest.
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 26, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks


Comparing jbp-delay-deletions (0213745) with main (2fc62dc)

Open in CodSpeed

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