Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Changelog for NeoFS Node
- Garbage marking scheme in metabase (#3753)
- SN sorts shards identically when writing and reading EC parts (#3773)
- SN puts EC parts concurrently now (#3777)
- Optimized object-to-shard placement (#3794)

### Removed
- Deprecated `fschain_autodeploy`, `without_mainnet`, `governance.disable`, `fee.main_chain` and `contracts` IR config options (#3716)
Expand Down
2 changes: 1 addition & 1 deletion pkg/local_object_storage/engine/evacuate.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ mainLoop:
loop:
for i := range lst {
addr := lst[i].Address
addrHash := hrw.WrapBytes([]byte(addr.EncodeToString()))
addrHash := hrwOIDWrapper(addr.Object())

obj, err := sh.Get(addr, false)
if err != nil {
Expand Down
13 changes: 9 additions & 4 deletions pkg/local_object_storage/engine/shards.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package engine

import (
"encoding/binary"
"fmt"
"sync/atomic"

Expand Down Expand Up @@ -191,7 +192,7 @@ func generateShardID() (*shard.ID, error) {
func (e *StorageEngine) sortedShards(objAddr oid.Address) []shardWrapper {
shards := e.unsortedShards()

hrw.Sort(shards, hrw.WrapBytes([]byte(objAddr.EncodeToString())))
hrw.Sort(shards, hrwOIDWrapper(objAddr.Object()))

for i := range shards {
shards[i].shardIface = shards[i].Shard
Expand Down Expand Up @@ -256,7 +257,11 @@ func (e *StorageEngine) HandleNewEpoch(epoch uint64) {
}

func (s shardWrapper) Hash() uint64 {
return hrw.Hash(
[]byte(s.Shard.ID().String()),
)
return binary.BigEndian.Uint64(*s.ID())
}

type hrwOIDWrapper oid.ID

func (o hrwOIDWrapper) Hash() uint64 {
return binary.BigEndian.Uint64(o[:])
}
Loading