Skip to content

Commit

Permalink
Remove the temporary checksum feature
Browse files Browse the repository at this point in the history
Signed-off-by: Monthon Klongklaew <[email protected]>
  • Loading branch information
monthonk committed Jul 14, 2023
1 parent caeff99 commit b608983
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions mountpoint-s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ fuse_tests = []
s3_tests = []
shuttle = []
delete = []
# A temporary feature flag to enable read-path checksums while we are working to improve its performance
checksum = []

[build-dependencies]
built = { version = "0.6.0", features = ["git2"] }
Expand Down
7 changes: 1 addition & 6 deletions mountpoint-s3/src/prefetch/checksummed_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ impl ChecksummedBytes {
///
/// Return `IntegrityError` on data corruption.
pub fn into_bytes(self) -> Result<Bytes, IntegrityError> {
#[cfg(feature = "checksum")]
self.validate()?;

Ok(self.curr_slice)
Expand Down Expand Up @@ -72,7 +71,6 @@ impl ChecksummedBytes {
let new_checksummed_bytes = ChecksummedBytes::new(new_bytes, new_checksum);

// Validate data integrity with checksum bracketing.
#[cfg(feature = "checksum")]
{
// 1. repeat the operation, which means copying into a new buffer in this case.
let mut bytes_mut_dup = BytesMut::with_capacity(total_len);
Expand Down Expand Up @@ -145,7 +143,6 @@ mod tests {
assert_eq!(expected, actual);
}

#[cfg(feature = "checksum")]
#[test]
fn test_into_bytes_integrity_error() {
let bytes = Bytes::from_static(b"some bytes");
Expand Down Expand Up @@ -209,8 +206,7 @@ mod tests {
let actual = checksummed_bytes.curr_slice;
assert_eq!(expected, actual);
}

#[cfg(feature = "checksum")]

#[test]
fn test_extend_self_corrupted() {
let bytes = Bytes::from_static(b"some bytes");
Expand All @@ -228,7 +224,6 @@ mod tests {
assert!(matches!(result, Err(IntegrityError::ChecksumMismatch(_, _))));
}

#[cfg(feature = "checksum")]
#[test]
fn test_extend_other_corrupted() {
let bytes = Bytes::from_static(b"some bytes");
Expand Down

0 comments on commit b608983

Please sign in to comment.