forked from TrueCloudLab/frostfs-node
Revert "[#262] meta: Do not return old expired objects"
This reverts commit 3d23b087
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
e9461686b8
commit
09938a9841
4 changed files with 1 additions and 45 deletions
|
@ -4,9 +4,7 @@ import (
|
|||
"bytes"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
|
||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
||||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
|
@ -261,26 +259,3 @@ func isLockObject(tx *bbolt.Tx, idCnr cid.ID, obj oid.ID) bool {
|
|||
bucketNameLockers(idCnr, make([]byte, bucketKeySize)),
|
||||
objectKey(obj, make([]byte, objectKeySize)))
|
||||
}
|
||||
|
||||
// performs object validity checks.
|
||||
func validate(obj *object.Object, currEpoch uint64) error {
|
||||
for _, a := range obj.Attributes() {
|
||||
if key := a.Key(); key != objectV2.SysAttributeExpEpoch && key != objectV2.SysAttributeExpEpochNeoFS {
|
||||
continue
|
||||
}
|
||||
|
||||
expEpoch, err := strconv.ParseUint(a.Value(), 10, 64)
|
||||
if err != nil {
|
||||
// unexpected for already stored and valudated objects
|
||||
return fmt.Errorf("expiration epoch parsing: %w", err)
|
||||
}
|
||||
|
||||
if expEpoch < currEpoch {
|
||||
return ErrObjectIsExpired
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue