← Back to Pull requests

Use --replication-factor 3 when creating Kafka topic 'beam' in KafkaIO workflows #41667

Open
unknown opened this pull request with 389 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 25, 2026 13:55 UTC
Author

Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:

  • The PR is an appropriate fix for the issue (e.g. we're not changing a test to avoid a bug)

  • The PR is a simple fix to the issue (e.g. we're not adding infra when we could just modify a test)

  • The PR is not covering for other problems (e.g. if we're bumping timeouts, it is not because we're covering for a performance problem)


  • Full details of the methodology of generation and review can be found here - https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing

    If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)

    Summary


    Update the Create Kafka topic step in .github/workflows/beam_PerformanceTests_xlang_KafkaIO_Python.yml and .github/workflows/beam_StressTests_Java_KafkaIO.yml to create topic beam with --replication-factor 3 instead of --replication-factor 1.

    Root Cause


    Both workflows deploy the 3-broker Kafka cluster from .test-infra/kubernetes/kafka-cluster/, where:
  • 05-kafka/10broker-config.yml configures default.replication.factor=3 and min.insync.replicas=2.

  • 05-kafka/configmap-config.yaml (run asynchronously by the kafka-config Kubernetes Job) creates topic beam with --replication-factor 3.
  • However, the workflow's Create Kafka topic step ran:

    kafka-topics.sh --create --topic beam --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1
    

    Whenever this workflow step executed before the kafka-config Job finished creating beam, it created beam with replication-factor=1, which is strictly less than the broker's min.insync.replicas=2. Subsequent writes from KafkaWriter (acks=all) then deterministically failed with:
    Caused by: org.apache.kafka.common.errors.NotEnoughReplicasException: Messages are rejected since there are fewer in-sync replicas than required.
    

    In passing runs (e.g., 45384783522), the kafka-config Job won the race (Topic 'beam' already exists), leaving beam with replication-factor=3.

    Recent Occurrences


    2 occurrences on master in the last 7 days:
  • 45605057281 (2026-11-25) — PerformanceTests xlang KafkaIO Python (Created topic "beam". with RF=1 → NotEnoughReplicasException)

  • 45165814169 (2026-11-23) — PerformanceTests xlang KafkaIO Python (Created topic "beam". with RF=1 → NotEnoughReplicasException)
  • Verification


  • Validated both workflow YAML files with yaml.safe_load.

  • Triggered beam_PerformanceTests_xlang_KafkaIO_Python.yml on this PR branch.
  • Verification


  • Triggered beam_PerformanceTests_xlang_KafkaIO_Python.yml workflow run on branch: 45628470402
  • Diff: 389 lines (+291 / -98) across 4 files Reviewer: github-actions[bot] Review duration: 2m
    All Vouch review confidence checks passed
    Residual risk 0.39 = Change Risk (0.48) × (1 − Review Confidence (0.20)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 389 lines diff across 4 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 27% · Reviewer familiarity: 35%
    19%
    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.357
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #41667"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 19.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: 48.1% (MEDIUM) · Higher = larger blast radius
    48.1%
    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: 19.8% · Lower = rushed or shallow review
    19.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: 38.6% · Moderate risk
    38.6%
    Repository