From: Sage Weil Date: Mon, 21 Sep 2015 15:41:03 +0000 (-0400) Subject: osd/ReplicatedPG: tolerate promotion completion with stopped agent X-Git-Tag: v0.94.4~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e72bdc3bf1541e445f74def70b5aa185f1757468;p=ceph.git osd/ReplicatedPG: tolerate promotion completion with stopped agent We may start a promotion, then get a pool update that disables the agent, and then complete it. We should not segfault in this case. Fixes: #13190 Signed-off-by: Sage Weil (cherry picked from commit fd9ce66e8b76787f69c5e337332d57aa72c8b8d5) --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 6b22c3a845a..061a61ca10d 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6695,8 +6695,8 @@ void ReplicatedPG::finish_promote(int r, CopyResults *results, osd->logger->inc(l_osd_tier_promote); - assert(agent_state); - if (agent_state->is_idle()) + if (agent_state && + agent_state->is_idle()) agent_choose_mode(); }