diff --git a/db/virtual_tables.cc b/db/virtual_tables.cc index 40dc637fc8..46a99b002c 100644 --- a/db/virtual_tables.cc +++ b/db/virtual_tables.cc @@ -165,7 +165,7 @@ public: }); } - future<> emit_ring(result_collector& result, const dht::decorated_key& dk, const sstring& table_name, std::vector ranges) { + future<> emit_ring(result_collector& result, const dht::decorated_key& dk, const sstring& table_name, utils::chunked_vector ranges) { co_await result.emit_partition_start(dk); std::ranges::sort(ranges, std::ranges::less(), std::mem_fn(&dht::token_range_endpoints::_start_token)); @@ -219,11 +219,11 @@ public: co_return; } const auto& table_name = table->schema()->cf_name(); - std::vector ranges = co_await _ss.describe_ring_for_table(e.name, table_name); + utils::chunked_vector ranges = co_await _ss.describe_ring_for_table(e.name, table_name); co_await emit_ring(result, e.key, table_name, std::move(ranges)); }); } else { - std::vector ranges = co_await _ss.describe_ring(e.name); + utils::chunked_vector ranges = co_await _ss.describe_ring(e.name); co_await emit_ring(result, e.key, "", std::move(ranges)); } } diff --git a/locator/util.cc b/locator/util.cc index dce81b7190..17474179d3 100644 --- a/locator/util.cc +++ b/locator/util.cc @@ -95,9 +95,9 @@ get_range_to_address_map(locator::effective_replication_map_ptr erm) { return get_range_to_address_map(erm, erm->get_token_metadata_ptr()->sorted_tokens()); } -future> +future> describe_ring(const replica::database& db, const gms::gossiper& gossiper, const sstring& keyspace, bool include_only_local_dc) { - std::vector ranges; + utils::chunked_vector ranges; auto erm = db.find_keyspace(keyspace).get_vnode_effective_replication_map(); std::unordered_map range_to_address_map = co_await ( diff --git a/locator/util.hh b/locator/util.hh index c66e400680..8f2f749392 100644 --- a/locator/util.hh +++ b/locator/util.hh @@ -12,6 +12,7 @@ #include "dht/i_partitioner_fwd.hh" #include "inet_address_vectors.hh" #include "locator/abstract_replication_strategy.hh" +#include "utils/chunked_vector.hh" namespace replica { class database; @@ -22,7 +23,7 @@ namespace gms { } namespace locator { - future> describe_ring(const replica::database& db, const gms::gossiper& gossiper, const sstring& keyspace, bool include_only_local_dc = false); + future> describe_ring(const replica::database& db, const gms::gossiper& gossiper, const sstring& keyspace, bool include_only_local_dc = false); future> get_range_to_address_map( locator::effective_replication_map_ptr erm, const std::vector& sorted_tokens); } \ No newline at end of file diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index 0bbbcef01c..044844cdbf 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -6965,7 +6965,7 @@ locator::token_metadata_ptr storage_proxy::get_token_metadata_ptr() const noexce return _shared_token_metadata.get(); } -future> storage_proxy::describe_ring(const sstring& keyspace, bool include_only_local_dc) const { +future> storage_proxy::describe_ring(const sstring& keyspace, bool include_only_local_dc) const { return locator::describe_ring(_db.local(), _remote->gossiper(), keyspace, include_only_local_dc); } diff --git a/service/storage_proxy.hh b/service/storage_proxy.hh index b969bf67c1..241d346e47 100644 --- a/service/storage_proxy.hh +++ b/service/storage_proxy.hh @@ -245,7 +245,7 @@ public: // using gossip and by passing the information in each MUTATION_DONE rpc call response. db::view::update_backlog get_backlog_of(locator::host_id) const; - future> describe_ring(const sstring& keyspace, bool include_only_local_dc = false) const; + future> describe_ring(const sstring& keyspace, bool include_only_local_dc = false) const; private: distributed& _db; diff --git a/service/storage_service.cc b/service/storage_service.cc index 80332518e0..fdc2f5119c 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -5385,7 +5385,7 @@ future<> storage_service::move(token new_token) { }); } -future> +future> storage_service::describe_ring(const sstring& keyspace, bool include_only_local_dc) const { if (_db.local().find_keyspace(keyspace).uses_tablets()) { throw std::runtime_error(fmt::format("The keyspace {} has tablet table. Query describe_ring with the table parameter!", keyspace)); @@ -5393,7 +5393,7 @@ storage_service::describe_ring(const sstring& keyspace, bool include_only_local_ co_return co_await locator::describe_ring(_db.local(), _gossiper, keyspace, include_only_local_dc); } -future> +future> storage_service::describe_ring_for_table(const sstring& keyspace_name, const sstring& table_name) const { slogger.debug("describe_ring for table {}.{}", keyspace_name, table_name); auto& t = _db.local().find_column_family(keyspace_name, table_name); @@ -5405,7 +5405,7 @@ storage_service::describe_ring_for_table(const sstring& keyspace_name, const sst auto erm = t.get_effective_replication_map(); auto& tmap = erm->get_token_metadata_ptr()->tablets().get_tablet_map(tid); const auto& topology = erm->get_topology(); - std::vector ranges; + utils::chunked_vector ranges; co_await tmap.for_each_tablet([&] (locator::tablet_id id, const locator::tablet_info& info) -> future<> { auto range = tmap.get_token_range(id); auto& replicas = info.replicas; diff --git a/service/storage_service.hh b/service/storage_service.hh index 112c401d70..d43b0e86a3 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -467,9 +467,9 @@ public: */ //std::vector describeRingJMX(const sstring& keyspace) const { - future> describe_ring(const sstring& keyspace, bool include_only_local_dc = false) const; + future> describe_ring(const sstring& keyspace, bool include_only_local_dc = false) const; - future> describe_ring_for_table(const sstring& keyspace_name, const sstring& table_name) const; + future> describe_ring_for_table(const sstring& keyspace_name, const sstring& table_name) const; /** * Retrieve a map of tokens to endpoints, including the bootstrapping ones.