engine: Log the error when check object existence #1225

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/ext-log-any-shard into master 2024-07-04 07:23:07 +00:00
2 changed files with 6 additions and 0 deletions

View file

@ -205,6 +205,7 @@ const (
EngineCouldNotReloadAShard = "could not reload a shard"
EngineAddedNewShard = "added new shard"
EngineCouldNotPutObjectToShard = "could not put object to shard"
EngineCouldNotCheckObjectExistence = "could not check object existence when put object to shard"
EngineErrorDuringSearchingForObjectChildren = "error during searching for object children"
EngineCouldNotInhumeObjectInShard = "could not inhume object in shard"
EngineStartingRemovalOfLocallyredundantCopies = "starting removal of locally-redundant copies"

View file

@ -149,6 +149,11 @@ func (e *StorageEngine) putToShard(ctx context.Context, sh hashedShard, pool uti
// object is already found but
// expired => do nothing with it
res.status = putToShardExists
} else {
e.log.Warn(logs.EngineCouldNotCheckObjectExistence,
Review

There could be a bunch of logical errors, I think Warn is too much for this error (which can repeat a lot)
What was the problem that you were trying to debug?

There could be a bunch of logical errors, I think `Warn` is too much for this error (which can repeat a lot) What was the problem that you were trying to debug?
Review

This is only one place where we skip putting an error in the log. For all other situations, we have an entry with level warn.
Looks like it is not necessary to extend an error could not put object to any shard somehow.

This is only one place where we skip putting an error in the log. For all other situations, we have an entry with level `warn`. Looks like it is not necessary to extend an error `could not put object to any shard` somehow.
zap.Stringer("shard_id", sh.ID()),
zap.String("error", err.Error()),
zap.String("trace_id", tracingPkg.GetTraceID(ctx)))
}
return // this is not ErrAlreadyRemoved error so we can go to the next shard