From: Casey Bodley Date: Tue, 8 Dec 2015 18:41:19 +0000 (-0500) Subject: rgw: period commit updates sync status before writing the object X-Git-Tag: v10.1.0~354^2~83 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=426e3fc4306fa014beedc88b8b0b36c5dd66d88b;p=ceph.git rgw: period commit updates sync status before writing the object Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 7f102bbf5d56..775eb2d55ca1 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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) {