forked from TrueCloudLab/frostfs-node
[#547] metabase: Fix datarace in tests
Quite an old one bf9e938a3b
.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
feature/121-client/container_put
parent
05ac9e3637
commit
35dc64bd7b
|
@ -111,6 +111,7 @@ func (db *DB) put(tx *bbolt.Tx,
|
|||
|
||||
exists, err := db.exists(tx, objectCore.AddressOf(obj), currEpoch)
|
||||
|
||||
var splitInfoError *objectSDK.SplitInfoError
|
||||
if errors.As(err, &splitInfoError) {
|
||||
exists = true // object exists, however it is virtual
|
||||
} else if err != nil {
|
||||
|
|
|
@ -427,6 +427,7 @@ func (db *DB) selectObjectID(
|
|||
addr.SetContainer(cnr)
|
||||
addr.SetObject(id)
|
||||
|
||||
var splitInfoError *objectSDK.SplitInfoError
|
||||
ok, err := db.exists(tx, addr, currEpoch)
|
||||
if (err == nil && ok) || errors.As(err, &splitInfoError) {
|
||||
raw := make([]byte, objectKeySize)
|
||||
|
|
|
@ -120,8 +120,6 @@ const (
|
|||
addressKeySize = cidSize + objectKeySize
|
||||
)
|
||||
|
||||
var splitInfoError *objectSDK.SplitInfoError // for errors.As comparisons
|
||||
|
||||
func bucketName(cnr cid.ID, prefix byte, key []byte) []byte {
|
||||
key[0] = prefix
|
||||
cnr.Encode(key[1:])
|
||||
|
|
Loading…
Reference in New Issue