]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: do not use CEPH_FEATURES_ALL for things that touch the disk 1148/head
authorGreg Farnum <greg@inktank.com>
Fri, 24 Jan 2014 19:07:13 +0000 (11:07 -0800)
committerGreg Farnum <greg@inktank.com>
Fri, 24 Jan 2014 20:33:56 +0000 (12:33 -0800)
We want to encode with our quorum_features instead. Remaining uses of
CEPH_FEATURES_ALL are:
1) when the Elector is sharing its supported features
2) in a MonMap function which is used by monmaptool
3) In the Monitor for winning a standalone election, for ephemeral data,
  and for doing mkfs (when we necessarily don't have quorum_features).
4) When doing ceph-mon --inject-monmap (we don't persist the quorum_features
  to disk, so we can't use them here).
5) in MMonElection, for doing the default monmap encoding (which is
  re-encoded later if the final features don't match CEPH_FEATURES_ALL).
6) As the default encode features for the OSDMap (the monitor always
  supplies quorum_features instead).

Signed-off-by: Greg Farnum <greg@inktank.com>
src/messages/MMonElection.h
src/mon/Monitor.cc
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc

index f1ef1dd792a45771e3ed442a16fb3069f7851b2e..e3ccbf3eeb1653dee7205cd635bcc5ddc1e9f273 100644 (file)
@@ -75,7 +75,7 @@ public:
   }
   
   void encode_payload(uint64_t features) {
-    if (monmap_bl.length() && (features & CEPH_FEATURE_MONENC) == 0) {
+    if (monmap_bl.length() && (features != CEPH_FEATURES_ALL)) {
       // reencode old-format monmap
       MonMap t;
       t.decode(monmap_bl);
index 205d4908b64c85a7a52f73b9cf8541f150193749..35d880c4559c0cf18a41185803d97b419bb35117 100644 (file)
@@ -868,7 +868,7 @@ void Monitor::sync_obtain_latest_monmap(bufferlist &bl)
 
   dout(1) << __func__ << " obtained monmap e" << latest_monmap.epoch << dendl;
 
-  latest_monmap.encode(bl, CEPH_FEATURES_ALL);
+  latest_monmap.encode(bl, quorum_features);
 }
 
 void Monitor::sync_reset_requester()
@@ -2514,7 +2514,7 @@ void Monitor::try_send_message(Message *m, const entity_inst_t& to)
   dout(10) << "try_send_message " << *m << " to " << to << dendl;
 
   bufferlist bl;
-  encode_message(m, CEPH_FEATURES_ALL, bl);  // fixme: assume peers have all features we do.
+  encode_message(m, quorum_features, bl);
 
   messenger->send_message(m, to);
 
index 61d85ae96c630e9618d7f5aff813f414203ee0b6..6b4abd58c0744ef92932c2df220d1517f6fb2a47 100644 (file)
@@ -203,7 +203,7 @@ bool MonmapMonitor::preprocess_command(MMonCommand *m)
     assert(p != NULL);
 
     if (prefix == "mon getmap") {
-      p->encode(rdata, CEPH_FEATURES_ALL);
+      p->encode(rdata, m->get_connection()->get_features());
       r = 0;
       ss << "got monmap epoch " << p->get_epoch();
     } else if (prefix == "mon dump") {
index 520f508c15322958839ab4c1f0f829360ec43d56..2171a81b552560c47516fdced440eac0d6098f1b 100644 (file)
@@ -103,7 +103,7 @@ void OSDMonitor::create_initial()
   newmap.created = newmap.modified = ceph_clock_now(g_ceph_context);
 
   // encode into pending incremental
-  newmap.encode(pending_inc.fullmap);
+  newmap.encode(pending_inc.fullmap, mon->quorum_features);
 }
 
 void OSDMonitor::update_from_paxos(bool *need_bootstrap)
@@ -203,7 +203,7 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
 
     // write out the full map for all past epochs
     bufferlist full_bl;
-    osdmap.encode(full_bl);
+    osdmap.encode(full_bl, mon->quorum_features);
     tx_size += full_bl.length();
 
     put_version_full(t, osdmap.epoch, full_bl);
@@ -555,7 +555,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::Transaction *t)
 
   // encode
   assert(get_last_committed() + 1 == pending_inc.epoch);
-  ::encode(pending_inc, bl, CEPH_FEATURES_ALL);
+  ::encode(pending_inc, bl, mon->quorum_features);
 
   /* put everything in the transaction */
   put_version(t, pending_inc.epoch, bl);
@@ -2118,7 +2118,7 @@ bool OSDMonitor::preprocess_command(MMonCommand *m)
       } 
       rdata.append(ds);
     } else if (prefix == "osd getmap") {
-      p->encode(rdata);
+      p->encode(rdata, m->get_connection()->get_features());
       ss << "got osdmap epoch " << p->get_epoch();
     } else if (prefix == "osd getcrushmap") {
       p->crush->encode(rdata);