From 5a49fe74bb780efeb2b36be8b389142954005696 Mon Sep 17 00:00:00 2001 From: Piotr Dulikowski Date: Wed, 24 Feb 2021 11:57:44 +0100 Subject: [PATCH] db/hints: add a metric for counting processed files Adds a field to `end_point_hints_manager::sender`: `_total_replayed_segments_count` which keeps track of how many segments were replayed so far. This metric will be used to calculate the sequence number of the last current hint segments in the queue - so that we can implement waiting for current segments to be replayed. --- db/hints/manager.cc | 1 + db/hints/manager.hh | 1 + 2 files changed, 2 insertions(+) diff --git a/db/hints/manager.cc b/db/hints/manager.cc index 55f296d980..8d4d5fb504 100644 --- a/db/hints/manager.cc +++ b/db/hints/manager.cc @@ -885,6 +885,7 @@ void manager::end_point_hints_manager::sender::send_hints_maybe() noexcept { } _segments_to_replay.pop_front(); ++replayed_segments_count; + ++_total_replayed_segments_count; } // Ignore exceptions, we will retry sending this file from where we left off the next time. diff --git a/db/hints/manager.hh b/db/hints/manager.hh index e037b8dd16..461b0cea90 100644 --- a/db/hints/manager.hh +++ b/db/hints/manager.hh @@ -153,6 +153,7 @@ public: seastar::scheduling_group _hints_cpu_sched_group; gms::gossiper& _gossiper; seastar::shared_mutex& _file_update_mutex; + uint64_t _total_replayed_segments_count = 0; public: sender(end_point_hints_manager& parent, service::storage_proxy& local_storage_proxy, database& local_db, gms::gossiper& local_gossiper) noexcept;