Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tikv-dump to support mvcc decoding. #1077

Closed
disksing opened this Issue Sep 18, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@disksing
Copy link
Collaborator

commented Sep 18, 2016

In short, I propose to add a new flag 'mvcc' to dump mvcc encoded key-value pairs. All cf's key-values are encoded as following:

default lock write
key z{encoded_key}{start_ts(desc)} z{encoded_key} z{encoded_key}{commit_ts(desc)}
value {value} {flag}{primary_key}{start_ts(varint)} {flag}{start_ts(varint)}

Usage example (dump a key's write cf):

./tikv-dump --store "foo/db" -mvcc -k "t\\200\\000\\000\\000\\000\\000\\000\\377R_r\\200\\000\\000\\000\\000\\377\\004\\251\\322\\000\\000\\000\\000\\000\\372" -c write

Output (2 PUT records found):

key: zt\\200\\000\\000\\000\\000\\000\\000\\377R_r\\200\\000\\000\\000\\000\\377\\004`B\\000\\000\\000\\000\\000\\372\\372\\243\'W\\350{\\377\\355
value: P\\227\\200\\220\\212\\201\\225\\266\\256\\005
type: PUT
commit_ts: 386421884507652114 
start_ts: 386421884402794519

key: zt\\200\\000\\000\\000\\000\\000\\000\\377R_r\\200\\000\\000\\000\\000\\377\\004`B\\000\\000\\000\\000\\000\\372\\372\\243\'\\303\\n\\323\\377\\351
value: P\\212\\200\\260\\367\\316\\207\\266\\256\\005
type: PUT
commit_ts: 386421424369958934
start_ts: 386421424265101322
@siddontang

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2016

/cc @mrmiywj

@BusyJay

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2016

I think subcommand is better in this case.

@siddontang

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2016

yes, may we should use subcommand to distinguish mvcc and raft.

@mrmiywj

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2016

Thx! I'll take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.