[#1731] engine: Return the amount of actually moved objects in Evacuate

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-09-13 14:18:00 +03:00 committed by fyrchik
parent 8fc88487db
commit 3df98ce7ba
3 changed files with 28 additions and 16 deletions

View file

@ -106,6 +106,13 @@ func TestEvacuateShard(t *testing.T) {
// Second case ensures that all objects are indeed moved and available.
checkHasObjects(t)
// Calling it again is OK, but all objects are already moved, so no new PUTs should be done.
res, err = e.Evacuate(prm)
require.NoError(t, err)
require.Equal(t, 0, res.count)
checkHasObjects(t)
e.mtx.Lock()
delete(e.shards, evacuateShardID)
delete(e.shardPools, evacuateShardID)