]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: construct log_keys_debug when reading pglog entries 37000/head
authorXuehan Xu <xxhdx1985126@gmail.com>
Sat, 5 Sep 2020 02:58:05 +0000 (10:58 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Sat, 5 Sep 2020 02:58:05 +0000 (10:58 +0800)
Fixes: https://tracker.ceph.com/issues/47226
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/osd/PGLog.h

index 89da871e9b8915e5471b0aca88cdbf9030ab7834..68075ca6d924ca384d5e44c771917a4f4e25f0fd 100644 (file)
@@ -1660,8 +1660,8 @@ public:
     ) {
     return read_log_and_missing_crimson(
       store, ch, info,
-      log, missing, pgmeta_oid,
-      this);
+      log, (pg_log_debug ? &log_keys_debug : nullptr),
+      missing, pgmeta_oid, this);
   }
 
   template <typename missing_type>
@@ -1670,6 +1670,7 @@ public:
     crimson::os::CollectionRef ch;
     const pg_info_t &info;
     IndexedLog &log;
+    std::set<std::string>* log_keys_debug = NULL;
     missing_type &missing;
     ghobject_t pgmeta_oid;
     const DoutPrefixProvider *dpp;
@@ -1727,6 +1728,8 @@ public:
          ceph_assert(last_e.version.epoch <= e.version.epoch);
        }
        entries.push_back(e);
+       if (log_keys_debug)
+         log_keys_debug->insert(e.get_key_name());
       }
     }
 
@@ -1767,6 +1770,7 @@ public:
     crimson::os::CollectionRef ch,
     const pg_info_t &info,
     IndexedLog &log,
+    std::set<std::string>* log_keys_debug,
     missing_type &missing,
     ghobject_t pgmeta_oid,
     const DoutPrefixProvider *dpp = nullptr
@@ -1775,7 +1779,8 @@ public:
                       << ch->get_cid()
                       << " " << pgmeta_oid << dendl;
     return (new FuturizedStoreLogReader<missing_type>{
-      store, ch, info, log, missing, pgmeta_oid, dpp})->start();
+      store, ch, info, log, log_keys_debug,
+      missing, pgmeta_oid, dpp})->start();
   }
 
 #endif