From d4493a6d082011cfa24df68b41d92c7b905fda27 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 23 Sep 2024 15:07:10 +0300 Subject: [PATCH] [#1390] getSvc: Fix Head EC1.1 If local EC chunk found, but remote node is off, then `HEAD --raw` request returns object not found. Signed-off-by: Dmitrii Stepanov --- pkg/services/object/get/container.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/services/object/get/container.go b/pkg/services/object/get/container.go index d22b14192..034768c81 100644 --- a/pkg/services/object/get/container.go +++ b/pkg/services/object/get/container.go @@ -26,8 +26,10 @@ func (r *request) executeOnContainer(ctx context.Context) { return } + localStatus := r.status + for { - if r.processCurrentEpoch(ctx) { + if r.processCurrentEpoch(ctx, localStatus) { break } @@ -43,7 +45,7 @@ func (r *request) executeOnContainer(ctx context.Context) { } } -func (r *request) processCurrentEpoch(ctx context.Context) bool { +func (r *request) processCurrentEpoch(ctx context.Context, localStatus int) bool { r.log.Debug(logs.ProcessEpoch, zap.Uint64("number", r.curProcEpoch), ) @@ -56,7 +58,11 @@ func (r *request) processCurrentEpoch(ctx context.Context) bool { ctx, cancel := context.WithCancel(ctx) defer cancel() - r.status = statusUndefined + if localStatus == statusEC { // possible only for raw == true and local == false + r.status = statusEC + } else { + r.status = statusUndefined + } for { addrs := traverser.Next() -- 2.45.2