diff --git a/CHANGELOG.md b/CHANGELOG.md index 83ec8e41a..6afb8f700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Changelog for FrostFS Node - `go.opentelemetry.io/otel` to `v1.15.1` - `go.opentelemetry.io/otel/trace` to `v1.15.1` - `github.com/spf13/cast` to `v1.5.1` +- `git.frostfs.info/TrueCloudLab/hrw` to `v1.2.1` ### Updating from v0.36.0 diff --git a/go.mod b/go.mod index d5b3826b2..8bb31686e 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230531114046-62edd68f47ac git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6 - git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230530135122-10482ffbed3b - git.frostfs.info/TrueCloudLab/hrw v1.2.0 + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230602115440-ec59ebfd8826 + git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 github.com/cheggaaa/pb v1.0.29 github.com/chzyer/readline v1.5.1 @@ -44,7 +44,7 @@ require ( require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 // indirect git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/benbjohnson/clock v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect @@ -98,7 +98,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect - github.com/twmb/murmur3 v1.1.7 // indirect + github.com/twmb/murmur3 v1.1.8 // indirect github.com/urfave/cli v1.22.13 // indirect go.mongodb.org/mongo-driver v1.11.6 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect diff --git a/go.sum b/go.sum index 242614781..c64597f65 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/blobovnicza.go b/pkg/local_object_storage/blobstor/blobovniczatree/blobovnicza.go index af976f977..d99e9aa89 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/blobovnicza.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/blobovnicza.go @@ -216,7 +216,7 @@ func addressHash(addr *oid.Address, path string) uint64 { a = addr.EncodeToString() } - return hrw.Hash([]byte(a + path)) + return hrw.StringHash(a + path) } // converts uint64 to hex string. diff --git a/pkg/local_object_storage/engine/engine_test.go b/pkg/local_object_storage/engine/engine_test.go index 9c239739f..11c0848fe 100644 --- a/pkg/local_object_storage/engine/engine_test.go +++ b/pkg/local_object_storage/engine/engine_test.go @@ -101,7 +101,7 @@ func (te *testEngineWrapper) setInitializedShards(t testing.TB, shards ...*shard errorCount: new(atomic.Uint32), Shard: s, }, - hash: hrw.Hash([]byte(s.ID().String())), + hash: hrw.StringHash(s.ID().String()), } te.engine.shardPools[s.ID().String()] = pool te.shardIDs = append(te.shardIDs, s.ID()) diff --git a/pkg/local_object_storage/engine/evacuate.go b/pkg/local_object_storage/engine/evacuate.go index c103ede73..73b7a7830 100644 --- a/pkg/local_object_storage/engine/evacuate.go +++ b/pkg/local_object_storage/engine/evacuate.go @@ -373,7 +373,7 @@ func (e *StorageEngine) evacuateObjects(ctx context.Context, sh *shard.Shard, to func (e *StorageEngine) tryEvacuateObjectLocal(ctx context.Context, addr oid.Address, object *objectSDK.Object, sh *shard.Shard, shards []pooledShard, weights []float64, shardsToEvacuate map[string]*shard.Shard, res *EvacuateShardRes) (bool, error) { - hrw.SortHasherSliceByWeightValue(shards, weights, hrw.Hash([]byte(addr.EncodeToString()))) + hrw.SortHasherSliceByWeightValue(shards, weights, hrw.StringHash(addr.EncodeToString())) for j := range shards { select { case <-ctx.Done(): diff --git a/pkg/local_object_storage/engine/remove_copies.go b/pkg/local_object_storage/engine/remove_copies.go index 1ea569928..7681e0e50 100644 --- a/pkg/local_object_storage/engine/remove_copies.go +++ b/pkg/local_object_storage/engine/remove_copies.go @@ -110,7 +110,7 @@ func (e *StorageEngine) removeObjects(ctx context.Context, ch <-chan oid.Address } for addr := range ch { - h := hrw.Hash([]byte(addr.EncodeToString())) + h := hrw.StringHash(addr.EncodeToString()) shards := sortShardsByWeight(shards, h) found := false for i := range shards { diff --git a/pkg/local_object_storage/engine/shards.go b/pkg/local_object_storage/engine/shards.go index 07d22d3fe..eb7b40230 100644 --- a/pkg/local_object_storage/engine/shards.go +++ b/pkg/local_object_storage/engine/shards.go @@ -150,7 +150,7 @@ func (e *StorageEngine) addShard(sh *shard.Shard) error { errorCount: new(atomic.Uint32), Shard: sh, }, - hash: hrw.Hash([]byte(strID)), + hash: hrw.StringHash(strID), } e.shardPools[strID] = pool @@ -223,7 +223,7 @@ func (e *StorageEngine) sortShardsByWeight(objAddr interface{ EncodeToString() s e.mtx.RLock() defer e.mtx.RUnlock() - h := hrw.Hash([]byte(objAddr.EncodeToString())) + h := hrw.StringHash(objAddr.EncodeToString()) shards := make([]hashedShard, 0, len(e.shards)) for _, sh := range e.shards { shards = append(shards, hashedShard(sh))