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

mds/MDSMap output None instead of 0 when no fs present. #10202

Merged
merged 1 commit into from Jul 20, 2016

Conversation

xiaoxichen
Copy link
Contributor

When no fs present, the mdsmap::dump will output metadata_pool: 0,
which is misleading.

Change the initial value of metadata_pool from 0 to -1 , and output None
when seeing -1.

Fixes: http://tracker.ceph.com/issues/16588

Signed-off-by: Xiaoxi Chen xiaoxchen@ebay.com

@xiaoxichen xiaoxichen added bug-fix cephfs Ceph File System labels Jul 8, 2016
f->dump_int("metadata_pool", metadata_pool);

if (data_pools.empty())
f->dump_string("data_pools", "None");
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not output None here: an empty list (the current behaviour) is more appropriate

@jcsp
Copy link
Contributor

jcsp commented Jul 13, 2016

I like the idea of using None/null here, but the formatter just doesn't support it so I think it doesn't make sense to use a "None" string. I like initialising metadata_pool it to -1 though.

@xiaoxichen
Copy link
Contributor Author

@jcsp would this looks better?

if (metadata_pool == -1) {
f->open_array_section("metadata_pool");
f->close_section();
}

@jcsp
Copy link
Contributor

jcsp commented Jul 14, 2016

@xiaoxichen no, I don't think an empty list is better. Like I said, None/null would be good, but we just don't have a way to output that at present, so a -1 is probably the most correct thing to output.

When no fs present, the mdsmap::dump will output metadata_pool: 0,
which is misleading.

Change the initial value of metadata_pool from 0 to -1.

Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
@xiaoxichen
Copy link
Contributor Author

@jcsp fixed:)

@jcsp jcsp merged commit 2757478 into ceph:master Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix cephfs Ceph File System
Projects
None yet
2 participants