]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: assume an octopus+ osd peer
authorKefu Chai <kchai@redhat.com>
Tue, 23 Feb 2021 05:40:16 +0000 (13:40 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 24 Feb 2021 05:24:46 +0000 (13:24 +0800)
no need to handle cases talking to pre-nautilus osd peers in a post
quincy era.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/ReplicatedBackend.cc

index 2fa3c40f91f18ce3fd98c17aa868aac106b728a6..2bcc5a75913147127484f61918a38f856953718d 100644 (file)
@@ -798,11 +798,8 @@ void PrimaryLogPG::maybe_force_recovery()
 
 bool PrimaryLogPG::check_laggy(OpRequestRef& op)
 {
-  if (!HAVE_FEATURE(recovery_state.get_min_upacting_features(),
-                   SERVER_OCTOPUS)) {
-    dout(20) << __func__ << " not all upacting has SERVER_OCTOPUS" << dendl;
-    return true;
-  }
+  assert(HAVE_FEATURE(recovery_state.get_min_upacting_features(),
+                     SERVER_OCTOPUS));
   if (state_test(PG_STATE_WAIT)) {
     dout(10) << __func__ << " PG is WAIT state" << dendl;
   } else if (!state_test(PG_STATE_LAGGY)) {
@@ -833,10 +830,8 @@ bool PrimaryLogPG::check_laggy(OpRequestRef& op)
 
 bool PrimaryLogPG::check_laggy_requeue(OpRequestRef& op)
 {
-  if (!HAVE_FEATURE(recovery_state.get_min_upacting_features(),
-                   SERVER_OCTOPUS)) {
-    return true;
-  }
+  assert(HAVE_FEATURE(recovery_state.get_min_upacting_features(),
+                     SERVER_OCTOPUS));
   if (!state_test(PG_STATE_WAIT) && !state_test(PG_STATE_LAGGY)) {
     return true; // not laggy
   }
index 3967ac56638a39a8e9a0dacc82567e1425f43368..1aa3ba149b2c2cf9c4c08c6598a60b3dcd1221c4 100644 (file)
@@ -1195,13 +1195,12 @@ void ReplicatedBackend::calc_head_subsets(
   if (size)
     data_subset.insert(0, size);
 
-  if (HAVE_FEATURE(parent->min_peer_features(), SERVER_OCTOPUS)) {
-    const auto it = missing.get_items().find(head);
-    assert(it != missing.get_items().end());
-    data_subset.intersection_of(it->second.clean_regions.get_dirty_regions());
-    dout(10) << "calc_head_subsets " << head
-             << " data_subset " << data_subset << dendl;
-  }
+  assert(HAVE_FEATURE(parent->min_peer_features(), SERVER_OCTOPUS));
+  const auto it = missing.get_items().find(head);
+  assert(it != missing.get_items().end());
+  data_subset.intersection_of(it->second.clean_regions.get_dirty_regions());
+  dout(10) << "calc_head_subsets " << head
+          << " data_subset " << data_subset << dendl;
 
   if (get_parent()->get_pool().allow_incomplete_clones()) {
     dout(10) << __func__ << ": caching (was) enabled, skipping clone subsets" << dendl;
@@ -1434,8 +1433,8 @@ void ReplicatedBackend::prepare_pull(
     // pulling head or unversioned object.
     // always pull the whole thing.
     recovery_info.copy_subset.insert(0, (uint64_t)-1);
-    if (HAVE_FEATURE(parent->min_peer_features(), SERVER_OCTOPUS))
-      recovery_info.copy_subset.intersection_of(missing_iter->second.clean_regions.get_dirty_regions());
+    assert(HAVE_FEATURE(parent->min_peer_features(), SERVER_OCTOPUS));
+    recovery_info.copy_subset.intersection_of(missing_iter->second.clean_regions.get_dirty_regions());
     recovery_info.size = ((uint64_t)-1);
     recovery_info.object_exist = missing_iter->second.clean_regions.object_is_exist();
   }
@@ -1448,8 +1447,7 @@ void ReplicatedBackend::prepare_pull(
   op.recovery_info.soid = soid;
   op.recovery_info.version = v;
   op.recovery_progress.data_complete = false;
-  op.recovery_progress.omap_complete = !missing_iter->second.clean_regions.omap_is_dirty() 
-                                && HAVE_FEATURE(parent->min_peer_features(), SERVER_OCTOPUS);
+  op.recovery_progress.omap_complete = !missing_iter->second.clean_regions.omap_is_dirty();
   op.recovery_progress.data_recovered_to = 0;
   op.recovery_progress.first = true;
 
@@ -1576,8 +1574,7 @@ int ReplicatedBackend::prep_push(
   pi.recovery_info.ss = pop->recovery_info.ss;
   pi.recovery_info.version = version;
   pi.recovery_info.object_exist = missing_iter->second.clean_regions.object_is_exist();
-  pi.recovery_progress.omap_complete = !missing_iter->second.clean_regions.omap_is_dirty() &&
-    HAVE_FEATURE(parent->min_peer_features(), SERVER_OCTOPUS);
+  pi.recovery_progress.omap_complete = !missing_iter->second.clean_regions.omap_is_dirty();
   pi.lock_manager = std::move(lock_manager);
 
   ObjectRecoveryProgress new_progress;