From fd9ce66e8b76787f69c5e337332d57aa72c8b8d5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 21 Sep 2015 11:41:03 -0400 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index cfda5b00dfd8..71d073308fcc 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -7244,8 +7244,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(); } -- 2.47.3