[#839] service/object: Do not use request forwarding when assembling object

Forwarding mechanism resends original request. During split object chain traversal,
storage node performs multiple `object.Head` requests on each child. If request
forwarding happens, then `object.Head` returns object ID of the original request.
This produces infinite assembly loop.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-09-22 17:04:45 +03:00 committed by Alex Vanin
parent 057d3ac06b
commit b3464e8140
3 changed files with 6 additions and 8 deletions

View file

@ -12,7 +12,11 @@ func (exec *execCtx) assemble() {
return return
} }
exec.assembling = true // do not use forwarding during assembly stage
// assembly flag is not inherited in produced
// `execCtx`, however `commonPrm` does, so it
// makes sense to nil it there
exec.prm.SetRequestForwarder(nil)
exec.log.Debug("trying to assemble the object...") exec.log.Debug("trying to assemble the object...")

View file

@ -41,12 +41,6 @@ type execCtx struct {
head bool head bool
curProcEpoch uint64 curProcEpoch uint64
// true when the processing of the initial request
// is turned to assembling stage. When false,
// initial request can be forwarded during network
// communication.
assembling bool
} }
type execOption func(*execCtx) type execOption func(*execCtx)

View file

@ -82,7 +82,7 @@ func (c *clientCacheWrapper) get(addr network.AddressGroup) (getClient, error) {
} }
func (c *clientWrapper) getObject(exec *execCtx, addr network.AddressGroup) (*objectSDK.Object, error) { func (c *clientWrapper) getObject(exec *execCtx, addr network.AddressGroup) (*objectSDK.Object, error) {
if !exec.assembling && exec.prm.forwarder != nil { if exec.prm.forwarder != nil {
return exec.prm.forwarder(addr, c.client) return exec.prm.forwarder(addr, c.client)
} }