diff --git a/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp b/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp index 5f8ff8bb4aa22..544c82cd11d5f 100644 --- a/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp +++ b/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp @@ -656,7 +656,7 @@ class S3FileSystem::Impl { if (maxAttempts.has_value()) { VELOX_USER_CHECK( (maxAttempts.value() > 0), - "Invalid configuration: specify 'max-attempts' > 0."); + "Invalid configuration: specify 'hive.s3.max-attempts' > 0."); return std::make_shared( maxAttempts.value()); } else { @@ -667,7 +667,7 @@ class S3FileSystem::Impl { if (maxAttempts.has_value()) { VELOX_USER_CHECK( (maxAttempts.value() > 0), - "Invalid configuration: specify 'max-attempts' > 0."); + "Invalid configuration: specify 'hive.s3.max-attempts' > 0."); return std::make_shared( maxAttempts.value()); } else { @@ -678,7 +678,7 @@ class S3FileSystem::Impl { if (maxAttempts.has_value()) { VELOX_USER_CHECK( (maxAttempts.value() > 0), - "Invalid configuration: specify 'max-attempts' > 0."); + "Invalid configuration: specify 'hive.s3.max-attempts' > 0."); return std::make_shared( maxAttempts.value()); } else { diff --git a/velox/connectors/hive/storage_adapters/s3fs/S3Util.h b/velox/connectors/hive/storage_adapters/s3fs/S3Util.h index 3d24ba5c510da..468735d0dfee7 100644 --- a/velox/connectors/hive/storage_adapters/s3fs/S3Util.h +++ b/velox/connectors/hive/storage_adapters/s3fs/S3Util.h @@ -157,25 +157,31 @@ inline std::string getRequestID( } // namespace /// Only Amazon (amz) and Alibaba (oss) request IDs are supported. -#define VELOX_CHECK_AWS_OUTCOME(outcome, errorMsgPrefix, bucket, key) \ - { \ - if (!outcome.IsSuccess()) { \ - auto error = outcome.GetError(); \ - auto errMsg = fmt::format( \ - "{} due to: '{}'. Path:'{}', SDK Error Type:{}, HTTP Status Code:{}, S3 Service:'{}', Message:'{}', RequestID:'{}'", \ - errorMsgPrefix, \ - getErrorStringFromS3Error(error), \ - s3URI(bucket, key), \ - static_cast(error.GetErrorType()), \ - error.GetResponseCode(), \ - getS3BackendService(error.GetResponseHeaders()), \ - error.GetMessage(), \ - getRequestID(error.GetResponseHeaders())); \ - if (error.GetResponseCode() == Aws::Http::HttpResponseCode::NOT_FOUND) { \ - VELOX_FILE_NOT_FOUND_ERROR(errMsg); \ - } \ - VELOX_FAIL(errMsg) \ - } \ +#define VELOX_CHECK_AWS_OUTCOME(outcome, errorMsgPrefix, bucket, key) \ + { \ + if (!outcome.IsSuccess()) { \ + auto error = outcome.GetError(); \ + auto errMsg = fmt::format( \ + "{} due to: '{}'. Path:'{}', SDK Error Type:{}, HTTP Status Code:{}, S3 Service:'{}', Message:'{}', RequestID:'{}'.", \ + errorMsgPrefix, \ + getErrorStringFromS3Error(error), \ + s3URI(bucket, key), \ + static_cast(error.GetErrorType()), \ + error.GetResponseCode(), \ + getS3BackendService(error.GetResponseHeaders()), \ + error.GetMessage(), \ + getRequestID(error.GetResponseHeaders())); \ + if (IsRetryableHttpResponseCode(error.GetResponseCode())) { \ + auto retryHint = fmt::format( \ + " This request gets retriable response and has retried {} times, you may increase 'hive.s3.max-attempts'.", \ + outcome.GetRetryCount()); \ + errMsg.append(retryHint); \ + } \ + if (error.GetResponseCode() == Aws::Http::HttpResponseCode::NOT_FOUND) { \ + VELOX_FILE_NOT_FOUND_ERROR(errMsg); \ + } \ + VELOX_FAIL(errMsg) \ + } \ } bool isHostExcludedFromProxy(