mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-28 18:40:38 +00:00
pageserver: move page_service's import basebackup / import wal to mgmt API (#8292)
I want to fix bugs in `page_service` ([issue](https://github.com/neondatabase/neon/issues/7427)) and the `import basebackup` / `import wal` stand in the way / make the refactoring more complicated. We don't use these methods anyway in practice, but, there have been some objections to removing the functionality completely. So, this PR preserves the existing functionality but moves it into the HTTP management API. Note that I don't try to fix existing bugs in the code, specifically not fixing * it only ever worked correctly for unsharded tenants * it doesn't clean up on error All errors are mapped to `ApiError::InternalServerError`.
This commit is contained in:
committed by
Alex Chi Z
parent
35dac6e6c8
commit
bfc7338246
@@ -226,7 +226,7 @@ impl Node {
|
||||
fn is_fatal(e: &mgmt_api::Error) -> bool {
|
||||
use mgmt_api::Error::*;
|
||||
match e {
|
||||
ReceiveBody(_) | ReceiveErrorBody(_) => false,
|
||||
SendRequest(_) | ReceiveBody(_) | ReceiveErrorBody(_) => false,
|
||||
ApiError(StatusCode::SERVICE_UNAVAILABLE, _)
|
||||
| ApiError(StatusCode::GATEWAY_TIMEOUT, _)
|
||||
| ApiError(StatusCode::REQUEST_TIMEOUT, _) => false,
|
||||
|
||||
@@ -151,6 +151,10 @@ struct ServiceState {
|
||||
/// controller API.
|
||||
fn passthrough_api_error(node: &Node, e: mgmt_api::Error) -> ApiError {
|
||||
match e {
|
||||
mgmt_api::Error::SendRequest(e) => {
|
||||
// Presume errors sending requests are connectivity/availability issues
|
||||
ApiError::ResourceUnavailable(format!("{node} error sending request: {e}").into())
|
||||
}
|
||||
mgmt_api::Error::ReceiveErrorBody(str) => {
|
||||
// Presume errors receiving body are connectivity/availability issues
|
||||
ApiError::ResourceUnavailable(
|
||||
|
||||
Reference in New Issue
Block a user