From cfa2b2d3bcad8ebf0a94b89b3a27ce72445fc30a Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 11 Aug 2016 08:57:35 -0700 Subject: [PATCH] PG: introduce and maintain upset Signed-off-by: Samuel Just (cherry picked from commit 80a5c21d97116e7a66351a0e1f5d9b561f8663ac) --- src/osd/PG.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index 935e7444514f1..10b25a2009b30 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -476,7 +476,7 @@ public: pg_shard_t pg_whoami; pg_shard_t up_primary; vector up, acting, want_acting; - set actingbackfill, actingset; + set actingbackfill, actingset, upset; map peer_last_complete_ondisk; eversion_t min_last_complete_ondisk; // up: min over last_complete_ondisk, peer_last_complete_ondisk eversion_t pg_trim_to; @@ -2032,7 +2032,15 @@ public: acting[i], pool.info.ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD)); } + upset.clear(); up = newup; + for (uint8_t i = 0; i < up.size(); ++i) { + if (up[i] != CRUSH_ITEM_NONE) + upset.insert( + pg_shard_t( + up[i], + pool.info.ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD)); + } if (!pool.info.ec_pool()) { up_primary = pg_shard_t(new_up_primary, shard_id_t::NO_SHARD); primary = pg_shard_t(new_acting_primary, shard_id_t::NO_SHARD); -- 2.39.5