Cancel block changes on write failures/CAS retries (should fix #115)

This commit is contained in:
Vitaliy Filippov
2025-11-30 01:49:49 +03:00
parent 76c7c26d32
commit 94f31b96b8
+2
View File
@@ -1794,6 +1794,7 @@ void kv_op_t::update_block(int path_pos, bool is_delete, const std::string & key
{ {
if (res < 0) if (res < 0)
{ {
blk->cancel_change();
auto blk_offset = blk->offset; auto blk_offset = blk->offset;
del_block_level(db, blk); del_block_level(db, blk);
db->block_cache.erase(blk_offset); db->block_cache.erase(blk_offset);
@@ -1926,6 +1927,7 @@ void kv_op_t::update_block(int path_pos, bool is_delete, const std::string & key
{ {
if (write_res < 0) if (write_res < 0)
{ {
blk->cancel_change();
auto blk_offset = blk->offset; auto blk_offset = blk->offset;
del_block_level(db, blk); del_block_level(db, blk);
db->block_cache.erase(blk_offset); db->block_cache.erase(blk_offset);