tikv / tikv

Distributed transactional key-value database, originally created to complement TiDB

Home Page:https://tikv.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In-memory Engine: lock should not be deleted directly

SpadeA-Tang opened this issue · comments

Bug Report

For delete cmd of lock cf, the delete is performed directly on in-memory engine rather than write tombsone. This is considered that we always want to read the latest value of the lock cf. However, it volates the write atomicity of the in-memory engine and rocksdb.
The complete process for writing a write batch is as follows:
rocksdb:write_callback -> .. -> rocksdb:write to memtable and callback with seqno. -> in-memory engine: write_impl -> rocksdb:publish seqno.
We can see that only when the last step that rocksdb publish the seqno will the write be visible. So we cannot avoid to write tombstone in lock-cf to guarantee the write atomicity.

One of the abnormal caused by this issue is: #17018

commented

/found customer

commented

/remove-found customer