forked from TrueCloudLab/frostfs-node
[#1634] node: Do not return expired objects
If an object has not been marked for removal by the GC in the current epoch yet but has already expired, respond with `ErrObjectNotFound` api status. Also, optimize shard iteration: a node must stop any iteration if the object is found but gonna be removed soon. All the checks are performed by the Metabase. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
9aba0ba512
commit
156ba85326
28 changed files with 230 additions and 36 deletions
|
@ -118,6 +118,17 @@ func TestGraveOnlyDelete(t *testing.T) {
|
|||
require.NoError(t, metaDelete(db, addr))
|
||||
}
|
||||
|
||||
func TestExpiredObject(t *testing.T) {
|
||||
db := newDB(t, meta.WithEpochState(epochState{currEpoch}))
|
||||
|
||||
checkExpiredObjects(t, db, func(exp, nonExp *objectSDK.Object) {
|
||||
// removing expired object should be error-free
|
||||
require.NoError(t, metaDelete(db, object.AddressOf(exp)))
|
||||
|
||||
require.NoError(t, metaDelete(db, object.AddressOf(nonExp)))
|
||||
})
|
||||
}
|
||||
|
||||
func metaDelete(db *meta.DB, addrs ...oid.Address) error {
|
||||
var deletePrm meta.DeletePrm
|
||||
deletePrm.SetAddresses(addrs...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue