]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
OSD: fix race condition for heartbeat_need_update 7739/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 22 Feb 2016 10:05:39 +0000 (18:05 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 22 Feb 2016 10:17:25 +0000 (18:17 +0800)
commit0914246383f8bfefb15e05a49c67b8b3091d50cf
tree1404fc6d68d65cb9384cc37ec03a07c062d473b0
parent847c3eba41638da3aaf991c60c488647293db786
OSD: fix race condition for heartbeat_need_update

The heartbeat_need_update member can be accessed by both OSD tick thread and
PG relevant threads, that is why the heartbeat_update_lock mutex is introduced
to protect against its change. However, in the tick thread we may still be able
to reset heartbeat_need_update to false whithout holding heartbeat_update_lock
in hand, which shall be considered as a race conditon.

This pr solves the above problem by add a new API to clear heartbeat_need_update
atomically, which fix the above potential race condition.

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