mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-18 21:50:37 +00:00
clarifications around the QueueUninitialized error
This commit is contained in:
@@ -1404,7 +1404,16 @@ impl Tenant {
|
||||
|
||||
// Prevent new uploads from starting.
|
||||
if let Some(remote_client) = timeline.remote_client.as_ref() {
|
||||
remote_client.stop()?;
|
||||
let res = remote_client.stop();
|
||||
match &res {
|
||||
Ok(()) => {}
|
||||
Err(e) => match e {
|
||||
remote_timeline_client::StopError::QueueUninitialized => {
|
||||
// This could happen if the timeline is Broken, e.g., because it failed to fetch IndexPart when it was loaded.
|
||||
}
|
||||
},
|
||||
}
|
||||
res?;
|
||||
}
|
||||
|
||||
// Stop & wait for the remaining timeline tasks, including upload tasks.
|
||||
|
||||
@@ -264,7 +264,8 @@ pub enum MaybeDeletedIndexPart {
|
||||
/// Errors that can arise when calling [`RemoteTimelineClient::stop`].
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum StopError {
|
||||
/// Callers are responsible for checking this before calling `stop()`.
|
||||
/// Returned if the upload queue was never initialized.
|
||||
/// See [`RemoteTimelineClient::init_upload_queue`] and [`RemoteTimelineClient::init_upload_queue_for_empty_remote`].
|
||||
#[error("queue is not initialized")]
|
||||
QueueUninitialized,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user