mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-19 14:10:37 +00:00
don't start background jobs if tenant has not timelines
Before this change, test_pageserver_with_empty_tenants was failing at:
assert loaded_tenant["state"] == {
"Active": {"background_jobs_running": False}
}, "Tenant {tenant_with_empty_timelines_dir} with empty timelines dir should be active and ready for timeline creation"
because background_jobs_running was True instead of False.
Personally I think we should simply always start the background loops
and not bother, but let's punt this until after we've merged this PR.
This commit is contained in:
committed by
Dmitry Rodionov
parent
8aed805933
commit
decef74503
@@ -809,6 +809,9 @@ impl Tenant {
|
||||
// FIXME original collect_timeline_files contained one more check:
|
||||
// 1. "Timeline has no ancestor and no layer files"
|
||||
|
||||
// XXX get rid of enable_background_jobs
|
||||
let enable_background_jobs = sorted_timelines.len() > 0;
|
||||
|
||||
for (timeline_id, metadata) in sorted_timelines {
|
||||
// FIXME should we fail load of whole tenant if one timeline failed?
|
||||
// consider branch hierarchy. Maybe set one to broken and others to Paused or something
|
||||
@@ -818,7 +821,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.activate(true);
|
||||
self.activate(enable_background_jobs);
|
||||
|
||||
info!("Done");
|
||||
|
||||
|
||||
@@ -217,8 +217,9 @@ def test_pageserver_with_empty_tenants(
|
||||
env.pageserver.allowed_errors.append(
|
||||
".*marking .* as locally complete, while it doesnt exist in remote index.*"
|
||||
)
|
||||
env.pageserver.allowed_errors.append(".*Tenant .* has no timelines directory.*")
|
||||
env.pageserver.allowed_errors.append(".*No timelines to attach received.*")
|
||||
env.pageserver.allowed_errors.append(
|
||||
".*could not load tenant.*Failed to list timelines directory.*"
|
||||
)
|
||||
|
||||
client = env.pageserver.http_client()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user