]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix FSMap upgrade on mixed mon versions
authorJohn Spray <john.spray@redhat.com>
Sat, 12 Mar 2016 18:01:29 +0000 (18:01 +0000)
committerJohn Spray <john.spray@redhat.com>
Sat, 12 Mar 2016 18:04:43 +0000 (18:04 +0000)
The upgrade path was asserting that FSMap::filesystems
was empty.  This would be violated if FSMap was initially
loaded from disk in old format, and then also received
off the network (but with a newer epoch) in old format.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/FSMap.cc

index 7cb6277b03e0fec7bc85ddcc5b0cf44d89c20838..cf8c7aed30aaaea5e7665f0f6b8f6b7141fa330e 100644 (file)
@@ -326,8 +326,14 @@ void FSMap::decode(bufferlist::iterator& p)
     }
 
     // We're upgrading, populate filesystems from the legacy fields
-    assert(filesystems.empty());
+    filesystems.clear();
+    standby_daemons.clear();
+    standby_epochs.clear();
+    mds_roles.clear();
+    compat = legacy_mds_map.compat;
+    enable_multiple = false;
 
+    // Synthesise a Filesystem from legacy_mds_map, if enabled
     if (legacy_mds_map.enabled) {
       // Construct a Filesystem from the legacy MDSMap
       auto migrate_fs = std::make_shared<Filesystem>(); 
@@ -355,9 +361,6 @@ void FSMap::decode(bufferlist::iterator& p)
     } else {
       legacy_client_fscid = FS_CLUSTER_ID_NONE;
     }
-
-    compat = legacy_mds_map.compat;
-    enable_multiple = false;
   } else {
     ::decode(epoch, p);
     ::decode(next_filesystem_id, p);