pageserver: switch on new-style local layer paths (#7660)

We recently added support for local layer paths that contain a
generation number:
- https://github.com/neondatabase/neon/pull/7609
- https://github.com/neondatabase/neon/pull/7640

Now that we've cut a
[release](https://github.com/neondatabase/neon/pull/7735) that includes
those changes, we can proceed to enable writing the new format without
breaking forward compatibility.
This commit is contained in:
John Spray
2024-05-14 09:37:48 +01:00
committed by GitHub
parent cd0e344938
commit df0f1e359b
2 changed files with 7 additions and 11 deletions

View File

@@ -129,19 +129,16 @@ pub(crate) fn local_layer_path(
tenant_shard_id: &TenantShardId,
timeline_id: &TimelineId,
layer_file_name: &LayerName,
_generation: &Generation,
generation: &Generation,
) -> Utf8PathBuf {
let timeline_path = conf.timeline_path(tenant_shard_id, timeline_id);
timeline_path.join(layer_file_name.to_string())
// TODO: switch to enabling new-style layer paths after next release
// if generation.is_none() {
// // Without a generation, we may only use legacy path style
// timeline_path.join(layer_file_name.to_string())
// } else {
// timeline_path.join(format!("{}-v1{}", layer_file_name, generation.get_suffix()))
// }
if generation.is_none() {
// Without a generation, we may only use legacy path style
timeline_path.join(layer_file_name.to_string())
} else {
timeline_path.join(format!("{}-v1{}", layer_file_name, generation.get_suffix()))
}
}
impl Layer {

View File

@@ -703,7 +703,6 @@ def test_multi_attach(
workload.validate(pageservers[2].id)
@pytest.mark.skip(reason="To be enabled after release with new local path style")
def test_upgrade_generationless_local_file_paths(
neon_env_builder: NeonEnvBuilder,
):