cerr << "Error updating period epoch: " << cpp_strerror(ret) << std::endl;
return ret;
}
- realm.notify_zone();
+ realm.notify_new_period(period);
return ret;
}
return 0;
}
+int RGWRealm::notify_new_period(const RGWPeriod& period)
+{
+ return notify_zone();
+}
int RGWPeriod::init(CephContext *_cct, RGWRados *_store, const string& period_realm_id,
const string& period_realm_name, bool setup_obj)
}
ldout(cct, 4) << "Promoted to master zone and committed new period "
<< id << dendl;
- realm.notify_zone();
+ realm.notify_new_period(*this);
return 0;
}
// period must be based on predecessor's current epoch
}
ldout(cct, 4) << "Committed new epoch " << epoch
<< " for period " << id << dendl;
- realm.notify_zone();
+ realm.notify_new_period(*this);
return 0;
}
};
WRITE_CLASS_ENCODER(objexp_hint_entry)
+class RGWPeriod;
+
class RGWRealm : public RGWSystemMetaObj
{
string master_zonegroup;
int set_current_period(const string& period_id);
string get_control_oid();
+ /// send a notify on the realm control object
int notify_zone();
+ /// notify the zone of a new period
+ int notify_new_period(const RGWPeriod& period);
};
WRITE_CLASS_ENCODER(RGWRealm)
ldout(cct, 4) << "current period " << current_period.get_id()
<< " is period " << period.get_id() << "'s predecessor, "
"updating current period and notifying zone" << dendl;
- realm.notify_zone();
+ realm.notify_new_period(period);
return;
}
ldout(cct, 4) << "period epoch " << period.get_epoch()
<< " is newer than current epoch " << current_period.get_epoch()
<< ", updating latest epoch and notifying zone" << dendl;
- realm.notify_zone();
+ realm.notify_new_period(period);
}
class RGWHandler_Period : public RGWHandler_Auth_S3 {