HDDS-1602. Fix TestContainerPersistence#testDeleteBlockTwice. (#858)
This commit is contained in:
parent
d1ec1c52e5
commit
d8b18e82f0
@ -229,12 +229,13 @@ public void deleteBlock(Container container, BlockID blockID) throws
|
|||||||
// to delete a Block which might have just gotten inserted after
|
// to delete a Block which might have just gotten inserted after
|
||||||
// the get check.
|
// the get check.
|
||||||
byte[] kKey = Longs.toByteArray(blockID.getLocalID());
|
byte[] kKey = Longs.toByteArray(blockID.getLocalID());
|
||||||
try {
|
|
||||||
db.getStore().delete(kKey);
|
byte[] kData = db.getStore().get(kKey);
|
||||||
} catch (IOException e) {
|
if (kData == null) {
|
||||||
throw new StorageContainerException("Unable to find the block.",
|
throw new StorageContainerException("Unable to find the block.",
|
||||||
NO_SUCH_BLOCK);
|
NO_SUCH_BLOCK);
|
||||||
}
|
}
|
||||||
|
db.getStore().delete(kKey);
|
||||||
// Decrement blockcount here
|
// Decrement blockcount here
|
||||||
container.getContainerData().decrKeyCount();
|
container.getContainerData().decrKeyCount();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user