From 06c384f1c5aa5b4b6404a3caf8a5f88ee40b0b03 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 5 Aug 2016 11:28:13 -0400 Subject: [PATCH] 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 --- src/rgw/rgw_period_puller.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rgw/rgw_period_puller.cc b/src/rgw/rgw_period_puller.cc index a35591ccb92..b76f73e4a53 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 -- 2.47.3