stop writing metadata file (#6769)

Building atop #6777, this PR removes the code that writes the `metadata`
file and adds a piece of migration code that removes any remaining
`metadata` files.

We'll remove the migration code after this PR has been deployed.

part of https://github.com/neondatabase/neon/issues/6663

More cleanups punted into follow-up issue, as they touch a lot of code: 
https://github.com/neondatabase/neon/issues/6890
This commit is contained in:
Christian Schwarz
2024-02-23 14:33:47 +01:00
committed by GitHub
parent 6f8f7c7de9
commit cd449d66ea
12 changed files with 95 additions and 270 deletions

View File

@@ -694,10 +694,8 @@ def test_empty_branch_remote_storage_upload_on_restart(neon_env_builder: NeonEnv
# index upload is now hitting the failpoint, it should block the shutdown
env.pageserver.stop(immediate=True)
local_metadata = (
env.pageserver.timeline_dir(env.initial_tenant, new_branch_timeline_id) / "metadata"
)
assert local_metadata.is_file()
timeline_dir = env.pageserver.timeline_dir(env.initial_tenant, new_branch_timeline_id)
assert timeline_dir.is_dir()
assert isinstance(env.pageserver_remote_storage, LocalFsStorage)

View File

@@ -130,7 +130,6 @@ FAILPOINTS = [
"timeline-delete-before-index-deleted-at",
"timeline-delete-before-rm",
"timeline-delete-before-index-delete",
"timeline-delete-after-rm-dir",
]
FAILPOINTS_BEFORE_BACKGROUND = [

View File

@@ -157,10 +157,7 @@ def switch_pg_to_new_pageserver(
timeline_to_detach_local_path = origin_ps.timeline_dir(tenant_id, timeline_id)
files_before_detach = os.listdir(timeline_to_detach_local_path)
assert (
"metadata" in files_before_detach
), f"Regular timeline {timeline_to_detach_local_path} should have the metadata file, but got: {files_before_detach}"
assert (
len(files_before_detach) >= 2
len(files_before_detach) >= 1
), f"Regular timeline {timeline_to_detach_local_path} should have at least one layer file, but got {files_before_detach}"
return timeline_to_detach_local_path

View File

@@ -136,12 +136,9 @@ DELETE_FAILPOINTS = [
"timeline-delete-before-index-deleted-at",
"timeline-delete-before-schedule",
"timeline-delete-before-rm",
"timeline-delete-during-rm",
"timeline-delete-after-rm",
"timeline-delete-before-index-delete",
"timeline-delete-after-index-delete",
"timeline-delete-after-rm-metadata",
"timeline-delete-after-rm-dir",
]
@@ -801,7 +798,7 @@ def test_timeline_delete_resumed_on_attach(
)
# failpoint before we remove index_part from s3
failpoint = "timeline-delete-during-rm"
failpoint = "timeline-delete-after-rm"
ps_http.configure_failpoints((failpoint, "return"))
env.pageserver.allowed_errors.extend(