]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: always set query_epoch explicitly for MOSDPGLog 22487/head
authorKefu Chai <kchai@redhat.com>
Sat, 9 Jun 2018 07:15:01 +0000 (15:15 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 9 Jun 2018 07:15:55 +0000 (15:15 +0800)
it's a follow-up change of 339ae18b. also remove the MOSDPGLog
contructor where query_epoch is optional. it's less error-prone if we
make this parameter mandatory.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/messages/MOSDPGLog.h
src/osd/PG.cc
src/osd/PrimaryLogPG.cc

index 55932213bb26375912dfa7fdd55de36b3cf42627..7138bbf08f06abea0c35c7d7b4cd627e90ecfc51 100644 (file)
@@ -69,13 +69,6 @@ public:
   MOSDPGLog() : MOSDPeeringOp(MSG_OSD_PG_LOG, HEAD_VERSION, COMPAT_VERSION) {
     set_priority(CEPH_MSG_PRIO_HIGH); 
   }
-  MOSDPGLog(shard_id_t to, shard_id_t from, version_t mv, pg_info_t& i)
-    : MOSDPeeringOp(MSG_OSD_PG_LOG, HEAD_VERSION, COMPAT_VERSION),
-      epoch(mv), query_epoch(mv),
-      to(to), from(from),
-      info(i)  {
-    set_priority(CEPH_MSG_PRIO_HIGH); 
-  }
   MOSDPGLog(shard_id_t to, shard_id_t from,
            version_t mv, pg_info_t& i, epoch_t query_epoch)
     : MOSDPeeringOp(MSG_OSD_PG_LOG, HEAD_VERSION, COMPAT_VERSION),
index 6a794db2b3f1b0c6c1369140baa67d9a0baecfb3..2daba324ed160490be90bae76f76f96cf2a09a30 100644 (file)
@@ -1914,7 +1914,8 @@ void PG::activate(ObjectStore::Transaction& t,
          dout(10) << "activate peer osd." << peer << " is up to date, but sending pg_log anyway" << dendl;
          m = new MOSDPGLog(
            i->shard, pg_whoami.shard,
-           get_osdmap()->get_epoch(), info);
+           get_osdmap()->get_epoch(), info,
+           last_peering_reset);
        }
       } else if (
        pg_log.get_tail() > pi.last_update ||
index 2927d76fd735b4fb45890a5dc944faffae2cb4d0..03b974274f1f183c4c6a8def4ea414e72f510e05 100644 (file)
@@ -10564,7 +10564,7 @@ void PrimaryLogPG::submit_log_entries(
          MOSDPGLog *m = new MOSDPGLog(
            peer.shard, pg_whoami.shard,
            info.last_update.epoch,
-           info);
+           info, last_peering_reset);
          m->log.log = entries;
          m->log.tail = old_last_update;
          m->log.head = info.last_update;