← Back to Pull requests

feat: Add missed KMS support in msq durable storage and exports #20543

Closed
unknown closed this pull request without merging on Oct 28, 2026 03:23 UTC
View on GitHub
unknown unknown commented on Oct 09, 2026 18:00 UTC
Author

Description

MSQ durable storage and S3 exports write files with S3 multipart uploads, through RetryableS3OutputStream. KmsServerSideEncryption and S3ServerSideEncryption only added encryption settings to single
uploads 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 meant keyId was never sent. Only files small enough for a single request were encrypted with the configured settings.

This PR adds the missing settings:
- kms: adds aws:kms and ssekmsKeyId to the request that starts a multipart upload.
- s3: adds AES256 to 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 kms need 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:GenerateDataKey and kms:Decrypt to the roles that write these files, such as MSQ tasks. AWS requires kms:Decrypt for KMS-encrypted
multipart uploads. Grant kms:Decrypt to 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
KmsServerSideEncryption
S3ServerSideEncryption
CustomServerSideEncryption
* 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.

Diff: 277 lines (+207 / -70) across 3 files Reviewer: capistrant Review duration: 26483m
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
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.6% (MEDIUM) · Higher = larger blast radius
39.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.6% · Safe to merge
15.6%
Repository