Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin: return 503 on replication_error #6643

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/v/redpanda/admin_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -731,21 +731,22 @@ ss::future<> admin_server::throw_on_error(
throw ss::httpd::base_exception(
fmt::format("Timeout: {}", ec.message()),
ss::httpd::reply::status_type::gateway_timeout);
case cluster::errc::replication_error:
case cluster::errc::update_in_progress:
case cluster::errc::leadership_changed:
case cluster::errc::waiting_for_recovery:
case cluster::errc::no_leader_controller:
case cluster::errc::shutting_down:
throw ss::httpd::base_exception(
fmt::format("Not ready ({})", ec.message()),
fmt::format("Service unavailable ({})", ec.message()),
ss::httpd::reply::status_type::service_unavailable);
case cluster::errc::not_leader:
throw co_await redirect_to_leader(req, ntp);
case cluster::errc::not_leader_controller:
throw co_await redirect_to_leader(req, model::controller_ntp);
case cluster::errc::no_update_in_progress:
throw ss::httpd::bad_request_exception(
"can not cancel partition move operation as there is no move "
"Cannot cancel partition move operation as there is no move "
"in progress");
default:
throw ss::httpd::server_error_exception(
Expand Down