Merge pull request #6013 from neondatabase/releases/2023-12-01-hotfix

fix: use create_new instead of create for mutex file
This commit is contained in:
Joonas Koivunen
2023-12-01 15:35:56 +02:00
committed by GitHub

View File

@@ -3147,7 +3147,10 @@ impl Tenant {
let uninit_mark_path = self
.conf
.timeline_uninit_mark_file_path(tenant_id, timeline_id);
fs::File::create(&uninit_mark_path)
fs::OpenOptions::new()
.write(true)
.create_new(true)
.open(&uninit_mark_path)
.context("Failed to create uninit mark file")
.and_then(|_| {
crashsafe::fsync_file_and_parent(&uninit_mark_path)