return nullptr;
}
- PG::PeeringCtx rctx = create_context();
+ PeeringCtx rctx = create_context();
OSDMapRef startmap = get_map(info->epoch);
dout(10) << __func__ << " " << pgs << dendl;
if (is_stopping())
return;
- PG::PeeringCtx rctx = create_context();
+ PeeringCtx rctx = create_context();
for (set<PGRef>::iterator i = pgs.begin();
i != pgs.end();
++i) {
epoch_t osd_epoch,
PG *pg,
ThreadPool::TPHandle &handle,
- PG::PeeringCtx &rctx)
+ PeeringCtx &rctx)
{
if (osd_epoch <= pg->get_osdmap_epoch()) {
return true;
const set<spg_t> &childpgids, set<PGRef> *out_pgs,
OSDMapRef curmap,
OSDMapRef nextmap,
- PG::PeeringCtx &rctx)
+ PeeringCtx &rctx)
{
unsigned pg_num = nextmap->get_pg_num(parent->pg_id.pool());
parent->update_snap_mapper_bits(parent->get_pgid().get_split_bits(pg_num));
// ----------------------------------------
// peering and recovery
-PG::PeeringCtx OSD::create_context()
+PeeringCtx OSD::create_context()
{
- return PG::PeeringCtx();
+ return PeeringCtx();
}
-void OSD::dispatch_context_transaction(PG::PeeringCtx &ctx, PG *pg,
+void OSD::dispatch_context_transaction(PeeringCtx &ctx, PG *pg,
ThreadPool::TPHandle *handle)
{
if (!ctx.transaction.empty() || ctx.transaction.has_contexts()) {
}
}
-void OSD::dispatch_context(PG::PeeringCtx &ctx, PG *pg, OSDMapRef curmap,
+void OSD::dispatch_context(PeeringCtx &ctx, PG *pg, OSDMapRef curmap,
ThreadPool::TPHandle *handle)
{
if (!service.get_osdmap()->is_up(whoami)) {
<< " on " << *pg << dendl;
if (do_unfound) {
- PG::PeeringCtx rctx = create_context();
+ PeeringCtx rctx = create_context();
rctx.handle = &handle;
pg->find_unfound(queued, rctx);
dispatch_context(rctx, pg, pg->get_osdmap());
PGPeeringEventRef evt,
ThreadPool::TPHandle& handle)
{
- PG::PeeringCtx rctx = create_context();
+ PeeringCtx rctx = create_context();
auto curmap = sdata->get_osdmap();
bool need_up_thru = false;
epoch_t same_interval_since = 0;
epoch_t advance_to,
PG *pg,
ThreadPool::TPHandle &handle,
- PG::PeeringCtx &rctx);
+ PeeringCtx &rctx);
void consume_map();
void activate_map();
const set<spg_t> &childpgids, set<PGRef> *out_pgs,
OSDMapRef curmap,
OSDMapRef nextmap,
- PG::PeeringCtx &rctx);
+ PeeringCtx &rctx);
void _finish_splits(set<PGRef>& pgs);
// == monitor interaction ==
}
// -- generic pg peering --
- PG::PeeringCtx create_context();
- void dispatch_context(PG::PeeringCtx &ctx, PG *pg, OSDMapRef curmap,
+ PeeringCtx create_context();
+ void dispatch_context(PeeringCtx &ctx, PG *pg, OSDMapRef curmap,
ThreadPool::TPHandle *handle = NULL);
- void dispatch_context_transaction(PG::PeeringCtx &ctx, PG *pg,
+ void dispatch_context_transaction(PeeringCtx &ctx, PG *pg,
ThreadPool::TPHandle *handle = NULL);
- void discard_context(PG::PeeringCtx &ctx);
+ void discard_context(PeeringCtx &ctx);
void do_notifies(map<int,
vector<pair<pg_notify_t, PastIntervals> > >&
notify_list,
void update(CephContext *cct, OSDMapRef map);
};
+// [primary only] content recovery state
+struct BufferedRecoveryMessages {
+ map<int, map<spg_t, pg_query_t> > query_map;
+ map<int, vector<pair<pg_notify_t, PastIntervals> > > info_map;
+ map<int, vector<pair<pg_notify_t, PastIntervals> > > notify_list;
+};
+
+struct PeeringCtx {
+ map<int, map<spg_t, pg_query_t> > query_map;
+ map<int, vector<pair<pg_notify_t, PastIntervals> > > info_map;
+ map<int, vector<pair<pg_notify_t, PastIntervals> > > notify_list;
+ ObjectStore::Transaction transaction;
+ HBHandle* handle = nullptr;
+
+ PeeringCtx() = default;
+
+ void reset_transaction() {
+ transaction = ObjectStore::Transaction();
+ }
+
+ void accept_buffered_messages(BufferedRecoveryMessages &m) {
+ for (map<int, map<spg_t, pg_query_t> >::iterator i = m.query_map.begin();
+ i != m.query_map.end();
+ ++i) {
+ map<spg_t, pg_query_t> &omap = query_map[i->first];
+ for (map<spg_t, pg_query_t>::iterator j = i->second.begin();
+ j != i->second.end();
+ ++j) {
+ omap[j->first] = j->second;
+ }
+ }
+ for (map<int, vector<pair<pg_notify_t, PastIntervals> > >::iterator i
+ = m.info_map.begin();
+ i != m.info_map.end();
+ ++i) {
+ vector<pair<pg_notify_t, PastIntervals> > &ovec =
+ info_map[i->first];
+ ovec.reserve(ovec.size() + i->second.size());
+ ovec.insert(ovec.end(), i->second.begin(), i->second.end());
+ }
+ for (map<int, vector<pair<pg_notify_t, PastIntervals> > >::iterator i
+ = m.notify_list.begin();
+ i != m.notify_list.end();
+ ++i) {
+ vector<pair<pg_notify_t, PastIntervals> > &ovec =
+ notify_list[i->first];
+ ovec.reserve(ovec.size() + i->second.size());
+ ovec.insert(ovec.end(), i->second.begin(), i->second.end());
+ }
+ }
+};
+
+
/* Encapsulates PG recovery process */
class PeeringState : public MissingLoc::MappingInfo {
public:
virtual ~PeeringListener() {}
};
- // [primary only] content recovery state
- struct BufferedRecoveryMessages {
- map<int, map<spg_t, pg_query_t> > query_map;
- map<int, vector<pair<pg_notify_t, PastIntervals> > > info_map;
- map<int, vector<pair<pg_notify_t, PastIntervals> > > notify_list;
- };
-
- struct PeeringCtx {
- map<int, map<spg_t, pg_query_t> > query_map;
- map<int, vector<pair<pg_notify_t, PastIntervals> > > info_map;
- map<int, vector<pair<pg_notify_t, PastIntervals> > > notify_list;
- ObjectStore::Transaction transaction;
- HBHandle* handle = nullptr;
-
- PeeringCtx() = default;
-
- void reset_transaction() {
- transaction = ObjectStore::Transaction();
- }
-
- void accept_buffered_messages(BufferedRecoveryMessages &m) {
- for (map<int, map<spg_t, pg_query_t> >::iterator i = m.query_map.begin();
- i != m.query_map.end();
- ++i) {
- map<spg_t, pg_query_t> &omap = query_map[i->first];
- for (map<spg_t, pg_query_t>::iterator j = i->second.begin();
- j != i->second.end();
- ++j) {
- omap[j->first] = j->second;
- }
- }
- for (map<int, vector<pair<pg_notify_t, PastIntervals> > >::iterator i
- = m.info_map.begin();
- i != m.info_map.end();
- ++i) {
- vector<pair<pg_notify_t, PastIntervals> > &ovec =
- info_map[i->first];
- ovec.reserve(ovec.size() + i->second.size());
- ovec.insert(ovec.end(), i->second.begin(), i->second.end());
- }
- for (map<int, vector<pair<pg_notify_t, PastIntervals> > >::iterator i
- = m.notify_list.begin();
- i != m.notify_list.end();
- ++i) {
- vector<pair<pg_notify_t, PastIntervals> > &ovec =
- notify_list[i->first];
- ovec.reserve(ovec.size() + i->second.size());
- ovec.insert(ovec.end(), i->second.begin(), i->second.end());
- }
- }
- };
-
private:
/**
* Wraps PeeringCtx to hide the difference between buffering messages to