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
mon: osdmap's epoch should be more than 0 #9859
Conversation
@@ -3106,7 +3106,7 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op) | |||
int64_t epochnum; | |||
cmd_getval(g_ceph_context, cmdmap, "epoch", epochnum, (int64_t)0); | |||
epoch = epochnum; | |||
if (!epoch) | |||
if (epoch > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this change make any difference? or it is just cosmetic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ceph osd getmap 0
such as command, get the latest osdmap.
this change tells that 0 is invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change breaks the behaviour of
ceph osd getmap
.
in this case, epoch
is 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is invalid,
epoch started from 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default value of epoch
is "0" if it's not specified. we use it to tell if user wants to get the latest osdmap.
with your change, if user puts ceph osd getmap
. he/she will get an error.
$ ./bin/ceph osd getmap
Error ENOENT: there is no map for epoch 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
further more, you are overwriting the epoch passed by user with the latest one. this does not sound right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if epoch is not specified, the latest epoch returned,rather than setted to 0,
what do you think?
Signed-off-by: Na Xie <xie.na@h3c.com>
jenkins test this please (jenkins hung) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe, as it is, this commit is purely cosmetic. Functionally it is the same as the original code. I am not opposed to it, but I'm lacking the motivation for the change besides making it different.
@tchaikov thoughts?
@jecluis agreed. but the change improves the readability, because the last param of |
@tchaikov fair enough. thumbsup.png |
Signed-off-by: Na Xie xie.na@h3c.com