[#146] Add more log entries

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-03-21 09:18:20 +03:00
parent d6486d172e
commit d2bc0b83b1
10 changed files with 35 additions and 5 deletions

View file

@ -2,6 +2,7 @@ package engine
import (
"errors"
"strconv"
"sync"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
@ -141,6 +142,7 @@ func (e *StorageEngine) reportShardError(
if isLogical(err) {
e.log.Warn(msg,
zap.Stringer("shard_id", sh.ID()),
zap.String("logical", strconv.FormatBool(true)),
zap.String("error", err.Error()))
return
}

View file

@ -144,6 +144,10 @@ func (e *StorageEngine) inhumeAddr(ctx context.Context, addr oid.Address, prm sh
var siErr *objectSDK.SplitInfoError
if !errors.As(err, &siErr) {
e.log.Warn("could not check for presents in shard",
zap.Stringer("shard_id", sh.ID()),
zap.Stringer("address", addr),
zap.String("error", err.Error()))
e.reportShardError(sh, "could not check for presents in shard", err)
return
}

View file

@ -136,11 +136,13 @@ func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool
errors.Is(err, common.ErrReadOnly) || errors.Is(err, common.ErrNoSpace) {
e.log.Warn("could not put object to shard",
zap.Stringer("shard_id", sh.ID()),
zap.String("error", err.Error()))
zap.String("error", err.Error()),
zap.Stringer("address", object.AddressOf(obj)),
)
return
}
e.reportShardError(sh, "could not put object to shard", err)
e.reportShardError(sh, "could not put object to shard", err, zap.Stringer("address", object.AddressOf(obj)))
return
}

View file

@ -59,7 +59,9 @@ func (s *Shard) Put(prm PutPrm) (PutRes, error) {
if err != nil || !tryCache {
if err != nil {
s.log.Debug("can't put object to the write-cache, trying blobstor",
zap.String("err", err.Error()))
zap.String("err", err.Error()),
zap.Stringer("address", putPrm.Address),
)
}
res, err = s.blobStor.Put(putPrm)

View file

@ -34,7 +34,7 @@ func (s *Service) Delete(ctx context.Context, prm Prm) error {
}
func (exec *execCtx) execute(ctx context.Context) {
exec.log.Debug("serving request...")
exec.log.Debug("serving delete request...")
// perform local operation
exec.executeLocal(ctx)

View file

@ -2,6 +2,7 @@ package deletesvc
import (
"context"
"strconv"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
@ -40,6 +41,8 @@ func (exec *execCtx) formTombstone(ctx context.Context) (ok bool) {
)
exec.addMembers([]oid.ID{exec.address().Object()})
exec.log.Debug("tombstone lifetime " + strconv.FormatUint(exec.tombstone.ExpirationEpoch(), 10))
exec.log.Debug("CurrentEpoch " + strconv.FormatUint(exec.svc.netInfo.CurrentEpoch(), 10))
exec.log.Debug("forming split info...")
ok = exec.formSplitInfo(ctx)

View file

@ -198,7 +198,10 @@ func (t *distributedTarget) iteratePlacement(ctx context.Context) (*transformer.
if t.traversal.submitPrimaryPlacementFinish() {
_, err = t.iteratePlacement(ctx)
if err != nil {
t.log.Error("additional container broadcast failure", zap.Error(err))
t.log.Error("additional container broadcast failure",
zap.Error(err),
zap.String("address", object.AddressOf(t.obj).String()),
)
// we don't fail primary operation because of broadcast failure
}
}

View file

@ -109,6 +109,11 @@ func (exec *execCtx) processCurrentEpoch(ctx context.Context) bool {
mtx.Lock()
exec.writeIDList(ids)
for _, id := range ids {
exec.log.Debug("found id on node "+string(info.PublicKey()),
zap.String("id", id.String()),
)
}
mtx.Unlock()
}(i)
}

View file

@ -18,5 +18,12 @@ func (exec *execCtx) executeLocal() {
return
}
for _, id := range ids {
exec.log.Debug("found id",
zap.String("id", id.String()),
zap.String("for", exec.containerID().String()),
)
}
exec.writeIDList(ids)
}

View file

@ -129,6 +129,8 @@ func (p *Policer) processObject(ctx context.Context, addrWithType objectcore.Add
if !c.needLocalCopy && c.removeLocalCopy {
p.log.Info("redundant local object copy detected",
zap.Stringer("object", addr),
zap.Bool("c.needLocalCopy", c.needLocalCopy),
zap.Bool("c.removeLocalCopy", c.removeLocalCopy),
)
p.cbRedundantCopy(ctx, addr)