From 1bb364b5bcf98d6f1aef3d7aad701f6c4e2f86a9 Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Mon, 7 Mar 2022 09:26:10 +0300 Subject: [PATCH] Address code review issues --- pageserver/src/config.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pageserver/src/config.rs b/pageserver/src/config.rs index d6fdb93106..f6c51bb4b8 100644 --- a/pageserver/src/config.rs +++ b/pageserver/src/config.rs @@ -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 BuilderValue { 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(()) }