fix(ecstore): invalidate xl.meta cache after writes and rename (#2255)

This commit is contained in:
weisd
2026-03-22 11:30:29 +08:00
committed by GitHub
parent 8b4e5b2540
commit a42320848c
3 changed files with 194 additions and 1 deletions
+7 -1
View File
@@ -891,7 +891,10 @@ impl LocalDisk {
check_path_length(file_path.to_string_lossy().as_ref())?;
self.write_all_internal(&file_path, InternalBuf::Owned(buf), sync, skip_parent)
.await
.await?;
get_global_file_cache().invalidate(&file_path).await;
Ok(())
}
// write_all_internal do write file
async fn write_all_internal(&self, file_path: &Path, data: InternalBuf<'_>, sync: bool, skip_parent: &Path) -> Result<()> {
@@ -2122,6 +2125,9 @@ impl DiskAPI for LocalDisk {
return Err(err);
}
get_global_file_cache().invalidate(&src_file_path).await;
get_global_file_cache().invalidate(&dst_file_path).await;
if let Some(src_file_path_parent) = src_file_path.parent() {
if src_volume != super::RUSTFS_META_MULTIPART_BUCKET {
let _ = remove_std(src_file_path_parent);