From c3521f3de23dbbc9aaa752d5d29c88ef0a5e566c Mon Sep 17 00:00:00 2001 From: Daniel Carl Jones Date: Tue, 28 Nov 2023 10:19:29 +0000 Subject: [PATCH] Update CRT submodules to latest releases (#633) * Update CRT submodules to latest releases Signed-off-by: Daniel Carl Jones * Add changelog entries Signed-off-by: Daniel Carl Jones * Update aws_s3_request_type bindings Signed-off-by: Daniel Carl Jones * Update based on feedback Signed-off-by: Daniel Carl Jones --------- Signed-off-by: Daniel Carl Jones --- mountpoint-s3-client/src/s3_crt_client.rs | 5 ++- mountpoint-s3-crt-sys/CHANGELOG.md | 4 +++ mountpoint-s3-crt-sys/crt/aws-c-auth | 2 +- mountpoint-s3-crt-sys/crt/aws-c-common | 2 +- mountpoint-s3-crt-sys/crt/aws-c-io | 2 +- mountpoint-s3-crt-sys/crt/aws-c-s3 | 2 +- mountpoint-s3-crt-sys/crt/aws-lc | 2 +- mountpoint-s3-crt/CHANGELOG.md | 6 ++++ mountpoint-s3-crt/src/s3/client.rs | 39 ++++++++++++++++------- 9 files changed, 46 insertions(+), 18 deletions(-) diff --git a/mountpoint-s3-client/src/s3_crt_client.rs b/mountpoint-s3-client/src/s3_crt_client.rs index 65c156d78..5fa68e11e 100644 --- a/mountpoint-s3-client/src/s3_crt_client.rs +++ b/mountpoint-s3-client/src/s3_crt_client.rs @@ -828,9 +828,12 @@ fn status_code_to_log_level(status_code: i32) -> tracing::Level { } /// Return a string version of a [RequestType] for use in metrics +/// +/// TODO: Replace this method with `aws_s3_request_metrics_get_operation_name`, +/// and ensure all requests have an associated operation name. fn request_type_to_metrics_string(request_type: RequestType) -> &'static str { match request_type { - RequestType::Default => "Default", + RequestType::Unknown => "Default", RequestType::HeadObject => "HeadObject", RequestType::GetObject => "GetObject", RequestType::ListParts => "ListParts", diff --git a/mountpoint-s3-crt-sys/CHANGELOG.md b/mountpoint-s3-crt-sys/CHANGELOG.md index 191058b69..59edf2ad3 100644 --- a/mountpoint-s3-crt-sys/CHANGELOG.md +++ b/mountpoint-s3-crt-sys/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased + +* Update to latest CRT dependencies + ## v0.4.0 (November 21, 2023) * Update to latest CRT dependencies diff --git a/mountpoint-s3-crt-sys/crt/aws-c-auth b/mountpoint-s3-crt-sys/crt/aws-c-auth index 71bad382f..50f3e0d1c 160000 --- a/mountpoint-s3-crt-sys/crt/aws-c-auth +++ b/mountpoint-s3-crt-sys/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit 71bad382fe0a61e4426987c1abe6aca2fe1c1953 +Subproject commit 50f3e0d1ce28e39d914818048d84e3f5a11afe43 diff --git a/mountpoint-s3-crt-sys/crt/aws-c-common b/mountpoint-s3-crt-sys/crt/aws-c-common index fefbf4bdc..80f21b3ca 160000 --- a/mountpoint-s3-crt-sys/crt/aws-c-common +++ b/mountpoint-s3-crt-sys/crt/aws-c-common @@ -1 +1 @@ -Subproject commit fefbf4bdca1b3bada588baefec059849c268e73e +Subproject commit 80f21b3cac5ac51c6b8a62c7d2a5ef58a75195ee diff --git a/mountpoint-s3-crt-sys/crt/aws-c-io b/mountpoint-s3-crt-sys/crt/aws-c-io index c9cb77747..df64f57fe 160000 --- a/mountpoint-s3-crt-sys/crt/aws-c-io +++ b/mountpoint-s3-crt-sys/crt/aws-c-io @@ -1 +1 @@ -Subproject commit c9cb77747d3fd2809cf3d9c43be7d5decc17e4b3 +Subproject commit df64f57feb63ab1a489ded86a87b756a48c46f35 diff --git a/mountpoint-s3-crt-sys/crt/aws-c-s3 b/mountpoint-s3-crt-sys/crt/aws-c-s3 index 83008e577..cc6ba346b 160000 --- a/mountpoint-s3-crt-sys/crt/aws-c-s3 +++ b/mountpoint-s3-crt-sys/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit 83008e577804643bc632ae4e603f36ab96219b9b +Subproject commit cc6ba346b55ef012f7131d98dcc68e16acc16d95 diff --git a/mountpoint-s3-crt-sys/crt/aws-lc b/mountpoint-s3-crt-sys/crt/aws-lc index a8d06de79..80f3f3324 160000 --- a/mountpoint-s3-crt-sys/crt/aws-lc +++ b/mountpoint-s3-crt-sys/crt/aws-lc @@ -1 +1 @@ -Subproject commit a8d06de79e405692ac06fe17163626eaab515e4e +Subproject commit 80f3f3324e75737d43af3052b270fd2ffa169d29 diff --git a/mountpoint-s3-crt/CHANGELOG.md b/mountpoint-s3-crt/CHANGELOG.md index 1df2110d4..0f4ef1bd1 100644 --- a/mountpoint-s3-crt/CHANGELOG.md +++ b/mountpoint-s3-crt/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + +* Update to latest CRT dependencies +* Default exponential backoff value retries is now 500ms rather than 25ms ([awslabs/aws-c-io#612](https://github.com/awslabs/aws-c-io/pull/612)) +* Renamed `s3::RequestType::Default` to `s3::RequestType::Unknown` to match CRT change ([#633](https://github.com/awslabs/mountpoint-s3/pull/633)) + ## v0.4.0 (November 21, 2023) * Update to latest CRT dependencies diff --git a/mountpoint-s3-crt/src/s3/client.rs b/mountpoint-s3-crt/src/s3/client.rs index a6a38be5d..c88c4352a 100644 --- a/mountpoint-s3-crt/src/s3/client.rs +++ b/mountpoint-s3-crt/src/s3/client.rs @@ -1007,8 +1007,8 @@ impl Debug for RequestMetrics { /// multiple requests to various S3 APIs; this type can be used to distinguish them. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum RequestType { - /// Same as the original HTTP request passed to [Client::make_meta_request] - Default, + /// When the request type is unknown to the CRT. Operation name may have been attached to non-meta CRT requests. + Unknown, /// HeadObject: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html HeadObject, /// GetObject: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html @@ -1029,17 +1029,16 @@ pub enum RequestType { impl From for RequestType { fn from(value: aws_s3_request_type) -> Self { - use aws_s3_request_type::*; match value { - AWS_S3_REQUEST_TYPE_DEFAULT => RequestType::Default, - AWS_S3_REQUEST_TYPE_HEAD_OBJECT => RequestType::HeadObject, - AWS_S3_REQUEST_TYPE_GET_OBJECT => RequestType::GetObject, - AWS_S3_REQUEST_TYPE_LIST_PARTS => RequestType::ListParts, - AWS_S3_REQUEST_TYPE_CREATE_MULTIPART_UPLOAD => RequestType::CreateMultipartUpload, - AWS_S3_REQUEST_TYPE_UPLOAD_PART => RequestType::UploadPart, - AWS_S3_REQUEST_TYPE_ABORT_MULTIPART_UPLOAD => RequestType::AbortMultipartUpload, - AWS_S3_REQUEST_TYPE_COMPLETE_MULTIPART_UPLOAD => RequestType::CompleteMultipartUpload, - AWS_S3_REQUEST_TYPE_UPLOAD_PART_COPY => RequestType::UploadPartCopy, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_UNKNOWN => RequestType::Unknown, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_HEAD_OBJECT => RequestType::HeadObject, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_GET_OBJECT => RequestType::GetObject, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_LIST_PARTS => RequestType::ListParts, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_CREATE_MULTIPART_UPLOAD => RequestType::CreateMultipartUpload, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_UPLOAD_PART => RequestType::UploadPart, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_ABORT_MULTIPART_UPLOAD => RequestType::AbortMultipartUpload, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_COMPLETE_MULTIPART_UPLOAD => RequestType::CompleteMultipartUpload, + aws_s3_request_type::AWS_S3_REQUEST_TYPE_UPLOAD_PART_COPY => RequestType::UploadPartCopy, _ => panic!("unknown request type {:?}", value), } } @@ -1171,3 +1170,19 @@ impl UploadReviewPart { Self { size, checksum } } } + +#[cfg(test)] +mod tests { + use test_case::test_case; + + use crate::aws_s3_request_type; + use crate::s3::client::RequestType; + + #[test_case(aws_s3_request_type::AWS_S3_REQUEST_TYPE_UNKNOWN, RequestType::Unknown)] + #[test_case(aws_s3_request_type::AWS_S3_REQUEST_TYPE_HEAD_OBJECT, RequestType::HeadObject)] + #[test_case(aws_s3_request_type::AWS_S3_REQUEST_TYPE_GET_OBJECT, RequestType::GetObject)] + fn request_type_from_aws_s3_request_type(c_request_type: aws_s3_request_type, expected_request_type: RequestType) { + // Simple, but was previously broken. + assert_eq!(expected_request_type, RequestType::from(c_request_type)); + } +}