]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: tolerate promotion completion with stopped agent
authorSage Weil <sage@redhat.com>
Mon, 21 Sep 2015 15:41:03 +0000 (11:41 -0400)
committerSage Weil <sage@redhat.com>
Sun, 27 Sep 2015 12:30:17 +0000 (08:30 -0400)
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 <sage@redhat.com>
(cherry picked from commit fd9ce66e8b76787f69c5e337332d57aa72c8b8d5)

src/osd/ReplicatedPG.cc

index 6b22c3a845a68c942bcc1e73794dd466464d6110..061a61ca10d4e91f3410e03a32816de57feb6cfe 100644 (file)
@@ -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();
 }