]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: fix some scrubber-backend formatting 44941/head
authorRonen Friedman <rfriedma@redhat.com>
Tue, 8 Feb 2022 16:09:19 +0000 (16:09 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 24 Feb 2022 14:26:37 +0000 (14:26 +0000)
no code changes.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/PG.h
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/scrub_backend.cc

index 4cd845d43161ef64eb04e7b5baad168502e03554..f7266e4739c6b410700c96a5bc1ff4e40ea79203 100644 (file)
@@ -306,12 +306,12 @@ public:
     stats.objects_scrubbed = 0;
   }
 
-  void reset_objects_scrubbed() {
-    recovery_state.update_stats(
-      [=](auto &history, auto &stats) {
-  reset_objects_scrubbed(stats);
-  return true;
-      });
+  void reset_objects_scrubbed()
+  {
+    recovery_state.update_stats([=](auto& history, auto& stats) {
+      reset_objects_scrubbed(stats);
+      return true;
+    });
   }
 
   bool is_deleting() const {
index f1f0e295be0a08ae51d7d11d226b99b1807e8662..08afd79a7c2bd376851748dc22f56e80a15869ac 100644 (file)
@@ -1630,7 +1630,7 @@ void PgScrubber::scrub_finish()
         static_cast<int>(m_pg->cct->_conf->osd_scrub_auto_repair_num_errors)) {
 
     dout(10) << __func__ << " undoing the repair" << dendl;
-    state_clear(PG_STATE_REPAIR); // not expected to be set, anyway
+    state_clear(PG_STATE_REPAIR);  // not expected to be set, anyway
     m_is_repair = false;
     update_op_mode_text();
   }
index 0a724e8dc7b3f7c8a6a4f3bd4f65ec75179c2d37..505428960aed536ebf095cc88be821cd17426a72 100644 (file)
@@ -386,25 +386,24 @@ int ScrubBackend::scrub_process_inconsistent()
 
   for (const auto& [hobj, shrd_list] : m_auth_peers) {
 
-      auto missing_entry = m_missing.find(hobj);
+    auto missing_entry = m_missing.find(hobj);
 
-      if (missing_entry != m_missing.end()) {
-        repair_object(hobj, shrd_list, missing_entry->second);
-        fixed_cnt += missing_entry->second.size();
-      }
+    if (missing_entry != m_missing.end()) {
+      repair_object(hobj, shrd_list, missing_entry->second);
+      fixed_cnt += missing_entry->second.size();
+    }
 
-      if (m_inconsistent.count(hobj)) {
-        repair_object(hobj, shrd_list, m_inconsistent[hobj]);
-        fixed_cnt += m_inconsistent[hobj].size();
-      }
+    if (m_inconsistent.count(hobj)) {
+      repair_object(hobj, shrd_list, m_inconsistent[hobj]);
+      fixed_cnt += m_inconsistent[hobj].size();
     }
+  }
   return fixed_cnt;
 }
 
-void ScrubBackend::repair_object(
-  const hobject_t& soid,
-  const auth_peers_t& ok_peers,
-  const set<pg_shard_t>& bad_peers)
+void ScrubBackend::repair_object(const hobject_t& soid,
+                                 const auth_peers_t& ok_peers,
+                                 const set<pg_shard_t>& bad_peers)
 {
   if (g_conf()->subsys.should_gather<ceph_subsys_osd, 20>()) {
     // log the good peers
@@ -506,9 +505,9 @@ auth_selection_t ScrubBackend::select_auth_object(const hobject_t& ho,
                << dendl;
     }
 
-    dout(20) << fmt::format(
-                  "{}: {} shard {} got:{:D}", __func__, ho, l, shard_ret)
-             << dendl;
+    dout(20)
+      << fmt::format("{}: {} shard {} got:{:D}", __func__, ho, l, shard_ret)
+      << dendl;
 
     if (shard_ret.possible_auth == shard_as_auth_t::usable_t::not_usable) {
 
@@ -542,11 +541,11 @@ auth_selection_t ScrubBackend::select_auth_object(const hobject_t& ho,
            dcount(shard_ret.oi) > dcount(ret_auth.auth_oi))) {
 
         dout(30) << fmt::format("{}: using {} moved auth oi {:p} <-> {:p}",
-                                      __func__,
-                                      l,
-                                      (void*)&ret_auth.auth_oi,
-                                      (void*)&shard_ret.oi)
-                     << dendl;
+                                __func__,
+                                l,
+                                (void*)&ret_auth.auth_oi,
+                                (void*)&shard_ret.oi)
+                 << dendl;
 
         ret_auth.auth = shard_ret.auth_iter;
         ret_auth.auth_shard = ret_auth.auth->first;
@@ -702,13 +701,13 @@ shard_as_auth_t ScrubBackend::possible_auth_shard(const hobject_t& obj,
       }
     } else {
       // debug@dev only
-      dout(30)
-        << fmt::format("{} missing snap addr: {:p} shard_info: {:p} er: {:x}",
-                       __func__,
-                       (void*)&smap_obj,
-                       (void*)&shard_info,
-                       shard_info.errors)
-        << dendl;
+      dout(30) << fmt::format(
+                    "{} missing snap addr: {:p} shard_info: {:p} er: {:x}",
+                    __func__,
+                    (void*)&smap_obj,
+                    (void*)&shard_info,
+                    shard_info.errors)
+               << dendl;
     }
   }
 
