From 0d5d3d1a30685e7c47173b974caa12076c43a9c4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Apr 2014 16:01:28 -0700 Subject: [PATCH] PG: only complete replicas should count toward min_size Backport: emperor,dumpling,cuttlefish Fixes: #7805 Signed-off-by: Samuel Just Signed-off-by: Sage Weil --- src/osd/PG.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 66329b3442d9f..0f6a597b56ace 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1011,7 +1011,20 @@ bool PG::choose_acting(int& newest_update_osd) return false; } - if (want.size() < pool.info.min_size) { + unsigned complete = 0; + for (vector::iterator i = want.begin(); + i != want.end(); + ++i) { + if (*i == osd->whoami) { + if (!info.is_incomplete()) + ++complete; + } else { + assert(peer_info.count(*i)); + if (!peer_info[*i].is_incomplete()) + ++complete; + } + } + if (complete < pool.info.min_size) { want_acting.clear(); return false; } -- 2.39.5