forked from TrueCloudLab/frostfs-node
[#1175] metabase: Fix encoding of updated locker list
Even single locker must be encoded using `encodeList`, or subsequent `decodeList` call will fail. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
88cefa7c5f
commit
26b8e33ed7
1 changed files with 4 additions and 8 deletions
|
@ -74,15 +74,11 @@ func (db *DB) Lock(cnr cid.ID, locker oid.ID, locked []oid.ID) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the list of lockers
|
// update the list of lockers
|
||||||
if exLockers == nil {
|
|
||||||
updLockers = keyLocker
|
|
||||||
} else {
|
|
||||||
updLockers, err = encodeList(append(exLockers, keyLocker))
|
updLockers, err = encodeList(append(exLockers, keyLocker))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// maybe continue for the best effort?
|
// maybe continue for the best effort?
|
||||||
return fmt.Errorf("encode list of object lockers: %w", err)
|
return fmt.Errorf("encode list of object lockers: %w", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// write updated list of lockers
|
// write updated list of lockers
|
||||||
err = bucketLockedContainer.Put(bucketKeysLocked[i], updLockers)
|
err = bucketLockedContainer.Put(bucketKeysLocked[i], updLockers)
|
||||||
|
|
Loading…
Reference in a new issue