mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-18 13:40:37 +00:00
pageserver: only write out legacy tenant config if no generation (#6891)
## Problem Previously we always wrote out both legacy and modern tenant config files. The legacy write enabled rollbacks, but we are long past the point where that is needed. We still need the legacy format for situations where someone is running tenants without generations (that will be yanked as well eventually), but we can avoid writing it out at all if we do have a generation number set. We implicitly also avoid writing the legacy config if our mode is Secondary (secondary mode is newer than generations). ## Summary of changes - Make writing legacy tenant config conditional on there being no generation number set.
This commit is contained in:
committed by
Christian Schwarz
parent
936a00e077
commit
6f7f8958db
@@ -3812,7 +3812,7 @@ def pytest_addoption(parser: Parser):
|
||||
|
||||
|
||||
SMALL_DB_FILE_NAME_REGEX: re.Pattern = re.compile( # type: ignore[type-arg]
|
||||
r"config|config-v1|heatmap-v1|metadata|.+\.(?:toml|pid|json|sql|conf)"
|
||||
r"config-v1|heatmap-v1|metadata|.+\.(?:toml|pid|json|sql|conf)"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -299,8 +299,7 @@ def test_creating_tenant_conf_after_attach(neon_env_builder: NeonEnvBuilder):
|
||||
|
||||
# tenant is created with defaults, as in without config file
|
||||
(tenant_id, timeline_id) = env.neon_cli.create_tenant()
|
||||
config_path = env.pageserver.tenant_dir(tenant_id) / "config"
|
||||
assert config_path.exists(), "config file is always initially created"
|
||||
config_path = env.pageserver.tenant_dir(tenant_id) / "config-v1"
|
||||
|
||||
http_client = env.pageserver.http_client()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user