]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: ignore non MISSING pg query in ReplicaActive
authorSamuel Just <sam.just@inktank.com>
Fri, 15 Mar 2013 02:59:36 +0000 (19:59 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 19 Mar 2013 17:32:36 +0000 (10:32 -0700)
1) Replica sends notify
2) Prior to processing notify, primary queues query to replica
3) Primary processes notify and activates sending MOSDPGLog
to replica.
4) Primary does do_notifies at end of process_peering_events
and sends to Query.
5) Replica sees MOSDPGLog and activates
6) Replica sees Query and asserts.

In the above case, the Replica should simply ignore the old
Query.

Fixes: #4050
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 8222cbc8f35c359a35f8381ad90ff0eed5615dac)

src/osd/PG.cc

index 23f1623d7fea4f836101e5d13ded70c0e882bb94..982ce1a3d76751f93ede8c29078f88d4c4b560f4 100644 (file)
@@ -6239,9 +6239,10 @@ boost::statechart::result PG::RecoveryState::ReplicaActive::react(const ActMap&)
 boost::statechart::result PG::RecoveryState::ReplicaActive::react(const MQuery& query)
 {
   PG *pg = context< RecoveryMachine >().pg;
-  assert(query.query.type == pg_query_t::MISSING);
-  pg->update_history_from_master(query.query.history);
-  pg->fulfill_log(query.from, query.query, query.query_epoch);
+  if (query.query.type == pg_query_t::MISSING) {
+    pg->update_history_from_master(query.query.history);
+    pg->fulfill_log(query.from, query.query, query.query_epoch);
+  } // else: from prior to activation, safe to ignore
   return discard_event();
 }