forked from awslabs/mountpoint-s3
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically disable checksums on S3 on Outposts
I refactored our personality detection a little to track the various "quirks" of each S3 implementation. I also added new tests to make sure checksums are still enabled by default. This test probably fails when targeting an Outposts bucket, but we can cross that bridge if we ever start running CI against Outposts. Signed-off-by: James Bornholt <[email protected]>
- Loading branch information
1 parent
1d09ce8
commit 7908cde
Showing
10 changed files
with
159 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ pub mod metrics; | |
mod object; | ||
pub mod prefetch; | ||
pub mod prefix; | ||
pub mod s3; | ||
mod sync; | ||
mod upload; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//! Personalities of different S3 implementations. We use this to auto-configure some sensible | ||
//! defaults that differ between implementations. | ||
|
||
/// The type of S3 we're talking to. | ||
/// | ||
/// This enum intentionally doesn't implement PartialEq/Eq. You shouldn't test it directly. Instead, | ||
/// use its methods like `is_list_ordered` to check the actual behavior you're looking for. | ||
#[derive(Debug, Clone, Copy, Default)] | ||
pub enum S3Personality { | ||
#[default] | ||
Standard, | ||
ExpressOneZone, | ||
Outposts, | ||
} | ||
|
||
impl S3Personality { | ||
pub fn is_list_ordered(&self) -> bool { | ||
match self { | ||
S3Personality::Standard => true, | ||
S3Personality::ExpressOneZone => false, | ||
S3Personality::Outposts => true, | ||
} | ||
} | ||
|
||
pub fn supports_additional_checksums(&self) -> bool { | ||
match self { | ||
S3Personality::Standard => true, | ||
S3Personality::ExpressOneZone => true, | ||
S3Personality::Outposts => false, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters