From: Sage Weil Date: Tue, 28 Feb 2017 02:46:35 +0000 (-0600) Subject: osd: min_epoch for MOSDPGUpdateLogMissing[Reply] X-Git-Tag: v12.0.3~80^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fad0994cbab249e83a6f216bb867b66d1ad61c9f;p=ceph.git osd: min_epoch for MOSDPGUpdateLogMissing[Reply] Signed-off-by: Sage Weil --- diff --git a/src/messages/MOSDPGUpdateLogMissing.h b/src/messages/MOSDPGUpdateLogMissing.h index bdb486c0818c..facb65bc854f 100644 --- a/src/messages/MOSDPGUpdateLogMissing.h +++ b/src/messages/MOSDPGUpdateLogMissing.h @@ -20,12 +20,12 @@ 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; + } } }; diff --git a/src/messages/MOSDPGUpdateLogMissingReply.h b/src/messages/MOSDPGUpdateLogMissingReply.h index 58d7de0b40f1..8df6d9be5c84 100644 --- a/src/messages/MOSDPGUpdateLogMissingReply.h +++ b/src/messages/MOSDPGUpdateLogMissingReply.h @@ -20,12 +20,12 @@ 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; + } } }; diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 85f5c97cbb65..7ef32b5be744 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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);