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

tool: misc cleanup of ceph-kvstore-tool #18815

Merged
merged 2 commits into from Nov 13, 2017

Conversation

liuchang0812
Copy link
Contributor

@liuchang0812 liuchang0812 commented Nov 8, 2017

  1. fixes store-crc <path> command. this command did not do anything before.
  2. uses coarse monotonic clock

@tchaikov @liewegas would you mind taking a look? thanks

@liuchang0812
Copy link
Contributor Author

jenkins test this please

}
std::ofstream fs(argv[4]);
uint32_t crc = st.traverse(string(), true, &fs);
fs.close();
Copy link
Contributor

@tchaikov tchaikov Nov 9, 2017

Choose a reason for hiding this comment

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

"fix" is too vague for me. could you expand a little bit in the commit message? iiuc, you are passing a never used ostream to traverse(), why?

i see, argv[4] is the output arg.

also, fs will be closed when it's destroyed. i don't think this call is really necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you, kefu, updated!

@tchaikov tchaikov requested a review from jecluis November 9, 2017 02:47
…e file as expected

"store-crc <path>" command did not save result to <path>, it didn't use <path>
argument and alwayls passed a NULL to "st.traverse" function. now we will create file
<path>, pass a *ofstream to "st.traverse" function.

Fiexes: http://tracker.ceph.com/issues/22092

Signed-off-by: Chang Liu <liuchang0812@gmail.com>
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
usage(argv[0]);
return 1;
}
std::ofstream fs(argv[4]);
Copy link
Contributor

@tchaikov tchaikov Nov 9, 2017

Choose a reason for hiding this comment

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

it should be argv[3]. as cmd is argv[2].

could you use args[3] instead? nvm, seems we are using argv everywhere else ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should be argv[4].

➜  build git:(wip-kv-store-crc) ✗ ./bin/ceph-kvstore-tool bluestore-kv dev/osd2 store-crc t2.txt 2>/dev/null 
store at 't2.txt' crc 4037852868

@tchaikov tchaikov merged commit 6b4f2e8 into ceph:master Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants