The heartbeat_check() logic requires heartbeat_lock only, so it shall
work without osd_lock in hand. By doing this, we avoid the latency to
acquire the big osd_lock and does heartbeat_check() much accurately.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
if (is_active() || is_waiting_for_healthy()) {
maybe_update_heartbeat_peers();
-
- heartbeat_lock.Lock();
- heartbeat_check();
- heartbeat_lock.Unlock();
}
if (is_waiting_for_healthy()) {
// osd_lock is not being held, which means the OSD state
// might change when doing the monitor report
if (is_active() || is_waiting_for_healthy()) {
+ heartbeat_lock.Lock();
+ heartbeat_check();
+ heartbeat_lock.Unlock();
+
map_lock.get_read();
Mutex::Locker l(mon_report_lock);