From: Radoslaw Zarzynski Date: Tue, 1 Dec 2020 21:57:15 +0000 (+0100) Subject: crimson/test: make use of maybe_flush() in the backfill testing. X-Git-Tag: v16.1.0~346^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e59b91d89ef3aeeb0143953a63dec680f6bc1223;p=ceph.git crimson/test: make use of maybe_flush() in the backfill testing. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/test/crimson/test_backfill.cc b/src/test/crimson/test_backfill.cc index f196ee9c69d9..0c5b26379eb3 100644 --- a/src/test/crimson/test_backfill.cc +++ b/src/test/crimson/test_backfill.cc @@ -100,7 +100,8 @@ class BackfillFixture : public crimson::osd::BackfillState::BackfillListener { FakePrimary backfill_source; std::map backfill_targets; - + std::map>> enqueued_drops; std::deque< boost::intrusive_ptr< const boost::statechart::event_base>> events_to_dispatch; @@ -296,11 +297,17 @@ void BackfillFixture::enqueue_drop( const hobject_t& obj, const eversion_t& v) { - backfill_targets.at(target).store.drop(obj, v); + enqueued_drops[target].emplace_back(obj, v); } void BackfillFixture::maybe_flush() { + for (const auto& [target, versioned_objs] : enqueued_drops) { + for (const auto& [obj, v] : versioned_objs) { + backfill_targets.at(target).store.drop(obj, v); + } + } + enqueued_drops.clear(); } void BackfillFixture::update_peers_last_backfill(