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

feat: cleanup and repair commands #4587

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

feat: cleanup and repair commands #4587

wants to merge 4 commits into from

Conversation

notanatol
Copy link
Contributor

@notanatol notanatol commented Feb 20, 2024

Checklist

Description

Porting two of @ldeffenb functionalities for fixing incorrect reference count and removing invalid chunks from sharky.

Closes: #4566

refs := make(map[uint32]uint32)
for _, item := range items {
refs[item.item.RefCnt]++
newRefCnt := item.pinCnt*100 + item.reserveCnt + item.cacheCnt + item.uploadCnt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ldeffenb what is the reason for this multiplication? item.pinCnt*100

Copy link
Collaborator

Choose a reason for hiding this comment

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

That is one of my hacks that you don't need. In my case, if a chunk is pinned, I want it to STAY in the sharky regardless of the bugs that might inappropriately decrement the refCnt by 1 here or there. You'll just want pinCnt, and drop the *100.

@notanatol notanatol marked this pull request as draft February 21, 2024 23:22
@notanatol notanatol self-assigned this Feb 21, 2024
@notanatol notanatol marked this pull request as ready for review February 22, 2024 20:30
@notanatol notanatol added the ready for review The PR is ready to be reviewed label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull-request ready for review The PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API for localstore scanning
2 participants