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

tikv-ctl: support raw raft log key #1273

Merged
merged 3 commits into from Nov 7, 2016
Merged

tikv-ctl: support raw raft log key #1273

merged 3 commits into from Nov 7, 2016

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Nov 5, 2016

This pr add two features to tikv-ctl:

  1. allow specifying the raw key when print the log entry, which is useful when just knowing the raw key but the actual region and index;
  2. print out the size when doing scanning or printing raft log entry.

@siddontang @zhangjinpeng1987 PTAL

@zhangjinpeng87
Copy link
Member

LGTM

let suffix_idx = REGION_RAFT_PREFIX_KEY.len() + mem::size_of::<u64>();
let expect_key_len = suffix_idx + mem::size_of::<u8>() + mem::size_of::<u64>();
if key.len() != expect_key_len || !key.starts_with(REGION_RAFT_PREFIX_KEY) ||
key[suffix_idx] != RAFT_LOG_SUFFIX {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test to cover the error.

@BusyJay
Copy link
Member Author

BusyJay commented Nov 7, 2016

PTAL

@siddontang
Copy link
Contributor

LGTM

@BusyJay BusyJay merged commit b2274fe into master Nov 7, 2016
@BusyJay BusyJay deleted the busyjay/support-raw-key branch November 7, 2016 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants