]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Config OSD when CEPH_FEATURE_OSD_ERASURE_CODES feature first seen
authorDavid Zafman <david.zafman@inktank.com>
Thu, 19 Dec 2013 21:47:28 +0000 (13:47 -0800)
committerDavid Zafman <david.zafman@inktank.com>
Wed, 8 Jan 2014 22:53:28 +0000 (14:53 -0800)
Set the OSD superblock CEPH_OSD_FEATURE_INCOMPAT_SHARDS and
notify the filestore through set_allow_sharded_objects() in that order.

Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/OSD.cc
src/osd/OSD.h

index 1e3e980e8fc6423b9cf911016df67ba389f4cc7a..d3972369259c3804618742414f452e752044f622 100644 (file)
@@ -1107,7 +1107,7 @@ int OSD::init()
     goto out;
   }
   osdmap = get_map(superblock.current_epoch);
-  check_osdmap_features();
+  check_osdmap_features(store);
 
   create_recoverystate_perf();
 
@@ -5313,7 +5313,7 @@ void OSD::handle_osd_map(MOSDMap *m)
 
   map_lock.put_write();
 
-  check_osdmap_features();
+  check_osdmap_features(store);
 
   // yay!
   consume_map();
@@ -5345,7 +5345,7 @@ void OSD::handle_osd_map(MOSDMap *m)
   m->put();
 }
 
-void OSD::check_osdmap_features()
+void OSD::check_osdmap_features(ObjectStore *fs)
 {
   // adjust required feature bits?
 
@@ -5379,13 +5379,14 @@ void OSD::check_osdmap_features()
   }
 
   if ((features & CEPH_FEATURE_OSD_ERASURE_CODES) &&
-      (!superblock.compat_features.incompat.contains(CEPH_OSD_FEATURE_INCOMPAT_SHARDS))) {
+       !fs->get_allow_sharded_objects()) {
     dout(0) << __func__ << " enabling on-disk ERASURE CODES compat feature" << dendl;
     superblock.compat_features.incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_SHARDS);
     ObjectStore::Transaction t;
     write_superblock(t);
     int err = store->apply_transaction(t);
     assert(err == 0);
+    fs->set_allow_sharded_objects();
   }
 }
 
index 5d51efce3f4e4fe688c890ff57acd7e11b103b20..889822b39949bf5ef70d58084bab13821b5ef80a 100644 (file)
@@ -697,7 +697,7 @@ protected:
   void _dispatch(Message *m);
   void dispatch_op(OpRequestRef op);
 
-  void check_osdmap_features();
+  void check_osdmap_features(ObjectStore *store);
 
   // asok
   friend class OSDSocketHook;