From e20df8020458a7b7679d0105183f870220ed0ce7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 8 Apr 2016 10:35:29 -0400 Subject: [PATCH] osd/ReplicatedPG: make handle_watch_timeout no-op if !active During on_change, we clean up old events on the obcs. This can include a queued watch timeout: 3: (ReplicatedPG::handle_watch_timeout(std::shared_ptr)+0x125) [0x7f1fc21fe375] 4: (HandleDelayedWatchTimeout::finish(int)+0xd3) [0x7f1fc213e2e3] 5: (Context::complete(int)+0x9) [0x7f1fc20ead29] 6: (ReplicatedPG::finish_degraded_object(hobject_t const&)+0x354) [0x7f1fc22429e4] 7: (ReplicatedPG::on_change(ObjectStore::Transaction*)+0x2ba) [0x7f1fc224353a] 8: (PG::start_peering_interval(std::shared_ptr, std::vector > const&, int, std::vector > const&, int, ObjectStore::Transaction*)+0x7bd) [0x7f1fc219a0bd] In this case, handle_watch_timeout should not assume that we are active and primary. Fixes: http://tracker.ceph.com/issues/15391 Signed-off-by: Sage Weil (cherry picked from commit 4b0e39ee11e7bd5079ff6704bc74627d3ba8ba44) --- src/osd/ReplicatedPG.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index e846938610abc..4f533f42a9d9d 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -7704,6 +7704,10 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) ObjectContextRef obc = watch->get_obc(); // handle_watch_timeout owns this ref dout(10) << "handle_watch_timeout obc " << obc << dendl; + if (!is_active()) { + dout(10) << "handle_watch_timeout not active, no-op" << dendl; + return; + } if (is_degraded_or_backfilling_object(obc->obs.oi.soid)) { callbacks_for_degraded_object[obc->obs.oi.soid].push_back( watch->get_delayed_cb() -- 2.39.5