Fix updating storage ID when flushing objects from writecache #739
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#739
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/writecache_flush_inf"
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?
If object marked as GC before flush (by policier for example), then this object will be in writecache forever.
So now logical errors are skipped when updating storage ID, because GC also requires correct storageID to delete object.
Adding an object to the metabase, if it is not there, is not correct. Scenario: the object is still in the cache, but the garbage collector has removed it from the metabase, then we will create an object in metabase that should not be.
Also
shard.Delete
method was fixed. Now GC will wait (skip) object, if it doesn't exist in blobstore. So GC waits while writecache flushes object to blobstore.b53a2873fe
tofa9e825948
@ -94,3 +96,3 @@
// UpdateStorageID updates storage descriptor for objects from the blobstor.
func (db *DB) UpdateStorageID(prm UpdateStorageIDPrm) (res UpdateStorageIDRes, err error) {
func (db *DB) UpdateStorageID(ctx context.Context, prm UpdateStorageIDPrm) (res UpdateStorageIDRes, err error) {
Can we add a test specifically for this behaviour?
Done
@ -108,3 +125,3 @@
err = db.boltDB.Batch(func(tx *bbolt.Tx) error {
exists, err := db.exists(tx, prm.addr, currEpoch)
if err == nil && exists || errors.Is(err, ErrObjectIsExpired) {
if err == nil && exists || errors.As(err, new(logicerr.Logical)) {
I see we do this in engine already, but what is the benefit compared to
errors.Is
?We compare types, not values:
I've missed we do not implement
Is
for logical type671f3c3d80
tof2437f7ae9