]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: ReplicaActive must repond to requests from discover_all_missing
authorSamuel Just <samuel.just@dreamhost.com>
Wed, 4 May 2011 17:21:54 +0000 (10:21 -0700)
committerSamuel Just <samuel.just@dreamhost.com>
Wed, 4 May 2011 18:36:56 +0000 (11:36 -0700)
If the peer does not yet have the pg during GetMissing, there won't be
a peer_missing entry for that peer.  In that case, discover_all_missing
can legitimately request a missing set after the pg has gone active.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/PG.cc
src/osd/PG.h

index 64dfa0b3397f4d05eae2eea23a2c144f68bcb1d5..b364b41c72340ff75e767c9567c82ab97b80a445 100644 (file)
@@ -3988,6 +3988,13 @@ PG::RecoveryState::ReplicaActive::react(const ActMap&) {
   return discard_event();
 }
 
+boost::statechart::result 
+PG::RecoveryState::ReplicaActive::react(const MQuery& query) {
+  PG *pg = context< RecoveryMachine >().pg;
+  assert(query.query.type == Query::MISSING);
+  pg->fulfill_log(query.from, query.query);
+  return discard_event();
+}
 /*-------Stray---*/
 PG::RecoveryState::Stray::Stray(my_context ctx) 
   : my_base(ctx), backlog_requested(false) {
index fc248e9de9c22ad3c9856c403c8d30c5ca0e0661..d578bef9ea68d0515cb31d75e16552f574f169d0 100644 (file)
@@ -1005,12 +1005,14 @@ public:
     struct ReplicaActive : boost::statechart::state< ReplicaActive, Started >, NamedState {
       typedef boost::mpl::list <
        boost::statechart::custom_reaction< ActMap >,
+       boost::statechart::custom_reaction< MQuery >,
        boost::statechart::custom_reaction< MInfoRec >
        > reactions;
 
       ReplicaActive(my_context ctx);
       boost::statechart::result react(const MInfoRec& infoevt);
       boost::statechart::result react(const ActMap&);
+      boost::statechart::result react(const MQuery&);
     };
 
     struct Stray : boost::statechart::state< Stray, Started >, NamedState {