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

fix: prevent reserve put for out of depth chunks #3627

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/localstore/mode_put.go
Expand Up @@ -451,6 +451,12 @@ func (db *DB) putSync(
}
}

// if we try to add a new item at a lesser radius than the last known eviction
// radius of the batch, we should not add the chunk to reserve, but to cache
if !withinRadius(db, item) {
return db.addToCache(batch, item)
}

found, err := db.pullIndex.Has(item)
if err != nil {
return 0, err
Expand Down