On tenant load, start WAL receivers only after all timelines have been loaded.

And similarly on attach. This way, if the tenant load/attach fails
halfway through, we don't have any leftover WAL receivers still
running on the broken tenant.
This commit is contained in:
Heikki Linnakangas
2022-11-24 15:49:04 +02:00
committed by Christian Schwarz
parent 0260ee23b9
commit dc9c33139b
2 changed files with 14 additions and 6 deletions

View File

@@ -44,7 +44,8 @@ impl TenantState {
/// A state of a timeline in pageserver's memory.
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum TimelineState {
/// Timeline is fully operational, its background jobs are running.
/// Timeline is fully operational. If the containing Tenant is Active, the timeline's
/// background jobs are running otherwise they will be launched when the tenant is activated.
Active,
/// A timeline is recognized by pageserver, but not yet ready to operate.
/// The status indicates, that the timeline could eventually go back to Active automatically: