object: Validate attribute EXPIRATION_EPOCH
on put
#1188
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#1188
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/1109-validate-exp-epoch"
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?
Close #1109
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -127,0 +129,4 @@
if !errors.Is(err, errNoExpirationEpoch) {
return fmt.Errorf("object did not pass expiration check: %w", err)
}
} else {
else if !unprepared
?Also,
checkExpiration
now contains a singleif
, we could move it here and renamecheckExpiration
tocheckIfExpired
. And checking whetherexpiration epoch
is less than the current epoch is valid for both types of objects, the only check that is specific isIsLocked
(because not-yet-created object cannot be locked).OMG, updated. Thanks.
@ -124,15 +124,24 @@ func (v *FormatValidator) Validate(ctx context.Context, obj *objectSDK.Object, u
return fmt.Errorf("invalid attributes: %w", err)
}
exp, err := expirationEpochAttribute(obj)
Also it could happen, that user has defined both of attributes:
objectV2.SysAttributeExpEpoch
andobjectV2.SysAttributeExpEpochNeoFS
. Maybe it has to be an error too?It definitely should be, but we will eventually remove NeoFS attribute, and currently we have deterministic behaviour, so I would leave it as is.
e0546ff767
to45f8630deb