Skip to content

Commit

Permalink
r/admin_server: submit controller status request to correct shard
Browse files Browse the repository at this point in the history
Controller is instantiated on single shard, all controller requests
should be submitted to the correct shard.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv committed Jun 12, 2023
1 parent 0af15ca commit 0fedbf8
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/v/redpanda/admin_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4050,17 +4050,19 @@ void admin_server::register_debug_routes() {
seastar::httpd::debug_json::get_controller_status,
[this](std::unique_ptr<ss::http::request>)
-> ss::future<ss::json::json_return_type> {
return _controller->get_last_applied_offset().then(
[this](auto offset) {
using result_t = ss::httpd::debug_json::controller_status;
result_t ans;
ans.last_applied_offset = offset;
ans.start_offset = _controller->get_start_offset();
ans.committed_index = _controller->get_commited_index();
ans.dirty_offset = _controller->get_dirty_offset();
return ss::make_ready_future<ss::json::json_return_type>(
ss::json::json_return_type(ans));
});
return ss::smp::submit_to(cluster::controller_stm_shard, [this] {
return _controller->get_last_applied_offset().then(
[this](auto offset) {
using result_t = ss::httpd::debug_json::controller_status;
result_t ans;
ans.last_applied_offset = offset;
ans.start_offset = _controller->get_start_offset();
ans.committed_index = _controller->get_commited_index();
ans.dirty_offset = _controller->get_dirty_offset();
return ss::make_ready_future<ss::json::json_return_type>(
ss::json::json_return_type(ans));
});
});
});

register_route<user>(
Expand Down

0 comments on commit 0fedbf8

Please sign in to comment.