]> git.apps.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)
committerSage Weil <sage@redhat.com>
Wed, 17 Dec 2014 01:07:58 +0000 (17:07 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/tools/ceph_objectstore_tool.cc

index 11f1d9366619952816a0d790c545d39dfc7de6c2..ddd98524e1b898bba2819df2b0834eadee4508c7 100644 (file)
@@ -2835,6 +2835,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();