Skip to content

Commit

Permalink
shard: improve logging on object putting
Browse files Browse the repository at this point in the history
Masked error-less shard skipping makes debugging awful, relates #2860.

Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
carpawell committed Jun 12, 2024
1 parent e5da072 commit 5d9e36d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/local_object_storage/engine/evacuate.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ mainLoop:
}

hrw.Sort(shards, addrHash)

for j := range shards {
if _, ok := shardMap[shards[j].ID().String()]; ok {
continue
Expand All @@ -164,6 +165,8 @@ mainLoop:
}
continue loop
}

e.log.Debug("could not put to shard, trying another", zap.String("shard", shards[j].ID().String()))
}

if prm.handler == nil {
Expand Down
10 changes: 10 additions & 0 deletions pkg/local_object_storage/engine/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool

exists, err := sh.Exists(existPrm)
if err != nil {
e.log.Warn("object put: check object existence",
zap.Stringer("addr", addr),
zap.Stringer("shard", sh.ID()),
zap.Error(err))

if shard.IsErrObjectExpired(err) {
// object is already found but
// expired => do nothing with it
Expand All @@ -138,6 +143,10 @@ func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool
}
}

e.log.Debug("object put: object already exist",
zap.Stringer("shard", sh.ID()),
zap.Stringer("addr", addr))

return
}

Expand All @@ -163,6 +172,7 @@ func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool

putSuccess = true
}); err != nil {
e.log.Warn("object put: pool task submitting", zap.Error(err))
close(exitCh)
}

Expand Down

0 comments on commit 5d9e36d

Please sign in to comment.