From: Sage Weil Date: Thu, 4 Dec 2014 22:46:58 +0000 (-0800) Subject: os/FileStore: move to v4, trigger DBOjectMap upgrade X-Git-Tag: v0.91~23^2~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=18214928d12b48b7e29e5dceae72a98108b5f79a;p=ceph.git os/FileStore: move to v4, trigger DBOjectMap upgrade 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 --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 6b01c8189fb..738db432727 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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; } diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 27d6b85aa86..b11530794b6 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -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;