Repository navigation
Fix/remove old metadata - #166
Draft
MohammedNaser28 wants to merge 1 commit into
Draft
MohammedNaser28 wants to merge 1 commit into
MohammedNaser28 wants to merge 1 commit into
Conversation
MohammedNaser28
force-pushed
the
fix/remove-old-metadata
branch
from
October 24, 2026 22:56
ed5fd3f to
84406a8
Compare
madonuko
reviewed
Oct 30, 2026
Comment on lines
+590
to
+610
| let res = (|| -> heed::Result<()> { | ||
| let mut wtxn = self.env.write_txn()?; | ||
| for href in &removed { | ||
| // SAFETY: we do not keep any references to the database's contents | ||
| self.tracked.delete(&mut wtxn, href.as_str())?; | ||
| } | ||
| for data in &fresh { | ||
| // Defense in depth: never track a href that the cleanup machinery could not | ||
| // delete. (Tracked entries only ever originate here, so this is a no-op guard.) | ||
| if !is_deletable_repodata_href(&data.location.href) { | ||
| tracing::warn!(href = %data.location.href, "metadata href is not deletable; it will not be garbage collected"); | ||
| continue; | ||
| } | ||
| self.tracked.put(&mut wtxn, data.location.href.as_str(), data)?; | ||
| } | ||
| wtxn.commit()?; | ||
| Ok(()) | ||
| })(); | ||
| if let Err(e) = res { | ||
| tracing::warn!(error = %e, "cannot update the tracked metadata locations"); | ||
| } |
Comment on lines
+580
to
+582
| Err(e) => { | ||
| tracing::warn!(href = %href, %e, "cannot remove obsolete metadata file; its tracking entry is kept so a later publication retries"); | ||
| } |
Member
There was a problem hiding this comment.
if the file is not found, add it to removed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this is related to #162