From: Casey Bodley Date: Fri, 5 Aug 2016 15:28:13 +0000 (-0400) Subject: rgw: fixes for period puller X-Git-Tag: ses5-milestone5~118^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=06c384f1c5aa5b4b6404a3caf8a5f88ee40b0b03;p=ceph.git rgw: fixes for period puller * reset epoch=0 before RGWPeriod::init() so we get the latest_epoch * if we're the metadata master, don't try to pull periods from ourself Fixes: http://tracker.ceph.com/issues/16939 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_period_puller.cc b/src/rgw/rgw_period_puller.cc index a35591ccb92c..b76f73e4a53b 100644 --- a/src/rgw/rgw_period_puller.cc +++ b/src/rgw/rgw_period_puller.cc @@ -57,8 +57,15 @@ int RGWPeriodPuller::pull(const std::string& period_id, RGWPeriod& period) { // try to read the period from rados period.set_id(period_id); + period.set_epoch(0); int r = period.init(store->ctx(), store); if (r < 0) { + if (store->is_meta_master()) { + // can't pull if we're the master + ldout(store->ctx(), 1) << "metadata master failed to read period " + << period_id << " from local storage: " << cpp_strerror(r) << dendl; + return r; + } ldout(store->ctx(), 14) << "pulling period " << period_id << " from master" << dendl; // request the period from the master zone