Skip to content

Commit

Permalink
pageserver: fix a 500 during timeline creation + shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp committed Jan 2, 2025
1 parent 8c7dcd2 commit 9ce7646
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2604,9 +2604,15 @@ impl Tenant {
WaitCompletionError::NotInitialized(
e, // If the queue is already stopped, it's a shutdown error.
) if e.is_stopping() => CreateTimelineError::ShuttingDown,
e => CreateTimelineError::Other(e.into()),
})
.context("wait for timeline initial uploads to complete")?;
WaitCompletionError::NotInitialized(_) => {
// This is a bug: we should never try to wait for uploads before initializing the timeline
debug_assert!(false);
CreateTimelineError::Other(anyhow::anyhow!("timeline not initialized"))
}
WaitCompletionError::UploadQueueShutDownOrStopped => {
CreateTimelineError::ShuttingDown
}
})?;

// The creating task is responsible for activating the timeline.
// We do this after `wait_completion()` so that we don't spin up tasks that start
Expand Down

0 comments on commit 9ce7646

Please sign in to comment.