node: Implement Get\Head
requests for EC object #1103
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#1103
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:feature/ec-get-head"
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?
With these changes it is possible to get\head erasure-coded objects via cli.
Example output for
GET
:Output for
HEAD
andHEAD
with--raw
:Output for
HEAD
with--raw
and one unavailable node:Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
a7a14f0ff6
toed7040b1dd
ed7040b1dd
toffd080219b
ffd080219b
to76777820cf
@ -111,6 +116,7 @@ const (
GetCompletingTheOperation = "completing the operation"
GetRequestedObjectWasMarkedAsRemoved = "requested object was marked as removed"
GetRequestedObjectIsVirtual = "requested object is virtual"
GetRequestedObjectIsEC = "requested object is erasure coded"
We have "erasure coded" here and "erasure-encoded" in CLI print.
Wikipedia uses "erasure-coded" https://en.wikipedia.org/wiki/Erasure_code, let's stick with it.
Agree, updated here in other places.
@ -109,3 +117,3 @@
return len(outEI.Chunks) == int(outEI.Chunks[0].Total)
case client.IsErrObjectAlreadyRemoved(err):
outError = err
unrelated to the commit
This change required because we have check for amount of lines in method. Don't want to do refactoring in scope of this PR.
That is what I mean by unrelated, can we have a separate commit for it, before the EC changes?
Well, there is another whitespace change commit already.
Ok, moved to the separate commit.
@ -5,6 +5,8 @@ import (
"fmt"
"time"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
We try not to use api directly anywhere besides services, can we use SDK here?
Thanks, removed this import from here and another files. SDK updated accordingly.
@ -0,0 +44,4 @@
// Assemble assembles erasure coded object and writes it's content to ObjectWriter.
// It returns parent object.
func (a *assemblerec) Assemble(mainCtx context.Context, writer ObjectWriter, headOnly bool) (*objectSDK.Object, error) {
When we are to add GET_RANGE do we need to alter this function or write code in another place?
We need to extend assembler for EC a bit, yes.
@ -34,1 +36,4 @@
default:
r.log.Debug(logs.GetRemoteCallFailed, zap.Error(err))
if r.status == statusEC {
return len(r.infoEC.Chunks) == int(r.infoEC.Chunks[0].Total)
What does this condition checks?
We need to continue to process the nodes in case of getting error from the node. Updated this line a bit.
@ -60,0 +66,4 @@
util.MergeECInfo(r.infoEC, errECInfo.ECInfo())
r.infoEC = errECInfo.ECInfo()
r.err = objectSDK.NewECInfoError(r.infoEC)
// TODO maybe we don't need to get all chunks here
Each TODO should be accompanied by an issue, could you create one?
Anyway, the condition here is easy to fix, the number of chunks we must have is equal to
placementpolicy.ECDataCount()
Fixed.
76777820cf
toc588a8793c
c588a8793c
tocfa9932859
cfa9932859
toe9eec6c013
e9eec6c013
to4dc52f023c
WIP: node: Implementto node: ImplementGet\Head
requests for EC objectGet\Head
requests for EC object@ -0,0 +61,4 @@
var errRemovedRemote *apistatus.ObjectAlreadyRemoved
var errOutOfRangeRemote *apistatus.ObjectOutOfRange
var errRemovedLocal *apistatus.ObjectAlreadyRemoved
var errOutOfRangeLocal *apistatus.ObjectOutOfRange
Look like remote and local errors are the same.
Removed.
Incompleted
Sorry, fixed.
@ -0,0 +99,4 @@
}
obj, err := c.Reconstruct(parts)
if err == nil {
err = writer.WriteHeader(ctx, obj.CutPayload())
ctx -> mainCtx, or even better to move
errgroup
related code to separate func.As far as I remember errgoup's ctx is cancelled after Wait.
Thanks a lot! Split on two functions.
4dc52f023c
todd89b6cf14
dd89b6cf14
to7802bf33ee
7802bf33ee
to534b752134
534b752134
toa295c9075e
a295c9075e
to112a7c690f