Skip to content

Commit

Permalink
rbd: we need to get the latest osdmap when pool does not exists
Browse files Browse the repository at this point in the history
     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>
  • Loading branch information
songbaisen committed Feb 7, 2017
1 parent 49eafeb commit 88d7889
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pybind/rados/rados.pyx
Expand Up @@ -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()
if rev < 0:
return None
with nogil:
ret = rados_pool_lookup(self.cluster, _pool_name)
if ret >= 0:
return int(ret)
return None
else:
raise make_ex(ret, "error looking up pool '%s'" % pool_name)
Expand Down

0 comments on commit 88d7889

Please sign in to comment.