← Back to Pull requests

[FLINK-38199][benchmark] Add SinkUpsertMaterializerBenchmark for V1 and V2 #126

Open
unknown opened this pull request with 641 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 27, 2026 16:02 UTC
Author

Purpose of the change

FLINK-38199 adds a benchmark for the sink upsert materializer. This supersedes #106, which stalled after the review in August 2025. Roman's commit is kept as the first one, formatted for spotless and checkstyle.

Brief change log

  • SinkUpsertMaterializerBenchmark with the flink-table-runtime test-jar (Roman's commit).

  • Steady-state invocation as requested in #106, retracting the row in the middle of the history, the four table.exec.sink.upsert-materialize-strategy.type strategies as strategy, historyLength instead of retractDelay and retractPercentage, and the method renamed to sinkUpsertMaterializer for codespeed.
  • Verifying this change

    Nightly settings (3 forks, 1s iterations), Apple M4 Pro, JDK 17.0.20, Flink 2.5-SNAPSHOT of 2026-10-27:

    Benchmark               (hasUpsertKey)  (historyLength)  (stateBackend)  (strategy)  Cnt      Score      Error  Units
    sinkUpsertMaterializer           false                1            HEAP      LEGACY   30  11672.290  ± 207.134  ops/ms
    sinkUpsertMaterializer           false                1            HEAP       VALUE   30  10934.342  ± 336.420  ops/ms
    sinkUpsertMaterializer           false                1            HEAP         MAP   30   3725.430  ± 199.853  ops/ms
    sinkUpsertMaterializer           false                1            HEAP    ADAPTIVE   30  10602.502  ± 234.836  ops/ms
    sinkUpsertMaterializer           false                1         ROCKSDB      LEGACY   30   1093.548  ±   8.109  ops/ms
    sinkUpsertMaterializer           false                1         ROCKSDB       VALUE   30   1098.939  ±   6.432  ops/ms
    sinkUpsertMaterializer           false                1         ROCKSDB         MAP   30    134.725  ±   1.393  ops/ms
    sinkUpsertMaterializer           false                1         ROCKSDB    ADAPTIVE   30   1076.401  ±   6.093  ops/ms
    sinkUpsertMaterializer           false              500            HEAP      LEGACY   30   2435.096  ±  10.258  ops/ms
    sinkUpsertMaterializer           false              500            HEAP       VALUE   30   3468.880  ±  23.754  ops/ms
    sinkUpsertMaterializer           false              500            HEAP         MAP   30   3024.327  ±  52.651  ops/ms
    sinkUpsertMaterializer           false              500            HEAP    ADAPTIVE   30   2674.529  ±  15.488  ops/ms
    sinkUpsertMaterializer           false              500         ROCKSDB      LEGACY   30     61.423  ±   0.713  ops/ms
    sinkUpsertMaterializer           false              500         ROCKSDB       VALUE   30     51.788  ±   0.490  ops/ms
    sinkUpsertMaterializer           false              500         ROCKSDB         MAP   30     92.584  ±   2.823  ops/ms
    sinkUpsertMaterializer           false              500         ROCKSDB    ADAPTIVE   30     78.044  ±   1.431  ops/ms
    sinkUpsertMaterializer            true                1            HEAP      LEGACY   30  11126.870  ± 142.354  ops/ms
    sinkUpsertMaterializer            true                1            HEAP       VALUE   30  10911.535  ± 317.291  ops/ms
    sinkUpsertMaterializer            true                1            HEAP         MAP   30   4566.504  ± 299.417  ops/ms
    sinkUpsertMaterializer            true                1            HEAP    ADAPTIVE   30  10022.936  ± 406.970  ops/ms
    sinkUpsertMaterializer            true                1         ROCKSDB      LEGACY   30   1110.359  ±  10.663  ops/ms
    sinkUpsertMaterializer            true                1         ROCKSDB       VALUE   30   1087.621  ±   5.760  ops/ms
    sinkUpsertMaterializer            true                1         ROCKSDB         MAP   30    119.707  ±   1.945  ops/ms
    sinkUpsertMaterializer            true                1         ROCKSDB    ADAPTIVE   30   1087.451  ±   8.032  ops/ms
    sinkUpsertMaterializer            true              500            HEAP      LEGACY   30    656.858  ±   4.361  ops/ms
    sinkUpsertMaterializer            true              500            HEAP       VALUE   30   1612.959  ±  49.669  ops/ms
    sinkUpsertMaterializer            true              500            HEAP         MAP   30   3725.263  ±  64.487  ops/ms
    sinkUpsertMaterializer            true              500            HEAP    ADAPTIVE   30   3669.555  ±  96.052  ops/ms
    sinkUpsertMaterializer            true              500         ROCKSDB      LEGACY   30     51.840  ±   2.317  ops/ms
    sinkUpsertMaterializer            true              500         ROCKSDB       VALUE   30     50.032  ±   1.457  ops/ms
    sinkUpsertMaterializer            true              500         ROCKSDB         MAP   30     80.890  ±   1.172  ops/ms
    sinkUpsertMaterializer            true              500         ROCKSDB    ADAPTIVE   30     67.167  ±   0.766  ops/ms
    

    In a short run with the sink loggers at INFO, no retraction missed its row in any combination.

    Impact and documentation

    Adds 32 combinations, about 35 minutes in the nightly run.

    ---

    ##### Was generative AI tooling used to co-author this PR?

  • [X] Yes (please specify the tool below)
  • Generated-by: Claude Code (Claude Opus 5.5)

    Diff: 641 lines (+480 / -161) across 8 files Reviewer: MartijnVisser Review duration: 15585m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 641 lines diff across 8 files
    0.52
    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.387
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #126"
    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: 51.9% (MEDIUM) · Higher = larger blast radius
    51.9%
    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: 27.7% · Safe to merge
    27.7%