Refactor replicator #517

Merged
fyrchik merged 3 commits from dstepanov-yadro/frostfs-node:feat/replicator-put-single into master 2023-07-18 10:52:13 +00:00
Showing only changes of commit a53bc2036f - Show all commits

View file

@ -6,7 +6,10 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine"
putsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/put" putsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/put"
"git.frostfs.info/TrueCloudLab/frostfs-observability/tracing"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap" "go.uber.org/zap"
) )
@ -28,6 +31,13 @@ func (p *Replicator) HandleTask(ctx context.Context, task Task, res TaskResult)
) )
}() }()
ctx, span := tracing.StartSpanFromContext(ctx, "Replicator.HandleTask",
trace.WithAttributes(
attribute.Stringer("address", task.Addr),
attribute.Int64("number_of_copies", int64(task.NumCopies)),
))
defer span.End()
if task.Obj == nil { if task.Obj == nil {
var err error var err error
task.Obj, err = engine.Get(ctx, p.localStorage, task.Addr) task.Obj, err = engine.Get(ctx, p.localStorage, task.Addr)