Fix duplicate keys in listings on parallel updates -- do not rewind key "iterator position"

This commit is contained in:
Vitaliy Filippov
2023-12-01 01:17:04 +03:00
parent aa0c363c39
commit 63dbc9ca85
+6 -1
View File
@@ -1732,6 +1732,7 @@ void kv_op_t::next_get()
// Left half finished, go to the right // Left half finished, go to the right
recheck_policy = KV_RECHECK_LEAF; recheck_policy = KV_RECHECK_LEAF;
key = blk->right_half; key = blk->right_half;
skip_equal = false;
prev_key_ge = blk->right_half; prev_key_ge = blk->right_half;
prev_key_lt = blk->key_lt; prev_key_lt = blk->key_lt;
path[path.size()-1].offset = cur_block = blk->right_half_block; path[path.size()-1].offset = cur_block = blk->right_half_block;
@@ -1754,7 +1755,11 @@ void kv_op_t::next_go_up()
finish(-ENOENT); finish(-ENOENT);
return; return;
} }
key = blk->key_lt; if (blk->key_lt != "" && blk->key_lt > key)
{
// Block can be updated and key_lt may be lower. Don't rewind it
key = blk->key_lt;
}
skip_equal = false; skip_equal = false;
path.pop_back(); path.pop_back();
cur_level--; cur_level--;