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

MDSMonitor: silence unable to load metadata #25693

Merged
merged 1 commit into from Jan 18, 2019

Conversation

shun-s
Copy link
Contributor

@shun-s shun-s commented Dec 24, 2018

silence unable to load metadata

Signed-off-by: Song Shun song.shun3@zte.com.cn

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

@shun-s
Copy link
Contributor Author

shun-s commented Dec 24, 2018

@xiexingguo please take a review, thanks

@@ -1641,7 +1641,9 @@ int MDSMonitor::load_metadata(map<mds_gid_t, Metadata>& m)
bufferlist bl;
int r = mon->store->get(MDS_METADATA_PREFIX, "last_metadata", bl);
if (r) {
dout(1) << "Unable to load 'last_metadata'" << dendl;
if (r != -ENOENT) {
Copy link
Member

Choose a reason for hiding this comment

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

this doesn't sound right. The underlying store is only propagating one error via the return value, and that is ENOENT. What you are doing is silently creating a dead branch that will always suppress the error message.

I'm not sure what problem you are trying to address, but this doesn't seem the right way to do it.

Copy link
Contributor Author

@shun-s shun-s Dec 27, 2018

Choose a reason for hiding this comment

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

thanks for your review @jecluis
logging this message when quering cyclicly(ceph mds versions) seems useless and wastes space. we'd better silence it at least in normal use case.

i can think of two ways to optimize this as only ENOENT exists, the first one is just return,(

int r = mon->store->get(MGR_METADATA_PREFIX, name, bl);
); the second one is higher log level, maybe say ldout(10) ?

which one do you prefer? or any other ideas ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jecluis ping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tchaikov as it seems jecluis busy with other things., please take a review if you have time.

Copy link
Contributor

Choose a reason for hiding this comment

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

will do the day after tomorrow.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we can, in good conscious, suppress these messages. The message is there to make it clear that the key does not exist, and I think it is very worthwhile for those cases where it is supposed to be there.

I think the best solution is to check whether there are mds in the mdsmap, and only call count_metadata() if so, for all the callers of count_metadata(). Or, maybe simpler, do that in count_metadata() itself. I think this will require adding a getter method in FSMap though (something like has_daemons()), because I don't think we currently expose this easily without calling something like FSMap::get_mds_info() and checking if it's empty.

Copy link
Contributor Author

@shun-s shun-s Jan 11, 2019

Choose a reason for hiding this comment

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

!_!, the best solution you proposed is not ready now, and i agree with the opinion that these messages are worthwhile.
could we just increase the dout level, say from dout(1) -> dout(5) ?
because on one hand, these message are worthwhile but not urgent, on the other hand, these messages will be slienced at usual as we want.
anyway, thanks for your detailed explaination and guidance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jecluis ping

Copy link
Member

Choose a reason for hiding this comment

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

@shun-s sure, lets go with dout(5) then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jecluis repush done.

@batrick batrick added the cephfs Ceph File System label Jan 7, 2019
@batrick batrick changed the title MDSMon: silence unable to load metadata MDSMonitor: silence unable to load metadata Jan 7, 2019
  silence unable to load metadata

Signed-off-by: Song Shun <song.shun3@zte.com.cn>
@xiexingguo xiexingguo merged commit 00b7ac8 into ceph:master Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cephfs Ceph File System cleanup mon
Projects
None yet
5 participants