Add PutSingle implementation #486
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#486
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/put_single"
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?
Relates TrueCloudLab/frostfs-api#9
d74ed24e08
tofe7228d27d
afe6628551
toc01c96de52
c01c96de52
to23e09e6897
23e09e6897
to191a91b938
191a91b938
toaff38c4322
aff38c4322
to6da225b09a
WIP: Add PutSingle implementationto Add PutSingle implementationbc23500c1f
to362978edb4
LGTM
@ -446,0 +494,4 @@
if !b.checker.CheckBasicACL(reqInfo) || !b.checker.StickyBitCheck(reqInfo, idOwner) {
return nil, basicACLErr(reqInfo)
} else if err := b.checker.CheckEACL(request, reqInfo); err != nil {
nit: the
else
seems unnecessary.fixed
@ -0,0 +34,4 @@
type putSingleRequestSigner struct {
req *objectAPI.PutSingleRequest
keyStorage *svcutil.KeyStorage
signer *sync.Once
the pointer is not needed. Optionally, you can just embed the
sync.Once
and callDo
directly.I prefer pointers in fields, so I'll leave it that way if it's not a bug.
it's not a bug, but it makes it easier to forget filling the field and a panic will follow. Without pointer is not without disadvantages (e.g. it can be accidentally copied), but still. Up to you.
@ -0,0 +43,4 @@
metaHdr := new(sessionV2.RequestMetaHeader)
meta := s.req.GetMetaHeader()
metaHdr.SetTTL(meta.GetTTL() - 1)
why minus one?
because current node handled request, so for the next node TTL = current TTL - 1
@ -0,0 +131,4 @@
func (s *Service) validatePutSingleObject(ctx context.Context, obj *objectSDK.Object) error {
if err := s.fmtValidator.Validate(ctx, obj, false); err != nil {
return fmt.Errorf("coult not validate object format: %w", err)
s/coult/could
fixed
@ -0,0 +204,4 @@
return fmt.Errorf("could not create object placement traverser: %w", err)
}
resultError := &atomic.Value{}
doesn't need to be pointer. Pass it via
&resultError
tosaveToPlacementNodes
.fixed
@ -0,0 +240,4 @@
nodeAddresses []placement.Node,
resultError *atomic.Value,
) bool {
wg := &sync.WaitGroup{}
doesn't need to be pointer.
fixed
@ -0,0 +248,4 @@
continue
}
wg.Add(1)
can we move this to the line right before
Submit
? makes it easier to read ifwg.Add
andwg.Done
are close to each other.fixed
@ -0,0 +336,4 @@
)
}
stop = err == nil
nit: these are a bit hard to follow, but not sure how to improve it.
362978edb4
tof412c18a4e
f412c18a4e
to909de9c193
337f6f7c23
tob9623a09df
b9623a09df
toa65e26878b