metabase: Skip expired objects in ListWithCursor
#1583
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1583
Loading…
Reference in a new issue
No description provided.
Delete branch "a-savchuk/frostfs-node:do-not-list-expired-objects"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Before this change, the result of
ListWithCursor
included expired objects. This caused unnecessary attempts by the replicator to replicate these objects, leading to errors like this one below:selectNFromBucket
431e96f3c5ListWithCursor
3398e65dcfTestLisObjectsWithCursor
c926fe4065
to967072e52d
967072e52d
to2473257925
WIP: metabase: Skip expired objects into metabase: Skip expired objects inListWithCursor
ListWithCursor
2473257925
tob49ce50daa
b49ce50daa
todffae78eb2
Please, look at the already existing fix which was not in master for some reason
284b270c1f
It seems shorter and handles expired but locked objects (which thus should be available).
There should be tests for expired but locked objects too.
@ -125,3 +128,3 @@
}
func (db *DB) listWithCursor(tx *bbolt.Tx, result []objectcore.Info, count int, cursor *Cursor) ([]objectcore.Info, *Cursor, error) {
func (db *DB) listWithCursor(ctx context.Context, tx *bbolt.Tx, result []objectcore.Info, count int, cursor *Cursor) ([]objectcore.Info, *Cursor, error) {
Please, let's not have any
ctx
in unexported function of the metabase package.It is unnecessary an complicates code.
Fixed
@ -225,6 +234,9 @@ func selectNFromBucket(bkt *bbolt.Bucket, // main bucket
if !threshold {
c.Seek(offset)
// TODO(@a-savchuk): What'd be if the object with this offset was
What do we need to do in this TODO?
If we can't decode one object ID, we skip the rest of the bucket. We can't log this error. I'm not sure, maybe use
continue
?It is unrelated to the PR, please create an issue instead.
dffae78eb2
to3260fd60b3
3260fd60b3
tofa08bfa553