engine: Lock operation has a power to resurrect expired regular objects #1527
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1527
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The method
(*StorageEngine).Lock
allows locking expired regular objects.Furthermore, once an expired object is locked, it becomes available for retrieval because of a tricky check in the
meta.objectStatus
method. This method is indirectly used by bothmeta.(*DB).Get
andmeta.(*DB).Exists
:Expected Behavior
The engine shouldn't lock the expired object and should return some error.
Current Behavior
The engine locks the expired object.
Steps to Reproduce (for bugs)
Consider the following unit test which fails:
Context
It prevents the garbage collector from handling expired regular objects as expected, because the GC uses the
shard.(*Shard).Inhume
method to delete them (the same method used in the test above).It is like this by design, locked objects must be able to be retrieved until the last lock is removed.
I agree, but should it be allowed to lock already expired object?
I mean the following order:
and not this order (in this case, the object is available after its expiration):
In general, we don't know the order.
E.g. what to do with this case:
Should I add a test* to document this behavior?
*Not the test mentioned above, but another one
Yes, a test would be nice, if we do not have any.
Metabase resync is similar to the scenario I described btw.