[Store] Externalize S3 client config via environment variables#2649
[Store] Externalize S3 client config via environment variables#2649mzygQAQ wants to merge 4 commits into
Conversation
Add four new env vars to control S3Helper behavior at runtime: - MOONCAKE_AWS_S3_USE_HTTPS (bool, default true) Switch between HTTPS and HTTP scheme. - MOONCAKE_AWS_LOG_LEVEL (off/fatal/error/warn/info/debug/trace, default error) Control AWS SDK log verbosity. - MOONCAKE_AWS_S3_REQUEST_CHECKSUM (when_supported/when_required, default when_supported) When set to when_required, avoids the new checksum trailer behavior that breaks compatibility with MinIO and some other S3-compatible backends. - MOONCAKE_AWS_S3_RESPONSE_CHECKSUM (when_supported/when_required, default when_supported) Same purpose as above for response validation. All defaults preserve backward compatibility with existing behavior. connection_info_ log line updated to include the new values for easier debugging. Co-Authored-By: Claude <noreply@anthropic.com>
- Remove MOONCAKE_AWS_LOG_LEVEL env var, ParseLogLevel function, and the corresponding <aws/core/utils/logging/LogLevel.h> include. The underlying use case (changing AWS SDK log verbosity at runtime) is rarely needed in practice and adds an extra knob to maintain. - Remove logLevel / requestChecksum / responseChecksum fields from the connection_info_ log line to reduce startup log noise. Co-Authored-By: Claude <noreply@anthropic.com>
Wrap LOG(WARNING) stream chains and the config.scheme ternary to match the project's column-width style. Add trailing newline. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces configuration options for AWS S3 client settings, allowing users to configure HTTPS usage and request/response checksum calculations via environment variables. Feedback was provided regarding the checksum parsing logic: the current implementation incorrectly logs a warning when the valid value "when_supported" is supplied. It is recommended to explicitly handle "when_supported" and make the parsing case-insensitive to improve robustness.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
7b63722 to
b8531d9
Compare
ParseRequestChecksum / ParseResponseChecksum logged a warning whenever value != "when_required" and value was non-empty. This incorrectly flagged the valid value "when_supported" as invalid. - Add an explicit "when_supported" branch before the warning. - Lowercase the input via std::transform + std::tolower for case-insensitive comparison (matching the convention already used in real_client.cpp / ssd_register_client.cpp). - Collapse the two near-identical functions into a single ParseChecksumMode<T>() template — both AWS SDK enum classes share the WHEN_REQUIRED / WHEN_SUPPORTED enumerator names. Co-Authored-By: Claude <noreply@anthropic.com>
b8531d9 to
491951f
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Description
Externalize three S3 client knobs as environment variables so they can be tuned at runtime without rebuilding. Defaults preserve current behavior — existing users see
no change.
New environment variables
MOONCAKE_AWS_S3_USE_HTTPStrue/falsetrueMOONCAKE_AWS_S3_REQUEST_CHECKSUMwhen_supported/when_requiredwhen_supportedMOONCAKE_AWS_S3_RESPONSE_CHECKSUMwhen_supported/when_requiredwhen_supportedWhy
MOONCAKE_AWS_S3_USE_HTTPS— the original code hardcoded HTTPS, breaking deployments to plaintext MinIO/Ceph.when_requiredrestorespre-1.11 behavior.
Backward compatibility
All three defaults match the previous behavior:
WHEN_SUPPORTED(AWS SDK default, was implicit)Users on AWS-proper S3 see no change. Users on MinIO/Ceph can now opt into compatible behavior by setting the two checksum vars to
when_required.Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
# Example: bash scripts/run_ci_test.shTest results:
Checklist
./scripts/code_format.shpre-commit run --all-filesand all hooks passAI Assistance Disclosure