Address code review issues

This commit is contained in:
Konstantin Knizhnik
2022-03-07 09:26:10 +03:00
committed by Anastasia Lubennikova
parent 7e6eff4969
commit 1bb364b5bc

View File

@@ -15,7 +15,7 @@ use zenith_utils::zid::{ZNodeId, ZTenantId, ZTimelineId};
use std::convert::TryInto;
use std::env;
use std::fs::OpenOptions;
use std::fs::{File, OpenOptions};
use std::io::Write;
use std::num::{NonZeroU32, NonZeroUsize};
use std::path::{Path, PathBuf};
@@ -193,6 +193,12 @@ impl<T> BuilderValue<T> {
bail!("Could not write all the metadata bytes in a single call");
}
file.sync_all()?;
let tenant_dir = File::open(
&path
.parent()
.expect("Tetant config should always have a parent dir"),
)?;
tenant_dir.sync_all()?;
Ok(())
}