From 98b54ca9489c547a5530d87a706b090494c5ccdc Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 21 Mar 2021 01:36:47 +0300 Subject: [PATCH] Don't try to "recover" misplaced objects if it would make them degraded --- src/osd_flush.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osd_flush.cpp b/src/osd_flush.cpp index bf0401ba..37ecc40b 100644 --- a/src/osd_flush.cpp +++ b/src/osd_flush.cpp @@ -231,7 +231,8 @@ bool osd_t::pick_next_recovery(osd_recovery_op_t &op) { for (auto pg_it = pgs.begin(); pg_it != pgs.end(); pg_it++) { - if ((pg_it->second.state & (PG_ACTIVE | PG_HAS_MISPLACED)) == (PG_ACTIVE | PG_HAS_MISPLACED)) + // Don't try to "recover" misplaced objects if "recovery" would make them degraded + if ((pg_it->second.state & (PG_ACTIVE | PG_DEGRADED | PG_HAS_MISPLACED)) == (PG_ACTIVE | PG_HAS_MISPLACED)) { for (auto obj_it = pg_it->second.misplaced_objects.begin(); obj_it != pg_it->second.misplaced_objects.end(); obj_it++) {