]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_objectstore_tool: Prevent tool from transitioning struct_v on rm-past-intervals
authorDavid Zafman <dzafman@redhat.com>
Wed, 26 Nov 2014 00:56:19 +0000 (16:56 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Mar 2015 19:20:59 +0000 (11:20 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit f056bdf93980a0a8e6157dbb124a79389a8f1a3c)

src/tools/ceph_objectstore_tool.cc

index 16b463a6387a7ec391bb6cab32f5280b7447887a..94828c086f87a971201b3097206fa12b7e3ceca9 100644 (file)
@@ -2814,6 +2814,14 @@ int main(int argc, char **argv)
       ObjectStore::Transaction tran;
       ObjectStore::Transaction *t = &tran;
 
+      if (struct_ver != PG::cur_struct_v) {
+        cerr << "Can't remove past-intervals, version mismatch " << (int)struct_ver
+          << " (pg)  != " << (int)PG::cur_struct_v << " (tool)"
+          << std::endl;
+        ret = 1;
+        goto out;
+      }
+
       cout << "Remove past-intervals " << past_intervals << std::endl;
 
       past_intervals.clear();