Skip to content

Commit

Permalink
node/engine/put: if a shard cannot handle PUT, add its ID to logs
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
carpawell committed Oct 7, 2024
1 parent 9e8d6b1 commit 1aed146
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/local_object_storage/engine/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (e *StorageEngine) put(prm PutPrm) (PutRes, error) {
// Second return value is true iff object already exists.
func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool, addr oid.Address, prm PutPrm) (bool, bool) {
var putSuccess, alreadyExists bool
id := sh.ID()

exitCh := make(chan struct{})

Expand All @@ -116,7 +117,7 @@ func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool
if err != nil {
e.log.Warn("object put: check object existence",
zap.Stringer("addr", addr),
zap.Stringer("shard", sh.ID()),
zap.Stringer("shard", id),
zap.Error(err))

if shard.IsErrObjectExpired(err) {
Expand All @@ -137,14 +138,14 @@ func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool
_, err = sh.ToMoveIt(toMoveItPrm)
if err != nil {
e.log.Warn("could not mark object for shard relocation",
zap.Stringer("shard", sh.ID()),
zap.Stringer("shard", id),
zap.String("error", err.Error()),
)
}
}

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

return
Expand All @@ -161,7 +162,7 @@ func (e *StorageEngine) putToShard(sh hashedShard, ind int, pool util.WorkerPool
if errors.Is(err, shard.ErrReadOnlyMode) || errors.Is(err, blobstor.ErrNoPlaceFound) ||
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.Stringer("shard_id", id),
zap.String("error", err.Error()))
return
}
Expand All @@ -172,7 +173,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))
e.log.Warn("object put: pool task submitting", zap.Stringer("shard", id), zap.Error(err))
close(exitCh)
}

Expand Down

0 comments on commit 1aed146

Please sign in to comment.