]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: move to v4, trigger DBOjectMap upgrade
authorSage Weil <sage@redhat.com>
Thu, 4 Dec 2014 22:46:58 +0000 (14:46 -0800)
committerSage Weil <sage@redhat.com>
Wed, 17 Dec 2014 01:07:54 +0000 (17:07 -0800)
From FileStore's perspective, nothing changed from v3 to v4.  However, we
need to pass the do_upgrade flag to DBOjectMap open to trigger it's
upgrade process.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FileStore.cc
src/os/FileStore.h

index 6b01c8189fb3d29e9a1cb86ae4918575d68331a7..738db432727027238097c23b5de9c38e873b0de0 100644 (file)
@@ -1167,8 +1167,15 @@ int FileStore::upgrade()
   if (r == 1)
     return 0;
 
-  derr << "ObjectStore is old at version " << version << ".  Please upgrade to firefly v0.80.x, convert your store, and then upgrade."  << dendl;
-  return -EINVAL;
+  if (version < 3) {
+    derr << "ObjectStore is old at version " << version << ".  Please upgrade to firefly v0.80.x, convert your store, and then upgrade."  << dendl;
+    return -EINVAL;
+  }
+
+  // nothing necessary in FileStore for v3 -> v4 upgrade; we just need to
+  // open up DBObjectMap with the do_upgrade flag, which we already did.
+  update_version_stamp();
+  return 0;
 }
 
 int FileStore::read_op_seq(uint64_t *seq)
@@ -1255,17 +1262,19 @@ int FileStore::mount()
         << cpp_strerror(ret) << dendl;
     goto close_fsid_fd;
   } else if (ret == 0) {
-    if (do_update) {
+    if (do_update || (int)version_stamp < g_conf->filestore_update_to) {
       derr << "FileStore::mount : stale version stamp detected: "
           << version_stamp 
           << ". Proceeding, do_update "
           << "is set, performing disk format upgrade."
           << dendl;
+      do_update = true;
     } else {
       ret = -EINVAL;
       derr << "FileStore::mount : stale version stamp " << version_stamp
           << ". Please run the FileStore update script before starting the "
           << "OSD, or set filestore_update_to to " << target_version
+          << " (currently " << g_conf->filestore_update_to << ")"
           << dendl;
       goto close_fsid_fd;
     }
index 27d6b85aa866f1259f667ec1983b34ec9322088d..b11530794b68625124df818d75fad6afa9025ce5 100644 (file)
@@ -90,7 +90,7 @@ inline ostream& operator<<(ostream& out, const FSSuperblock& sb)
 class FileStore : public JournalingObjectStore,
                   public md_config_obs_t
 {
-  static const uint32_t target_version = 3;
+  static const uint32_t target_version = 4;
 public:
   uint32_t get_target_version() {
     return target_version;