]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: period commit updates sync status before writing the object
authorCasey Bodley <cbodley@redhat.com>
Tue, 8 Dec 2015 18:41:19 +0000 (13:41 -0500)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:51 +0000 (16:13 -0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc

index 7f102bbf5d565e9494f6055e37605d4d61088a70..775eb2d55ca1f617182dd5130486b905982e7305 100644 (file)
@@ -1285,19 +1285,19 @@ int RGWPeriod::commit(RGWRealm& realm, const RGWPeriod& current_period)
   }
   // did the master zone change?
   if (master_zone != current_period.get_master_zone()) {
-    // create with a new period id
-    int r = create(true);
-    if (r < 0) {
-      lderr(cct) << "failed to create new period: " << cpp_strerror(-r) << dendl;
-      return r;
-    }
     // store the current metadata sync status in the period
-    r = update_sync_status();
+    int r = update_sync_status();
     if (r < 0) {
       lderr(cct) << "failed to update metadata sync status: "
           << cpp_strerror(-r) << dendl;
       return r;
     }
+    // create an object with a new period id
+    r = create(true);
+    if (r < 0) {
+      lderr(cct) << "failed to create new period: " << cpp_strerror(-r) << dendl;
+      return r;
+    }
     // set as current period
     r = realm.set_current_period(id);
     if (r < 0) {