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,14 +74,10 @@ 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, err = encodeList(append(exLockers, keyLocker))
|
||||||
updLockers = keyLocker
|
if err != nil {
|
||||||
} else {
|
// maybe continue for the best effort?
|
||||||
updLockers, err = encodeList(append(exLockers, keyLocker))
|
return fmt.Errorf("encode list of object lockers: %w", err)
|
||||||
if err != nil {
|
|
||||||
// maybe continue for the best effort?
|
|
||||||
return fmt.Errorf("encode list of object lockers: %w", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// write updated list of lockers
|
// write updated list of lockers
|
||||||
|
|
Loading…
Reference in a new issue