]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: handle trim() during backfill
authorNeha Ojha <nojha@redhat.com>
Mon, 16 Jul 2018 23:31:22 +0000 (16:31 -0700)
committerNeha Ojha <nojha@redhat.com>
Fri, 18 Jan 2019 19:06:13 +0000 (14:06 -0500)
Remove async recovery components: The async recovery feature is not present
in luminous. We do not need commit 22d17fb5aad6ab9d7525d9492c0e96a36d02879e,
which adds a flag to remember async recovery. We have also removed async
recovery requirements from this commit and modified the commit message to
only reflect backfill.

Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit e538c31f0f3133f811a8e478fcb25b575cad66bf)

src/osd/PG.cc
src/osd/PGLog.cc
src/osd/PGLog.h

index cc80ff3b98031b845931d3e24affc2873b9091ff..443d8c4860e59720771812cd8a9fdd17e915e0df 100644 (file)
@@ -3460,7 +3460,12 @@ void PG::append_log(
 
   dout(10) << __func__ << " approx pg log length =  "
            << pg_log.get_log().approx_size() << dendl;
-  pg_log.trim(trim_to, info);
+  dout(10) << __func__ << " transaction_applied = "
+           << transaction_applied << dendl;
+  if (!transaction_applied)
+    dout(10) << __func__ << " " << pg_whoami
+             << " is backfill target" << dendl;
+  pg_log.trim(trim_to, info, transaction_applied);
 
   // update the local pg, pg log
   dirty_info = true;
index 80e159308499fb1b7acb25c2e0202e37110814f5..8148f57a152c5bdbf91cec637eadb2e551a98431 100644 (file)
@@ -162,13 +162,15 @@ void PGLog::clear_info_log(
 
 void PGLog::trim(
   eversion_t trim_to,
-  pg_info_t &info)
+  pg_info_t &info,
+  bool transaction_applied)
 {
   dout(10) << __func__ << " proposed trim_to = " << trim_to << dendl;
   // trim?
   if (trim_to > log.tail) {
-    // We shouldn't be trimming the log past last_complete
-    assert(trim_to <= info.last_complete);
+    // Don't assert for backfill_targets
+    if (transaction_applied)
+      assert(trim_to <= info.last_complete);
 
     dout(10) << "trim " << log << " to " << trim_to << dendl;
     log.trim(cct, trim_to, &trimmed, &trimmed_dups, &write_from_dups);
index 7253936ddcfa6f718258647d9590fed3222e92c7..6f85ee1f1a5505cc6585c0d1b55332f810cabbea 100644 (file)
@@ -705,7 +705,8 @@ public:
 
   void trim(
     eversion_t trim_to,
-    pg_info_t &info);
+    pg_info_t &info,
+    bool transaction_applied = true);
 
   void roll_forward_to(
     eversion_t roll_forward_to,