feat: Add missed KMS support in msq durable storage and exports #20543
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 277 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.337
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20543"
general
weight: 0.35
capistrant
Description
MSQ durable storage and S3 exports write files with S3 multipart uploads, through
RetryableS3OutputStream.KmsServerSideEncryptionandS3ServerSideEncryptiononly added encryption settings to singleuploads and copies, not to the request that starts a multipart upload. Large durable-storage and export files therefore got the bucket's default encryption instead of the configured
druid.storage.sse..With
kms, this meantkeyIdwas never sent. Only files small enough for a single request were encrypted with the configured settings.This PR adds the missing settings:
-
kms: addsaws:kmsandssekmsKeyIdto the request that starts a multipart upload.-
s3: addsAES256to the request that starts a multipart upload.-
custom: adds the customer key to both the start request and each part upload, because S3 needs the key on every part.#### Release note
S3 server-side encryption (
druid.storage.sse.type) now applies to multipart uploads in MSQ durable storage and S3 exports. Previously, large files fell back to the bucket's default encryption.Upgrade notes:
- Clusters using
kmsneed no special upgrade order. Reading a KMS-encrypted object needs no extra request headers, so mixed versions and rollbacks work.- Before you upgrade, make sure that the KMS key policy grants
kms:GenerateDataKeyandkms:Decryptto the roles that write these files, such as MSQ tasks. AWS requireskms:Decryptfor KMS-encryptedmultipart uploads. Grant
kms:Decryptto everything that reads them, including Brokers that read MSQ query results and any systems outside Druid that read exported files.- With
custom, large durable-storage objects that older tasks write during the upgrade may still fail to read, as they already do today. The failures stop once all services are upgraded.<hr>
##### Key changed/added classes in this PR
KmsServerSideEncryptionS3ServerSideEncryptionCustomServerSideEncryption*
ServerSideEncryptionTest<hr>
This PR has:
- [x] been self-reviewed.
- [x] added documentation for new or modified features or behaviors.
- [x] a release note entry in the PR description.