mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-30 19:40:39 +00:00
fix: use create_new instead of create for mutex file (#6012)
Using create_new makes the uninit marker work as a mutual exclusion primitive. Temporary hopefully.
This commit is contained in:
@@ -3239,7 +3239,10 @@ impl Tenant {
|
||||
let uninit_mark_path = self
|
||||
.conf
|
||||
.timeline_uninit_mark_file_path(tenant_shard_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)
|
||||
|
||||
Reference in New Issue
Block a user