Skip to content

Commit dcc7bd3

Browse files
committed
object/get: Do not access the node repeatedly within the same request
Same motivation and changes as in d205713. Signed-off-by: Leonard Lyubich <[email protected]>
1 parent 67ababa commit dcc7bd3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/services/object/get/container.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func (exec *execCtx) processEpoch(epoch uint64) bool {
4141
defer cancel()
4242

4343
exec.status = statusUndefined
44+
mProcessedNodes := make(map[string]struct{})
4445

4546
for {
4647
addrs := traverser.Next()
@@ -61,6 +62,13 @@ func (exec *execCtx) processEpoch(epoch uint64) bool {
6162
default:
6263
}
6364

65+
strKey := string(addrs[i].PublicKey())
66+
if _, ok = mProcessedNodes[strKey]; ok {
67+
continue
68+
}
69+
70+
mProcessedNodes[strKey] = struct{}{}
71+
6472
// TODO: #1142 consider parallel execution
6573
// TODO: #1142 consider optimization: if status == SPLIT we can continue until
6674
// we reach the best result - split info with linking object ID.

0 commit comments

Comments
 (0)