Skip to content

We expect kvrocks to support MVCC #905

Answered by mapleFU
xinhua5 asked this question in Q&A
Discussion options

You must be logged in to vote

Intrdocuing mvcc is hard, especially when you have multiple kvrocks instance, for simplest case, if we want to implement single key mvcc, we need:

  1. Generating a new version for k in kvrocks. Apart from RocksDB's sequence_id, it should be encoding to RocksDB's key, and generated by a incr like operation.
  2. Calling set with the mvcc key.
  3. Get a key with version, if the key with version doesn't exists, the query should fallback to the previous version, so version might be encoded in big endian.
  4. Garbage collection the useless version, which should be set by your cache client.

1-3 using set and get is impossible, so new command should be created. If you want multi-key transaction, it would be mu…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@git-hulk
Comment options

Comment options

You must be logged in to vote
4 replies
@mapleFU
Comment options

@git-hulk
Comment options

@xinhua5
Comment options

@mapleFU
Comment options

Answer selected by xinhua5
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants