]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fsck: warning (not error) by default on no per-pool omap
authorSage Weil <sage@redhat.com>
Thu, 8 Aug 2019 21:56:07 +0000 (16:56 -0500)
committerSage Weil <sage@redhat.com>
Thu, 8 Aug 2019 22:26:37 +0000 (17:26 -0500)
Unconditionally error if the global per_pool_omap was set, though!

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/os/bluestore/BlueStore.cc

index df13b12c80f53ca969d78e3bbfda75d3cecda3eb..be221c6593673f986b2b997eae3cdcd4709c4547 100644 (file)
@@ -1071,6 +1071,7 @@ OPTION(bluestore_debug_inject_csum_err_probability, OPT_FLOAT)
 OPTION(bluestore_no_per_pool_stats_tolerance, OPT_STR)
 OPTION(bluestore_warn_on_bluefs_spillover, OPT_BOOL)
 OPTION(bluestore_warn_on_legacy_statfs, OPT_BOOL)
+OPTION(bluestore_fsck_error_on_no_per_pool_omap, OPT_BOOL)
 OPTION(bluestore_log_op_age, OPT_DOUBLE)
 OPTION(bluestore_log_omap_iterator_age, OPT_DOUBLE)
 OPTION(bluestore_log_collection_list_age, OPT_DOUBLE)
index c6095a45922bb5bc733d7903fa8f2c630f84f4a2..7f107a4beb55ff77e7c7a9b64085f30a251f4177 100644 (file)
@@ -4864,6 +4864,10 @@ std::vector<Option> get_global_options() {
     .set_default(true)
     .set_description("Enable health indication on lack of per-pool statfs reporting from bluestore"),
 
+    Option("bluestore_fsck_error_on_no_per_pool_omap", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description("Make fsck error (instead of warn) when objects without per-pool omap are found"),
+
     Option("bluestore_log_op_age", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
     .set_default(5)
     .set_description("log operation if it's slower than this age (seconds)"),
index f88bb7b49ce4f0e1795b2a309162f2a63e054c63..9dad291300d6f84ca4519aaf6712c6201a90a17e 100644 (file)
@@ -7014,6 +7014,7 @@ int BlueStore::_fsck(bool deep, bool repair)
          << (repair ? " repair" : " check")
          << (deep ? " (deep)" : " (shallow)") << " start" << dendl;
   int64_t errors = 0;
+  int64_t warnings = 0;
   unsigned repaired = 0;
 
   typedef btree::btree_set<
@@ -7165,8 +7166,16 @@ int BlueStore::_fsck(bool deep, bool repair)
   }
 
   if (!per_pool_omap) {
-    derr << "fsck error: store not yet converted to per-pool omap" << dendl;
-    ++errors;
+    const char *w;
+    if (cct->_conf->bluestore_fsck_error_on_no_per_pool_omap) {
+      w = "error";
+      ++errors;
+    } else {
+      w = "warning";
+      ++warnings;
+    }
+    derr << "fsck " << w << ": store not yet converted to per-pool omap"
+        << dendl;
     if (repair) {
       repairer.fix_per_pool_omap(db);
     }
@@ -7501,11 +7510,23 @@ int BlueStore::_fsck(bool deep, bool repair)
        } else {
          m.insert(o->onode.nid);
        }
-       if (per_pool_omap &&
-           (!o->onode.is_perpool_omap() && !o->onode.is_pgmeta_omap())) {
-         derr << "fsck error: " << oid << " has omap that is not per-pool or pgmeta"
-              << dendl;
-         ++errors;
+       if (!o->onode.is_perpool_omap() && !o->onode.is_pgmeta_omap()) {
+         if (per_pool_omap) {
+           derr << "fsck error: " << oid
+                << " has omap that is not per-pool or pgmeta" << dendl;
+           ++errors;
+         } else {
+           const char *w;
+           if (cct->_conf->bluestore_fsck_error_on_no_per_pool_omap) {
+             ++errors;
+             w = "error";
+           } else {
+             ++warnings;
+             w = "warning";
+           }
+           derr << "fsck " << w << ": " << oid
+                << " has omap that is not per-pool or pgmeta" << dendl;
+         }
        }
        if (repair &&
            o->onode.has_omap() &&
@@ -8079,8 +8100,10 @@ int BlueStore::_fsck(bool deep, bool repair)
          << dendl;
 
   utime_t duration = ceph_clock_now() - start;
-  dout(1) << __func__ << " <<<FINISH>>> with " << errors << " errors, " << repaired
-         << " repaired, " << (errors - (int)repaired) << " remaining in "
+  dout(1) << __func__ << " <<<FINISH>>> with " << errors << " errors, "
+         << warnings << " warnings, "
+         << repaired << " repaired, "
+         << (errors + warnings - (int)repaired) << " remaining in "
          << duration << " seconds" << dendl;
   return errors - (int)repaired;
 }