From: Neha Ojha Date: Mon, 16 Jul 2018 23:31:22 +0000 (-0700) Subject: osd: handle trim() during backfill X-Git-Tag: v12.2.9~134^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bdfc2a3b4fa8038ade31ccab5f5479508e9afff3;p=ceph.git osd: handle trim() during backfill 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 (cherry picked from commit e538c31f0f3133f811a8e478fcb25b575cad66bf) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 164d3a8b6a7..4a28d2dc2de 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3277,7 +3277,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; diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index 80e15930849..8148f57a152 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -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); diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 7253936ddcf..6f85ee1f1a5 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -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,