From e5e40a31f4ce84a37f88aad2fe612d144fc55e6f Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 11 Oct 2022 14:48:04 +0300 Subject: [PATCH] Clean up terms "delete timeline" and "detach tenant". You cannot attach/detach an individual timeline, attach/detach always applies to the whole tenant. However, you can *delete* a single timeline from a tenant. Fix some comments and error messages that confused these two operations. --- pageserver/src/tenant.rs | 2 +- test_runner/regress/test_normal_work.py | 2 +- test_runner/regress/test_tenant_detach.py | 2 +- test_runner/regress/test_timeline_delete.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 31d4696a31..3dd2f92b5e 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -346,7 +346,7 @@ impl Tenant { ensure!( !children_exist, - "Cannot detach timeline which has child timelines" + "Cannot delete timeline which has child timelines" ); let timeline_entry = match timelines.entry(timeline_id) { Entry::Occupied(e) => e, diff --git a/test_runner/regress/test_normal_work.py b/test_runner/regress/test_normal_work.py index 002d697288..73918ee476 100644 --- a/test_runner/regress/test_normal_work.py +++ b/test_runner/regress/test_normal_work.py @@ -39,7 +39,7 @@ def test_normal_work(neon_env_builder: NeonEnvBuilder, num_timelines: int, num_s * restart compute * check that the data is there * stop compute - * detach timeline + * detach tenant Repeat check for several tenants/timelines. """ diff --git a/test_runner/regress/test_tenant_detach.py b/test_runner/regress/test_tenant_detach.py index f18e6867a9..a310eac1f7 100644 --- a/test_runner/regress/test_tenant_detach.py +++ b/test_runner/regress/test_tenant_detach.py @@ -70,7 +70,7 @@ def test_tenant_detach_smoke(neon_env_builder: NeonEnvBuilder): break # else is called if the loop finished without reaching "break" else: - pytest.fail(f"could not detach timeline: {last_error}") + pytest.fail(f"could not detach tenant: {last_error}") gc_thread.join(timeout=10) diff --git a/test_runner/regress/test_timeline_delete.py b/test_runner/regress/test_timeline_delete.py index 2eea8dd3cc..ac248c1b4b 100644 --- a/test_runner/regress/test_timeline_delete.py +++ b/test_runner/regress/test_timeline_delete.py @@ -32,7 +32,7 @@ def test_timeline_delete(neon_simple_env: NeonEnv): ps_http = env.pageserver.http_client() with pytest.raises( - NeonPageserverApiException, match="Cannot detach timeline which has child timelines" + NeonPageserverApiException, match="Cannot delete timeline which has child timelines" ): timeline_path = (