]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: restrict async_recovery_targets to up osds 22664/head
authorNeha Ojha <nojha@redhat.com>
Wed, 20 Jun 2018 17:20:58 +0000 (13:20 -0400)
committerNeha Ojha <nojha@redhat.com>
Thu, 21 Jun 2018 18:16:47 +0000 (14:16 -0400)
When an osd that is part of the acting set and not the up set, gets chosen
as an async_recovery_target, it gets removed from the acting set. Since this
osd is no longer in the up or acting set, it is classified as a stray in
the next peering cycle. This results in choose_acting() looping between two
proposed acting sets.

To avoid this, we will only choose up osds as async_recovery_targets.

Signed-off-by: Neha Ojha <nojha@redhat.com>
src/osd/PG.cc

index d2a8220fd327d627b3b0674543f28b8dded4f218..70b7184ad65ac7a2480a9330b0b7b3cfafd9ab9d 100644 (file)
@@ -1514,6 +1514,12 @@ void PG::choose_async_recovery_ec(const map<pg_shard_t, pg_info_t> &all_info,
     // do not include strays
     if (stray_set.find(shard_i) != stray_set.end())
       continue;
+    // Do not include an osd that is not up, since choosing it as
+    // an async_recovery_target will move it out of the acting set.
+    // This results in it being identified as a stray during peering,
+    // because it is no longer in the up or acting set.
+    if (!is_up(shard_i))
+      continue;
     auto shard_info = all_info.find(shard_i)->second;
     // for ec pools we rollback all entries past the authoritative
     // last_update *before* activation. This is relatively inexpensive
@@ -1556,6 +1562,12 @@ void PG::choose_async_recovery_replicated(const map<pg_shard_t, pg_info_t> &all_
     // do not include strays
     if (stray_set.find(shard_i) != stray_set.end())
       continue;
+    // Do not include an osd that is not up, since choosing it as
+    // an async_recovery_target will move it out of the acting set.
+    // This results in it being identified as a stray during peering,
+    // because it is no longer in the up or acting set.
+    if (!is_up(shard_i))
+      continue;
     auto shard_info = all_info.find(shard_i)->second;
     // use the approximate magnitude of the difference in length of
     // logs as the cost of recovery