@@ -817,7 +816,8 @@ void ScrubBackend::compare_smaps()
                 });
 }
 
-std::optional<std::string> ScrubBackend::compare_obj_in_maps(const hobject_t& ho)
+std::optional<std::string> ScrubBackend::compare_obj_in_maps(
+  const hobject_t& ho)
 {
   // clear per-object data:
   this_chunk->cur_inconsistent.clear();
@@ -836,10 +836,12 @@ std::optional<std::string> ScrubBackend::compare_obj_in_maps(const hobject_t& ho
   if (!auth_res.is_auth_available) {
     // no auth selected
     object_error.set_version(0);
-    object_error.set_auth_missing(
-      ho, this_chunk->received_maps, auth_res.shard_map,
-      this_chunk->m_error_counts.shallow_errors,
-      this_chunk->m_error_counts.deep_errors, m_pg_whoami);
+    object_error.set_auth_missing(ho,
+                                  this_chunk->received_maps,
+                                  auth_res.shard_map,
+                                  this_chunk->m_error_counts.shallow_errors,
+                                  this_chunk->m_error_counts.deep_errors,
+                                  m_pg_whoami);
 
     if (object_error.has_deep_errors()) {
       this_chunk->m_error_counts.deep_errors++;
@@ -876,8 +878,11 @@ std::optional<std::string> ScrubBackend::compare_obj_in_maps(const hobject_t& ho
 
     // At this point auth_list is populated, so we add the object error
     // shards as inconsistent.
-    inconsistents(
-      ho, auth_object, auth_res.auth_oi, std::move(*opt_ers), errstream);
+    inconsistents(ho,
+                  auth_object,
+                  auth_res.auth_oi,
+                  std::move(*opt_ers),
+                  errstream);
   } else {
 
     // both the auth & errs containers are empty
@@ -1548,11 +1553,8 @@ void ScrubBackend::scrub_snapshot_metadata(ScrubMap& map)
 
       // Log any clones we were expecting to be there up to target
       // This will set missing, but will be a no-op if snap.soid == *curclone.
-      missing += process_clones_to(head,
-                                   snapset,
-                                   target,
-                                   &curclone,
-                                   head_error);
+      missing +=
+        process_clones_to(head, snapset, target, &curclone, head_error);
     }
 
     bool expected;
@@ -1591,9 +1593,7 @@ void ScrubBackend::scrub_snapshot_metadata(ScrubMap& map)
     if (soid.has_snapset()) {
 
       if (missing) {
-        log_missing(missing,
-                    head,
-                    __func__);
+        log_missing(missing, head, __func__);
       }
 
       // Save previous head error information
@@ -1720,11 +1720,8 @@ void ScrubBackend::scrub_snapshot_metadata(ScrubMap& map)
     dout(10) << __func__ << " " << m_mode_desc << " " << m_pg_id
              << " No more objects while processing " << *head << dendl;
 
-    missing += process_clones_to(head,
-                                 snapset,
-                                 all_clones,
-                                 &curclone,
-                                 head_error);
+    missing +=
+      process_clones_to(head, snapset, all_clones, &curclone, head_error);
   }
 
   // There could be missing found by the test above or even
@@ -1846,7 +1843,6 @@ std::vector<snap_mapper_fix_t> ScrubBackend::scan_snaps(
       if (maybe_fix_order) {
         out_orders.push_back(std::move(*maybe_fix_order));
       }
-
     }
   }
 
@@ -1878,7 +1874,7 @@ std::optional<snap_mapper_fix_t> ScrubBackend::scan_object_snaps(
   if (r == -ENOENT || cur_snaps != obj_snaps) {
 
     // add this object to the list of snapsets that needs fixing. Note
-    // that we also collect the existing (bogus) list, as legacy log lines show those
+    // that we also collect the existing (bogus) list, for logging purposes
     snap_mapper_op_t fixing_op =
       (r == -ENOENT ? snap_mapper_op_t::add : snap_mapper_op_t::update);
     return snap_mapper_fix_t{fixing_op, hoid, obj_snaps, cur_snaps};