diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 5647a0c345..6782209fcb 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -538,9 +538,7 @@ impl Tenant { // We're ready for business. // Change to active state under the hood spawns background loops // The loops will shut themselves down when they notice that the tenant is inactive. - self.set_state(TenantState::Active { - background_jobs_running: true, - }); + self.activate(true); info!("Done"); @@ -777,9 +775,7 @@ impl Tenant { // We're ready for business. // Change to active state under the hood spawns background loops // The loops will shut themselves down when they notice that the tenant is inactive. - self.set_state(TenantState::Active { - background_jobs_running: true, - }); + self.activate(true); info!("Done"); diff --git a/pageserver/src/tenant_mgr.rs b/pageserver/src/tenant_mgr.rs index 853447470c..c694671de5 100644 --- a/pageserver/src/tenant_mgr.rs +++ b/pageserver/src/tenant_mgr.rs @@ -307,10 +307,11 @@ pub fn create_tenant( hash_map::Entry::Vacant(v) => { let wal_redo_manager = Arc::new(PostgresRedoManager::new(conf, tenant_id)); create_tenant_files(conf, tenant_conf, tenant_id)?; - // TODO review, created in active state immediately, is it correctly? + // create tenant in Active state so it is possible to issue create_timeline + // request. Which on timeline activation will trigger tenant activation let tenant = Arc::new(Tenant::new( TenantState::Active { - background_jobs_running: true, + background_jobs_running: false, }, conf, tenant_conf,