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)
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();
}