[Spark] Use native S3 conditional writes for concurrent commits #7827
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 364 lines diff across 4 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.353
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7827"
general
weight: 0.35
huan233usc
Which Delta project/connector is this regarding?
Description
Delta's current S3 LogStore only coordinates writes within a single driver. This change adds a new LogStore,
S3LogStore, which uses S3 conditional writes to coordinate commits across independent drivers. When independent drivers try to create the same commit file, S3's put-if-absent condition allows only one write to succeed. Delta's existing conflict checks then decide whether the competing transactions can retry.The store also handles a lost success response. Each write includes a unique ID in the object's metadata, allowing the writer to recognize its own successful commit. If it cannot establish the outcome, it returns an error explaining that the commit may have succeeded.
Implementation outline
The large deletion from
S3SingleDriverLogStoreis code moved into the sharedBaseS3LogStore. The path-handling, listing, and JVM-locked write method bodies are preserved, apart from renaming calls to the path helper.S3SingleDriverLogStoredelegates to that shared implementation, which the newS3LogStorealso reuses. The new conditional-write and recovery logic is inS3ConditionalWrite.The changes stay within LogStore selection and writing. Delta's transaction conflict checks remain unchanged.
How was this patch tested?
Added tests for write recovery, automatic selection and overrides, and S3A integration. Automatic selection has not been rerun against live AWS. Suggestions for additional coverage are welcome.
Does this PR introduce any user-facing changes?
Yes. Supported Hadoop S3A 3.4.2+ filesystems use the native store automatically. Explicit LogStore overrides take precedence. Unsupported filesystems retain the single-driver store with a warning.
Concurrent writers must use compatible commit protocols, and commit files must remain immutable during recovery. Automatic recovery after process restart is outside this change. Applications must not blindly retry a commit whose outcome is unknown.