]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: min_epoch for MOSDPGUpdateLogMissing[Reply]
authorSage Weil <sage@redhat.com>
Tue, 28 Feb 2017 02:46:35 +0000 (20:46 -0600)
committerSage Weil <sage@redhat.com>
Tue, 2 May 2017 02:01:29 +0000 (21:01 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/messages/MOSDPGUpdateLogMissing.h
src/messages/MOSDPGUpdateLogMissingReply.h
src/osd/PrimaryLogPG.cc

index bdb486c0818c66d1a3f4b647e5a59e7341186954..facb65bc854fd5ce4b78f88ba68b187c481420a8 100644 (file)
 
 class MOSDPGUpdateLogMissing : public MOSDFastDispatchOp {
 
-  static const int HEAD_VERSION = 1;
+  static const int HEAD_VERSION = 2;
   static const int COMPAT_VERSION = 1;
 
 
 public:
-  epoch_t map_epoch;
+  epoch_t map_epoch, min_epoch;
   spg_t pgid;
   shard_id_t from;
   ceph_tid_t rep_tid;
@@ -35,9 +35,13 @@ public:
   spg_t get_pgid() const { return pgid; }
   epoch_t get_query_epoch() const { return map_epoch; }
   ceph_tid_t get_tid() const { return rep_tid; }
+
   epoch_t get_map_epoch() const override {
     return map_epoch;
   }
+  epoch_t get_min_epoch() const override {
+    return min_epoch;
+  }
   spg_t get_spg() const override {
     return pgid;
   }
@@ -50,10 +54,12 @@ public:
     spg_t pgid,
     shard_id_t from,
     epoch_t epoch,
+    epoch_t min_epoch,
     ceph_tid_t rep_tid)
     : MOSDFastDispatchOp(MSG_OSD_PG_UPDATE_LOG_MISSING, HEAD_VERSION,
                         COMPAT_VERSION),
       map_epoch(epoch),
+      min_epoch(min_epoch),
       pgid(pgid),
       from(from),
       rep_tid(rep_tid),
@@ -66,6 +72,7 @@ public:
   const char *get_type_name() const override { return "PGUpdateLogMissing"; }
   void print(ostream& out) const override {
     out << "pg_update_log_missing(" << pgid << " epoch " << map_epoch
+       << "/" << min_epoch
        << " rep_tid " << rep_tid
        << " entries " << entries << ")";
   }
@@ -76,6 +83,7 @@ public:
     ::encode(from, payload);
     ::encode(rep_tid, payload);
     ::encode(entries, payload);
+    ::encode(min_epoch, payload);
   }
   void decode_payload() override {
     bufferlist::iterator p = payload.begin();
@@ -84,6 +92,11 @@ public:
     ::decode(from, p);
     ::decode(rep_tid, p);
     ::decode(entries, p);
+    if (header.version >= 2) {
+      ::decode(min_epoch, p);
+    } else {
+      min_epoch = map_epoch;
+    }
   }
 };
 
index 58d7de0b40f1a9db69047a24d10e6d6d7c98e0b5..8df6d9be5c84d9cf0e015d6beca8454c57acec4a 100644 (file)
 
 class MOSDPGUpdateLogMissingReply : public MOSDFastDispatchOp {
 
-  static const int HEAD_VERSION = 1;
+  static const int HEAD_VERSION = 2;
   static const int COMPAT_VERSION = 1;
 
 
 public:
-  epoch_t map_epoch;
+  epoch_t map_epoch, min_epoch;
   spg_t pgid;
   shard_id_t from;
   ceph_tid_t rep_tid;
@@ -40,6 +40,9 @@ public:
   epoch_t get_map_epoch() const override {
     return map_epoch;
   }
+  epoch_t get_min_epoch() const override {
+    return min_epoch;
+  }
   spg_t get_spg() const override {
     return pgid;
   }
@@ -54,12 +57,14 @@ public:
     spg_t pgid,
     shard_id_t from,
     epoch_t epoch,
+    epoch_t min_epoch,
     ceph_tid_t rep_tid)
     : MOSDFastDispatchOp(
         MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY,
         HEAD_VERSION,
         COMPAT_VERSION),
       map_epoch(epoch),
+      min_epoch(min_epoch),
       pgid(pgid),
       from(from),
       rep_tid(rep_tid)
@@ -72,6 +77,7 @@ public:
   const char *get_type_name() const override { return "PGUpdateLogMissingReply"; }
   void print(ostream& out) const override {
     out << "pg_update_log_missing_reply(" << pgid << " epoch " << map_epoch
+       << "/" << min_epoch
        << " rep_tid " << rep_tid << ")";
   }
 
@@ -80,6 +86,7 @@ public:
     ::encode(pgid, payload);
     ::encode(from, payload);
     ::encode(rep_tid, payload);
+    ::encode(min_epoch, payload);
   }
   void decode_payload() override {
     bufferlist::iterator p = payload.begin();
@@ -87,6 +94,11 @@ public:
     ::decode(pgid, p);
     ::decode(from, p);
     ::decode(rep_tid, p);
+    if (header.version >= 2) {
+      ::decode(min_epoch, p);
+    } else {
+      min_epoch = map_epoch;
+    }
   }
 };
 
index 85f5c97cbb65f2b9d2981eae23f9f9d53e8a4ccd..7ef32b5be7441fee3be63957976ebddd68691920 100644 (file)
@@ -8867,6 +8867,7 @@ void PrimaryLogPG::submit_log_entries(
            spg_t(info.pgid.pgid, i->shard),
            pg_whoami.shard,
            get_osdmap()->get_epoch(),
+           last_peering_reset,
            repop->rep_tid);
          osd->send_message_osd_cluster(
            peer.osd, m, get_osdmap()->get_epoch());
@@ -9903,6 +9904,7 @@ void PrimaryLogPG::do_update_log_missing(OpRequestRef &op)
            spg_t(info.pgid.pgid, primary_shard().shard),
            pg_whoami.shard,
            msg->get_epoch(),
+           msg->min_epoch,
            msg->get_tid());
        reply->set_priority(CEPH_MSG_PRIO_HIGH);
        msg->get_connection()->send_message(reply);