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
Closed

Improve tikv-dump to support mvcc decoding. #1077

disksing opened this issue Sep 18, 2016 · 4 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. status/discussion Status: Under discussion or need discussion status/proposal Status: Still a proposal

Comments

@disksing
Copy link
Contributor

disksing 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
@disksing disksing added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. status/proposal Status: Still a proposal status/discussion Status: Under discussion or need discussion labels Sep 18, 2016
@siddontang
Copy link
Contributor

/cc @mrmiywj

@BusyJay
Copy link
Member

BusyJay commented Sep 18, 2016

I think subcommand is better in this case.

@siddontang
Copy link
Contributor

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

@mrmiywj
Copy link
Contributor

mrmiywj 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
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. status/discussion Status: Under discussion or need discussion status/proposal Status: Still a proposal
Projects
None yet
Development

No branches or pull requests

4 participants