Skip to content

Fix/remove old metadata - #166

Draft
MohammedNaser28 wants to merge 1 commit into
FyraLabs:mainfrom
MohammedNaser28:fix/remove-old-metadata
Draft

MohammedNaser28 wants to merge 1 commit into
FyraLabs:mainfrom
MohammedNaser28:fix/remove-old-metadata

Conversation

@MohammedNaser28

@MohammedNaser28 MohammedNaser28 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

this is related to #162

@MohammedNaser28
MohammedNaser28 force-pushed the fix/remove-old-metadata branch from ed5fd3f to 84406a8 Compare October 24, 2026 22:56

@madonuko madonuko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thank you very much!

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");
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

try block?

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");
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if the file is not found, add it to removed

@madonuko madonuko linked an issue Oct 30, 2026 that may be closed by this pull request
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.

Old metadata files are not removed

2 participants