From 420baf5035dae8eeea9f9ed81e2dece88cf674c4 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 25 Oct 2024 13:30:44 +0300 Subject: [PATCH] api: Make get_highest_supported_sstable_version use proper service This endpoint now grabs one via database -> table -> sstables manager chain, but there's shorter route, namely via sstables format selector. Signed-off-by: Pavel Emelyanov --- api/system.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/system.cc b/api/system.cc index 58558356e6..66d004f3aa 100644 --- a/api/system.cc +++ b/api/system.cc @@ -10,7 +10,7 @@ #include "api/api-doc/system.json.hh" #include "api/api-doc/metrics.json.hh" #include "replica/database.hh" -#include "sstables/sstables_manager.hh" +#include "db/sstables-format-selector.hh" #include #include @@ -186,9 +186,10 @@ void set_system(http_context& ctx, routes& r) { } void set_format_selector(http_context& ctx, routes& r, db::sstables_format_selector& sel) { - hs::get_highest_supported_sstable_version.set(r, [&ctx] (const_req req) { - auto& table = ctx.db.local().find_column_family("system", "local"); - return seastar::to_sstring(table.get_sstables_manager().get_highest_supported_format()); + hs::get_highest_supported_sstable_version.set(r, [&sel] (std::unique_ptr req) { + return smp::submit_to(0, [&sel] { + return make_ready_future(seastar::to_sstring(sel.selected_format())); + }); }); }