Restore data integrity guarantees: Content-MD5 validation, fsync durability, atomic metadata writes, concurrent write protection
This commit is contained in:
@@ -46,6 +46,8 @@ pub fn stream_to_file_with_md5(
|
||||
|
||||
py.check_signals()?;
|
||||
}
|
||||
file.sync_all()
|
||||
.map_err(|e| PyIOError::new_err(format!("Failed to fsync: {}", e)))?;
|
||||
Ok(())
|
||||
})();
|
||||
|
||||
@@ -102,6 +104,9 @@ pub fn assemble_parts_with_md5(
|
||||
}
|
||||
}
|
||||
|
||||
target.sync_all()
|
||||
.map_err(|e| PyIOError::new_err(format!("Failed to fsync: {}", e)))?;
|
||||
|
||||
Ok(format!("{:x}", hasher.finalize()))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user