Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes bug in ls where old index entries come back #40

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

redmar
Copy link
Contributor

@redmar redmar commented Feb 3, 2023

I encountered a bug where old entries stay in the ls listing. We're using it to count the size of the cache so we can truncate it to a max size. The deletion of both content and index entry works fine but the ls command does not reflect it.

It seems to go wrong during the conversion of the Vec<SerializableMetadata> from buck_entries that get's converted to a HashSet<SerializableMetadata> where each entry after the first is not written into the map so you only get back the first entry of the index file. If you reverse the vec it goes fine. I've included a bug fix and regression test.

Thanks for this crate and your time on this!

Copy link
Owner

@zkat zkat left a comment

Choose a reason for hiding this comment

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

oh yeah. This totally makes sense. Thanks for finding and fixing this!

@zkat zkat merged commit d70bab5 into zkat:main Feb 3, 2023
zkat pushed a commit that referenced this pull request Feb 19, 2023
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.

2 participants