summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/osd/OSD.cc24
-rw-r--r--src/osd/OSD.h1
2 files changed, 24 insertions, 1 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index 75f84ede5bb..d0236e06419 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -4890,6 +4890,23 @@ void OSD::dispatch_context_transaction(PG::RecoveryCtx &ctx, PG *pg)
}
}
+bool OSD::compat_must_dispatch_immediately(PG *pg)
+{
+ assert(pg->is_locked());
+ for (vector<int>::iterator i = pg->acting.begin();
+ i != pg->acting.end();
+ ++i) {
+ if (*i == whoami)
+ continue;
+ ConnectionRef conn =
+ service.get_con_osd_cluster(*i, pg->get_osdmap()->get_epoch());
+ if (conn && !(conn->features & CEPH_FEATURE_INDEP_PG_MAP)) {
+ return true;
+ }
+ }
+ return false;
+}
+
void OSD::dispatch_context(PG::RecoveryCtx &ctx, PG *pg, OSDMapRef curmap)
{
do_notifies(*ctx.notify_list, curmap);
@@ -6160,7 +6177,12 @@ void OSD::process_peering_events(const list<PG*> &pgs)
rctx.on_applied->add(new C_CompleteSplits(this, split_pgs));
split_pgs.clear();
}
- dispatch_context_transaction(rctx, pg);
+ if (compat_must_dispatch_immediately(pg)) {
+ dispatch_context(rctx, pg, curmap);
+ rctx = create_context();
+ } else {
+ dispatch_context_transaction(rctx, pg);
+ }
pg->unlock();
}
if (need_up_thru)
diff --git a/src/osd/OSD.h b/src/osd/OSD.h
index 6576d7fdbda..8bab8a99059 100644
--- a/src/osd/OSD.h
+++ b/src/osd/OSD.h
@@ -969,6 +969,7 @@ protected:
// -- generic pg peering --
PG::RecoveryCtx create_context();
+ bool compat_must_dispatch_immediately(PG *pg);
void dispatch_context(PG::RecoveryCtx &ctx, PG *pg, OSDMapRef curmap);
void dispatch_context_transaction(PG::RecoveryCtx &ctx, PG *pg);
void do_notifies(map< int,vector<pair<pg_notify_t, pg_interval_map_t> > >& notify_list,