From: Tianshan Qu Date: Wed, 31 Jan 2018 17:25:55 +0000 (+0800) Subject: rgw: do not reflect period if not current X-Git-Tag: v12.2.6~127^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a5099c6caa3a98e9aee8eb6d67bcfec2ad4e6c18;p=ceph.git rgw: do not reflect period if not current if some history period not exist in local, it will pull from master and update the old info to zonegroup. fixes: http://tracker.ceph.com/issues/22844 Signed-off-by: Tianshan Qu (cherry picked from commit 915404255f32cf92975e3ac82c8f775bb97cc8a5) --- diff --git a/src/rgw/rgw_period_puller.cc b/src/rgw/rgw_period_puller.cc index 2c811a358ba..29d3a0052bb 100644 --- a/src/rgw/rgw_period_puller.cc +++ b/src/rgw/rgw_period_puller.cc @@ -95,9 +95,11 @@ int RGWPeriodPuller::pull(const std::string& period_id, RGWPeriod& period) return r; } // reflect period objects if this is the latest version - r = period.reflect(); - if (r < 0) { - return r; + if (store->realm.get_current_period() == period_id) { + r = period.reflect(); + if (r < 0) { + return r; + } } ldout(store->ctx(), 14) << "period " << period_id << " pulled and written to local storage" << dendl;