]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_objectstore_tool: Clear ...INCOMPAT_SHARDS from feature if exporting replicated pg
authorDavid Zafman <dzafman@redhat.com>
Thu, 13 Nov 2014 05:14:11 +0000 (21:14 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Mar 2015 18:44:18 +0000 (10:44 -0800)
Don't require importing OSD to have shards feature for replicated pg

http://tracker.ceph.com/issues/10077 Fixes: #10077

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 86baf2d38170ef19de2dd5e9ce3f280237d8474d)

src/tools/ceph_objectstore_tool.cc

index 040a82de9311d8eaec6530598c3b9b71ee0217fb..e9a2a628acc28df89cc23243bfe9c82234e8d89d 100644 (file)
@@ -799,6 +799,10 @@ int do_export(ObjectStore *fs, coll_t coll, spg_t pgid, pg_info_t &info,
   write_super();
 
   pg_begin pgb(pgid, superblock);
+  // Special case: If replicated pg don't require the importing OSD to have shard feature
+  if (pgid.is_no_shard()) {
+    pgb.superblock.compat_features.incompat.remove(CEPH_OSD_FEATURE_INCOMPAT_SHARDS);
+  }
   ret = write_section(TYPE_PG_BEGIN, pgb, file_fd);
   if (ret)
     return ret;
@@ -1362,6 +1366,11 @@ int do_import(ObjectStore *store, OSDSuperblock& sb)
   if (debug) {
     cerr << "Exported features: " << pgb.superblock.compat_features << std::endl;
   }
+
+  // Special case: Old export has SHARDS incompat feature on replicated pg, remove it
+  if (pgid.is_no_shard())
+    pgb.superblock.compat_features.incompat.remove(CEPH_OSD_FEATURE_INCOMPAT_SHARDS);
+
   if (sb.compat_features.compare(pgb.superblock.compat_features) == -1) {
     cerr << "Export has incompatible features set "
       << pgb.superblock.compat_features << std::endl;