forked from TrueCloudLab/frostfs-node
[#1555] engine: Refactor (*StorageEngine).GetLocks
Refactored after renaming the method to replace the confusing `locked` variable with `locks`. Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
parent
72470d6b48
commit
3821645085
1 changed files with 6 additions and 6 deletions
|
@ -262,23 +262,23 @@ func (e *StorageEngine) GetLocks(ctx context.Context, addr oid.Address) ([]oid.I
|
||||||
))
|
))
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
||||||
var locked []oid.ID
|
var allLocks []oid.ID
|
||||||
var outErr error
|
var outErr error
|
||||||
|
|
||||||
e.iterateOverUnsortedShards(func(h hashedShard) (stop bool) {
|
e.iterateOverUnsortedShards(func(h hashedShard) (stop bool) {
|
||||||
ld, err := h.Shard.GetLocks(ctx, addr)
|
locks, err := h.Shard.GetLocks(ctx, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e.reportShardError(ctx, h, logs.EngineInterruptGettingLockers, err, zap.Stringer("address", addr),
|
e.reportShardError(ctx, h, logs.EngineInterruptGettingLockers, err, zap.Stringer("address", addr),
|
||||||
zap.String("trace_id", tracingPkg.GetTraceID(ctx)))
|
zap.String("trace_id", tracingPkg.GetTraceID(ctx)))
|
||||||
outErr = err
|
outErr = err
|
||||||
}
|
}
|
||||||
locked = append(locked, ld...)
|
allLocks = append(allLocks, locks...)
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
if len(locked) > 0 {
|
if len(allLocks) > 0 {
|
||||||
return locked, nil
|
return allLocks, nil
|
||||||
}
|
}
|
||||||
return locked, outErr
|
return allLocks, outErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *StorageEngine) processExpiredTombstones(ctx context.Context, addrs []meta.TombstonedObject) {
|
func (e *StorageEngine) processExpiredTombstones(ctx context.Context, addrs []meta.TombstonedObject) {
|
||||||
|
|
Loading…
Reference in a new issue