← Back to Pull requests

[WIP] Fix Iceberg metadata caching and S3 connection reuse [databricks] #16854

Open
unknown opened this pull request with 419 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 12, 2026 07:18 UTC
Author

Related issue: N/A.

Description

Some Iceberg Parquet footer and dictionary reads bypass PerfIO and use synchronous S3 streams. Seeking or closing with unread response bytes discards connections even though the clients are cached. Iceberg 1.6/1.9 also bypass the footer cache, and scan setup discards known file sizes, causing redundant HEAD requests.

This change:

  • Preserves known sizes when creating data-file and delete-file inputs.

  • Routes metadata streams through PerfIO using buffered, aligned, bounded S3 ranges that are fully consumed before returning. Nearby backward seeks reuse the buffer.

  • Adds a cached-footer stream adapter for Iceberg 1.6/1.9 that preserves original file offsets and split filtering. Iceberg 1.10/1.11 retain parsed-footer caching and use the PerfIO stream for dictionary reads.
  • Validation

    Local validation used JDK 17 . All 52 focused test executions passed, with no skipped or canceled tests:

    | Spark | Iceberg | Focused tests passed |
    | --- | --- | ---: |
    | 3.5.0 | 1.6.1 | 10 |
    | 3.5.9 | 1.9.2 | 14 |
    | 3.5.9 | 1.10.1 | 14 |
    | 4.1.1 / Scala 2.13 | 1.11.0 | 14 |

    Coverage includes IcebergS3InputFileSuite, GpuParquetIOSuite, and, on the newer profiles, GpuMultiThreadIcebergParquetReaderSuite: known-length forwarding, backward seeks, EOF, failed refills and cleanup, footer-cache hits without additional source reads, split filtering, dictionary contents, and CPU/GPU result parity with both coalescing and multithreaded readers. The scan tests assert GPU execution.

    Committed-head shim source selection passed against current main across 33 profiles. The bounded cross-PR advisory found no new static interaction findings in its five checked combinations; remaining candidates were outside that check limit.

    Performance measurements

    A local HTTP/1.1 S3 endpoint served ten copies of the checked-in file-splits.parquet fixture using AWS SDK 2.31.78. The dictionary stress case reads columns in reverse order. The baseline uses native Iceberg synchronous metadata reads; the changed path uses PerfIO with Netty.

    | Scenario | HEAD requests, before → after | GET requests, before → after | TCP connections, before → after |
    | --- | ---: | ---: | ---: |
    | Footer reads | 10 → 0 | 20 → 20 | 10 → 1 |
    | Footer and dictionary reads | 10 → 0 | 2,260 → 30 | 2,250 → 1 |

    Both dictionary runs read 2,330 pages with matching checksums. These measurements cover request and connection counts; representative remote-storage throughput validation remains pending.

    Remaining draft work

  • Complete premerge validation, including Databricks.

  • Measure throughput on a representative remote-object-storage workload.
  • AI assistance: Codex assisted with implementation, tests, and PR preparation. The author reviewed the implementation diff before publication.

    Checklists

    Documentation

  • Updated for new or modified user-facing features or behaviors

  • No user-facing change
  • Testing

  • Added or modified tests to cover new code paths

  • Covered by existing tests

  • (Please provide the names of the existing tests in the PR description.)
  • Not required
  • Performance

  • Tests ran and results are added in the PR description

  • Issue filed with a link in the PR description

  • Not required
  • Diff: 419 lines (+314 / -105) across 5 files Reviewer: gerashegalov Review duration: 15160m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 419 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.361
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #16854"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 45.0% (MEDIUM) · Higher = larger blast radius
    45.0%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 24.0% · Safe to merge
    24.0%