]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PGLog: set acceptable rollback_info_trimmed_to for pg of replicated pool 42445/head
authorMingxin Liu <mingxin@xsky.com>
Thu, 22 Jul 2021 04:21:53 +0000 (12:21 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 26 Jul 2021 03:58:11 +0000 (11:58 +0800)
if this PG belongs to a replica pool, since replica pool does not
require rollback, see `pg_pool_t::require_rollback()`, we don't
update the omap entry for noting down the
`on_disk_rollback_info_trimmed_to`. see
`PGLog::_write_log_and_missing()` and `PGLog::_write_log_and_missing()`.
in this case, `read_log_and_missing()` should not be able to find
the value for "rollback_info_trimmed_to" in the omap entries.

because `roll_foward_to()` replays all entries starting at
`rollback_info_trimmed_to`, if it is empty, when the primary osd
is merging the pglog from its peers while peering, it would have
to walk through *all* pglog entries. this would incur unnecessary
overhead, and slows down the peering.

in this change, if this PG belongs to a replica pool, we just fast
forward it to `info.last_update` to avoid this overhead.

Signed-off-by: Mingxin Liu <mingxin@xsky.com>
src/osd/PGLog.cc
src/osd/PGLog.h

index be3f7414d69242ebc21ab01c6adb1cfe2f1803d6..c5e0a10ea962174a305e127c13f4d0372f2be09b 100644 (file)
@@ -1095,6 +1095,11 @@ namespace {
           return iter->next();
         });
       }).then([this] {
+        if (info.pgid.is_no_shard()) {
+          // replicated pool pg does not persist this key
+          assert(on_disk_rollback_info_trimmed_to == eversion_t());
+          on_disk_rollback_info_trimmed_to = info.last_update;
+        }
         log = PGLog::IndexedLog(
              info.last_update,
              info.log_tail,
index 920b40dabc1a225df354e5168449602b9e5b6fd1..25c88217c51cce1ddd35c7da9e58eeea2495b396 100644 (file)
@@ -1490,6 +1490,11 @@ public:
        }
       }
     }
+    if (info.pgid.is_no_shard()) {
+      // replicated pool pg does not persist this key
+      assert(on_disk_rollback_info_trimmed_to == eversion_t());
+      on_disk_rollback_info_trimmed_to = info.last_update;
+    }
     log = IndexedLog(
       info.last_update,
       info.log_tail,