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

rados: we need to get the latest osdmap when pool does not exists #13289

Merged
merged 1 commit into from Mar 3, 2017

Conversation

songbaisen
Copy link

@songbaisen songbaisen commented Feb 7, 2017

rados: we need to get the latest osdmap when pool does not exists

 sometimes when we rename a pool use the rados api,but the osdmap
 does not update when we use pool_exists api. so we need to get the
 latest osdmap when the pool does not exists, it may exists in the
 newer osdmap.

Signed-off-by: song baisen song.baisen@zte.com.cn

@songbaisen songbaisen changed the title rbd: we need to get the latest osdmap when pool does not exists rados: we need to get the latest osdmap when pool does not exists Feb 7, 2017
@liewegas
Copy link
Member

We have similar logic in librados itself, but I'm a bit worried about having the inherent delay of an osdmap check on every pool lookup. I wonder if it's better to have a different function that does a blocking lookup, or simply having the caller do the wait + recheck.

@songbaisen
Copy link
Author

@liewegas Yes , it may be waste time for some scenes. How about add a para for this function that default it false , if the para set true then if the pool is not exists in current osdmap, we will try get the latest osdmap to check if the pool is in.

@liewegas
Copy link
Member

liewegas commented Feb 13, 2017 via email

@@ -889,6 +889,13 @@ Rados object in state %s." % self.state)
if ret >= 0:
return int(ret)
elif ret == -errno.ENOENT:
rev = self.wait_for_latest_osdmap()
Copy link
Member

Choose a reason for hiding this comment

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

seems like we should handle this within librados itself, rather than the python bindings - in RadosClient::lookup_pool()

Copy link
Author

Choose a reason for hiding this comment

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

@jdurgin Oh,thank you I understand it, also does it need a para when we do not find the pool.Then we get the latest osdmap to check. The para default is false. when user set it to true then we check the pool in the latest osdmap. how about it?

Copy link
Member

Choose a reason for hiding this comment

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

no need for a parameter imo - we can always check for the latest map if we get ENOENT. The internal user RadosClient::create_ioctx() already does this manually, so the retry can be removed from that function at the same time.

Copy link
Author

Choose a reason for hiding this comment

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

@jdurgin Oh,thank you.Got it.

@songbaisen
Copy link
Author

jenkins test this please

@songbaisen
Copy link
Author

@jdurgin Done.Have a look?

     sometimes when we rename a pool use the rados api,but the osdmap
     does not update when we use pool_exists api.so we need to get the
     latest osdmap when the pool does not exists, it may exists in the
     newer osdmap.

Signed-off-by:song baisen <song.baisen@zte.com.cn>
@songbaisen
Copy link
Author

jenkins test this please

@yuriw yuriw merged commit 4657560 into ceph:master Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants