← Back to Pull requests

output: Pass update_retry as a keyword in the secondary rollback_write #5636

Open
unknown opened this pull request with 205 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 14, 2026 03:54 UTC
Author

Which issue(s) this PR fixes:
Fixes #5633

What this PR does / why we need it:

acts_as_secondary defines rollback_write on the secondary so that it delegates to the primary, but it passed update_retry as a positional argument. Output#rollback_write(chunk_id, update_retry: true) has taken it as a keyword since 59a47a19, so the delegation always raised ArgumentError: wrong number of arguments (given 2, expected 1).

A delayed commit output used as <secondary>, such as out_forward with require_ack_response true, calls rollback_write when the ack times out. The error was logged as unexpected error while receiving ack. The chunk was not taken back, so it was not sent again.

This passes update_retry: update_retry, as the issue suggests.

Tests:

  • New data-driven test in test_output_as_buffered_secondary.rb. The secondary dequeues a chunk and calls rollback_write with update_retry: false and with the default. The chunk must go back to the queue, and update_retry_state must be called only with the default. On master both cases raise the ArgumentError.

  • test/plugin/test_output_as_buffered_secondary.rb 15 tests, test_output.rb 141 tests, test_output_as_buffered_retries.rb 14 tests: 0 failures.

  • The reproduction from the issue (primary port closed, secondary to a server that never acks), 22 s:
  • master: silent server received 1134 bytes, 9 x "unexpected error while receiving ack ... ArgumentError"
    branch: silent server received 3285 bytes, no error
    

    Docs Changes:
    None.

    Release Note:
    Fix rollback_write on a <secondary> output, which always raised ArgumentError.

    Diff: 205 lines (+153 / -52) across 2 files Reviewer: lbarrosby Review duration: 25540m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.36) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 205 lines diff across 2 files
    0.36
    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%
    42%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.319
    Real PR Conversation Timeline
    1 comments
    "Review active on #5636"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 36.3% (MEDIUM) · Higher = larger blast radius
    36.3%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 20.7% · Safe to merge
    20.7%
    Repository