← Back to Pull requests

[Spark] Use native S3 conditional writes for concurrent commits #7827

Closed
unknown closed this pull request without merging on Nov 12, 2026 02:18 UTC
View on GitHub
unknown unknown commented on Oct 07, 2026 23:14 UTC
Author

Which Delta project/connector is this regarding?

  • Spark

  • Standalone

  • Flink

  • Kernel

  • Other
  • 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 S3SingleDriverLogStore is code moved into the shared BaseS3LogStore. The path-handling, listing, and JVM-locked write method bodies are preserved, apart from renaming calls to the path helper. S3SingleDriverLogStore delegates to that shared implementation, which the new S3LogStore also reuses. The new conditional-write and recovery logic is in S3ConditionalWrite.

  • Use Hadoop S3A to send conditional writes for PUT and multipart completion.

  • Check the write ID after an ambiguous failure to distinguish our commit from another writer's.

  • Select the native store automatically when the filesystem supports it.

  • Respect explicit LogStore overrides before checking capabilities.
  • 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.

    Diff: 364 lines (+273 / -91) across 4 files Reviewer: huan233usc Review duration: 50583m
    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
    0.43
    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%
    56%
    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.353
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7827"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 42.7% (MEDIUM) · Higher = larger blast radius
    42.7%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 18.5% · Safe to merge
    18.5%
    Repository