From 9c93ee30027051cc0b4361821d52d247aef151db Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Sep 2015 10:26:25 -0400 Subject: [PATCH] osd: remove buggy [pool_]last_map_marked_full tracking This is buggy (we reset the pool epoch each time it remains full instead of only on the initial transition from non-full to full) and now unused. Signed-off-by: Sage Weil --- src/osd/OSD.cc | 25 ------------------------- src/osd/OSD.h | 3 +-- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 25343ed6a36fe..d954a1f8a2f34 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -6198,7 +6198,6 @@ void OSD::handle_osd_map(MOSDMap *m) ObjectStore::Transaction &t = *_t; // store new maps: queue for disk and put in the osdmap cache - epoch_t last_marked_full = 0; epoch_t start = MAX(osdmap->get_epoch() + 1, first); for (epoch_t e = start; e <= last; e++) { map::iterator p; @@ -6209,9 +6208,6 @@ void OSD::handle_osd_map(MOSDMap *m) bufferlist& bl = p->second; o->decode(bl); - if (o->test_flag(CEPH_OSDMAP_FULL)) - last_marked_full = e; - set_pool_last_map_marked_full(o, e); ghobject_t fulloid = get_osdmap_pobject_name(e); t.write(coll_t::meta(), fulloid, 0, bl.length(), bl); @@ -6243,10 +6239,6 @@ void OSD::handle_osd_map(MOSDMap *m) assert(0 == "bad fsid"); } - if (o->test_flag(CEPH_OSDMAP_FULL)) - last_marked_full = e; - set_pool_last_map_marked_full(o, e); - bufferlist fbl; o->encode(fbl, inc.encode_features | CEPH_FEATURE_RESERVED); @@ -6315,9 +6307,6 @@ void OSD::handle_osd_map(MOSDMap *m) superblock.oldest_map = first; superblock.newest_map = last; - if (last_marked_full > superblock.last_map_marked_full) - superblock.last_map_marked_full = last_marked_full; - map_lock.get_write(); // advance through the new maps @@ -8809,17 +8798,3 @@ void OSD::PeeringWQ::_dequeue(list *out) { } in_use.insert(got.begin(), got.end()); } - -void OSD::set_pool_last_map_marked_full(OSDMap *o, epoch_t &e) -{ - map &pool_last_map_marked_full = superblock.pool_last_map_marked_full; - for (map::const_iterator it = o->get_pools().begin(); - it != o->get_pools().end(); ++it) { - bool exist = pool_last_map_marked_full.count(it->first); - if (it->second.has_flag(pg_pool_t::FLAG_FULL) && !exist) - pool_last_map_marked_full[it->first] = e; - if (it->second.has_flag(pg_pool_t::FLAG_FULL) && - (exist && pool_last_map_marked_full.count(it->first) < e)) - pool_last_map_marked_full[it->first] = e; - } -} diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 539114861f3e7..4fa61d12e66b7 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1817,8 +1817,7 @@ private: void handle_osd_map(class MOSDMap *m); void note_down_osd(int osd); void note_up_osd(int osd); - void set_pool_last_map_marked_full(OSDMap *o, epoch_t &e); - + bool advance_pg( epoch_t advance_to, PG *pg, ThreadPool::TPHandle &handle, -- 2.39.5