]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: fix rare race for pg relevant events 8254/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 22 Mar 2016 08:38:15 +0000 (16:38 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 23 Mar 2016 00:43:24 +0000 (08:43 +0800)
commit03c5a93022bf639138b114703e6478ca39355339
tree2e641550c2032e0b26419df70724e6f43ac4ac77
parent6ed9c3fe0b55cb8863c4d9fc9f3465be6a11ec6e
osd: fix rare race for pg relevant events

Theoretically even if _have_pg() returns ture, we still can't assert that
_lookup_lock_pg() will always succeed. This is because when we switch between
these two methods, we will drop pg_map_lock, and thus may let a pg removal
sneak in, which may eventually cause divergence.

However this is a really rare case, and is less likely to happen in a
production environment. But this pr provided a safer way to achieve
the same goal and is a little faster by eliminating a duplicated search
from the pg_map, which makes it meaningful.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSD.cc