From aa5dacc7a953ff3896fc4056642a3dc742ab0e51 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 17 Jun 2023 00:55:43 +0300 Subject: [PATCH] Do not start EC PGs without at least pg_data_size connections to old OSDs from each set --- src/osd_peering.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/osd_peering.cpp b/src/osd_peering.cpp index 27f9243d..45a23919 100644 --- a/src/osd_peering.cpp +++ b/src/osd_peering.cpp @@ -240,21 +240,20 @@ void osd_t::start_pg_peering(pg_t & pg) // (PG history is kept up to the latest active+clean state) for (auto & history_set: pg.target_history) { - bool found = true; + int nonzero = 0, found = 0; for (auto history_osd: history_set) { if (history_osd != 0) { - found = false; + nonzero++; if (history_osd == this->osd_num || msgr.osd_peer_fds.find(history_osd) != msgr.osd_peer_fds.end()) { - found = true; - break; + found++; } } } - if (!found) + if (found < (nonzero >= pg.pg_data_size ? pg.pg_data_size : 1)) { pg.state = PG_INCOMPLETE; report_pg_state(pg);