← Back to Pull requests

fix(inkless:metadata): route consolidating partitions with one replica to the replica #844

Closed
unknown closed this pull request without merging on Nov 02, 2026 15:28 UTC
View on GitHub
unknown unknown commented on Oct 29, 2026 11:41 UTC
Author

Consumers of a consolidating diskless topic with one replica get NOT_LEADER_OR_FOLLOWER and stay on the broker that returned it.

A diskless topic can have replication factor 1. Managed replicas accepts it, and a topic created before managed replicas stays at one replica. With consolidation on, that topic consolidates from creation, or an existing topic consolidates when remote.storage.enable is set later. Either way it keeps that one replica, and only the replica stores the local log that serves reads. InklessTopicMetadataTransformer chose its path from the replica count, so a partition with one replica kept hashing over every alive broker. A client sent to any other broker got NOT_LEADER_OR_FOLLOWER. The hash is stable, so the metadata refresh returned the same broker and the client retried the same failure.

The migration guide required a replication-factor increase before the alter of an untiered topic. A topic created consolidating at replication factor 1 had no such step, and consumers failed the same way. The transformer now routes a partition to its replicas whenever remote storage is on, at every replication factor: same-AZ replica, then cross-AZ replica, then unavailable. A partition with more than one replica already took that path. Untiered topics with one replica keep hash-based routing, because every broker can serve them. Raising the replication factor stays optional, for same-AZ reads and for availability while the replica's broker is down.

Test plan

  • Add SingleReplicaDisklessTiered transformer tests for Metadata and DescribeTopicPartitions.

  • Add a consolidating topic with replication factor 1 to testClientRoutingOfUntieredAndConsolidatedTopics, which fails without this change.

  • Run the transformer tests, checkstyle, spotbugs, and make vale.
  • Assisted-by: Claude Opus 5.5

    Diff: 229 lines (+171 / -58) across 2 files Reviewer: viktorsomogyi Review duration: 5986m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 229 lines diff across 2 files
    0.37
    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%
    60%
    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.325
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #844"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 37.0% (MEDIUM) · Higher = larger blast radius
    37.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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 14.6% · Safe to merge
    14.6%
    Repository