From 7126fe4f5bd9e43507cbe4e6c5694bb068955b1e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 10 Dec 2008 14:50:16 -0800 Subject: [PATCH] osd: call peer() if we need up_thru to activate --- src/osd/OSD.cc | 5 ++++- src/osd/PG.cc | 4 ++++ src/osd/PG.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index f63ebf6a3aed7..603a7da6a1826 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2140,6 +2140,8 @@ void OSD::activate_map(ObjectStore::Transaction& t) map< int, map > query_map; // peer -> PG -> get_summary_since map info_map; // peer -> message + epoch_t up_thru = osdmap->get_up_thru(whoami); + // scan pg's for (hash_map::iterator it = pg_map.begin(); it != pg_map.end(); @@ -2154,7 +2156,8 @@ void OSD::activate_map(ObjectStore::Transaction& t) else if (pg->is_primary() && !pg->is_active()) { // i am (inactive) primary - if (!pg->is_peering()) + if (!pg->is_peering() || + (pg->need_up_thru && up_thru >= pg->info.history.same_since)) pg->peer(t, query_map, &info_map); } else if (pg->is_stray() && diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8e99007fe43d0..e92dc2d1b9283 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -918,6 +918,7 @@ void PG::clear_primary_state() peer_summary_requested.clear(); peer_info.clear(); peer_missing.clear(); + need_up_thru = false; finish_sync_event = 0; // so that _finish_recvoery doesn't go off in another thread @@ -1145,6 +1146,7 @@ void PG::peer(ObjectStore::Transaction& t, dout(10) << "up_thru " << osd->osdmap->get_up_thru(osd->whoami) << " < same_since " << info.history.same_since << ", must notify monitor" << dendl; + need_up_thru = true; osd->queue_want_up_thru(info.history.same_since); return; } else { @@ -1200,6 +1202,8 @@ void PG::activate(ObjectStore::Transaction& t, assert(info.last_complete >= log.bottom || log.backlog); + need_up_thru = false; + // write pg info, log write_info(t); write_log(t); diff --git a/src/osd/PG.h b/src/osd/PG.h index 8e7367e7b427c..6884b3a54c80a 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -628,6 +628,7 @@ protected: map peer_missing; set peer_log_requested; // logs i've requested (and start stamps) set peer_summary_requested; + bool need_up_thru; friend class OSD; -- 2.39.5