]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: remove Query::BACKLOG processing
authorSage Weil <sage.weil@dreamhost.com>
Fri, 2 Dec 2011 18:47:44 +0000 (10:47 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Wed, 14 Dec 2011 19:31:32 +0000 (11:31 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

index 0b9d8a684bc7cd741ba9baa20d24a8cd1113c6d8..351e1c3e7a88293fda66ea3c27313c3be411871f 100644 (file)
@@ -4661,7 +4661,6 @@ void OSD::handle_pg_query(MOSDPGQuery *m)
       dout(10) << " pg " << pgid << " dne" << dendl;
       PG::Info empty(pgid);
       if (it->second.type == PG::Query::LOG ||
-         it->second.type == PG::Query::BACKLOG ||
          it->second.type == PG::Query::FULLLOG) {
        MOSDPGLog *mlog = new MOSDPGLog(osdmap->get_epoch(), empty,
                                        m->get_epoch());
index 2e58cbfe723b7c6a08c7e055c05d27d8d01982df..5607c4df5964cea82a450f0d7550519382b2c583 100644 (file)
@@ -3172,42 +3172,33 @@ void PG::fulfill_log(int from, const Query &query, epoch_t query_epoch)
   assert(!acting.empty());
   assert(from == acting[0]);
   assert(query.type != PG::Query::INFO);
-  if (query.type == PG::Query::BACKLOG &&
-      !log.backlog) {
-    assert(0); // generated in the state machine
-  } else {
-    MOSDPGLog *mlog = new MOSDPGLog(get_osdmap()->get_epoch(),
-                                   info, query_epoch);
-    mlog->missing = missing;
-
-    // primary -> other, when building master log
-    if (query.type == PG::Query::LOG) {
-      dout(10) << " sending info+missing+log since " << query.since
-              << dendl;
-      if (query.since != eversion_t() && query.since < log.tail) {
-       osd->clog.error() << info.pgid << " got broken Query::LOG since " << query.since
-                         << " when my log.tail is " << log.tail
-                         << ", sending full log instead\n";
-       mlog->log = log;           // primary should not have requested this!!
-      } else
-       mlog->log.copy_after(log, query.since);
-    }
-    else if (query.type == PG::Query::BACKLOG) {
-      dout(10) << "sending info+missing+backlog" << dendl;
-      assert(log.backlog);
-      mlog->log = log;
-    } 
-    else if (query.type == PG::Query::FULLLOG) {
-      dout(10) << " sending info+missing+full log" << dendl;
-      mlog->log.copy_non_backlog(log);
-    }
 
-    dout(10) << " sending " << mlog->log << " " << mlog->missing << dendl;
+  MOSDPGLog *mlog = new MOSDPGLog(get_osdmap()->get_epoch(),
+                                 info, query_epoch);
+  mlog->missing = missing;
 
-    osd->_share_map_outgoing(get_osdmap()->get_cluster_inst(from));
-    osd->cluster_messenger->send_message(mlog, 
-                                        get_osdmap()->get_cluster_inst(from));
+  // primary -> other, when building master log
+  if (query.type == PG::Query::LOG) {
+    dout(10) << " sending info+missing+log since " << query.since
+            << dendl;
+    if (query.since != eversion_t() && query.since < log.tail) {
+      osd->clog.error() << info.pgid << " got broken Query::LOG since " << query.since
+                       << " when my log.tail is " << log.tail
+                       << ", sending full log instead\n";
+      mlog->log = log;           // primary should not have requested this!!
+    } else
+      mlog->log.copy_after(log, query.since);
+  }
+  else if (query.type == PG::Query::FULLLOG) {
+    dout(10) << " sending info+missing+full log" << dendl;
+    mlog->log.copy_non_backlog(log);
   }
+
+  dout(10) << " sending " << mlog->log << " " << mlog->missing << dendl;
+
+  osd->_share_map_outgoing(get_osdmap()->get_cluster_inst(from));
+  osd->cluster_messenger->send_message(mlog, 
+                                      get_osdmap()->get_cluster_inst(from));
 }
 
 
@@ -4164,21 +4155,6 @@ boost::statechart::result PG::RecoveryState::Stray::react(const MInfoRec& infoev
 boost::statechart::result PG::RecoveryState::Stray::react(const MQuery& query)
 {
   PG *pg = context< RecoveryMachine >().pg;
-  if (query.query.type == Query::BACKLOG) {
-    if (!pg->log.backlog) {
-      dout(10) << "Stray, need a backlog!" 
-              << dendl;
-      pending_queries[query.from] = pair<Query, epoch_t>(query.query,
-                                                        query.query_epoch);
-      if (!backlog_requested) {
-       dout(10) << "Stray, generating a backlog!" 
-                << dendl;
-#warning dead code
-      }
-      return discard_event();
-    }
-  }
-
   if (query.query.type == Query::INFO) {
     pair<int, Info> notify_info;
     pg->fulfill_info(query.from, query.query, notify_info);
index e9db53beea9a4fa7a196083f71a198c8d5d6dae7..a3f365b8ba45b7c31369ff0f97436a55d7fc17fa 100644 (file)
@@ -306,13 +306,11 @@ public:
    * Query - used to ask a peer for information about a pg.
    *
    * note: if version=0, type=LOG, then we just provide our full log.
-   *   only if type=BACKLOG do we generate a backlog and provide that too.
    */
   struct Query {
     enum {
       INFO = 0,
       LOG = 1,
-      BACKLOG = 3,
       MISSING = 4,
       FULLLOG = 5,
     };
@@ -320,7 +318,6 @@ public:
       switch (type) {
       case INFO: return "info";
       case LOG: return "log";
-      case BACKLOG: return "backlog";
       case MISSING: return "missing";
       case FULLLOG: return "fulllog";
       default: return "???";