Skip to content

Serve high held-poll counts without a single node-wide probe read slot #1372

Backlog

Description

@rmcdaniel

Problem

#1358 (for #1355) keeps held polls off the last request connection so that registration and producers survive database stalls. With the pool at 4 connections (3 request plus 1 maintenance), held-poll admission, probe and readiness reads share one node-wide read slot, and budgeted transactions use one transition slot.

Measured on MariaDB at 2 CPUs (main vs #1358, 4 producers, 2 s polls; numbers from #1358's description):

  • 64 held polls: start throughput up (13.6 → 17.5–18.1/s); probe wait p50/p99 18/57 → 92/158 ms; empty-poll p99 2.4 → 2.55 s.
  • 256 held polls: start throughput up (10–11 → 15.7–16.2/s); probe wait p50/p99 122/305 → 426/673–859 ms; dispatch p99 0.56 → 1.0–1.08 s.

Two read slots would need a fourth request connection, i.e. POOL_CONNECTIONS = 5. That fails the compile-time prepared-statement budget (MAX × POOL_CONNECTIONS ≤ max_prepared_stmt_count), so it needs a smaller per-connection statement cache, or a different budget split. Taking the second read slot from the current 3-connection request pool would give the last connection back to held polls, which reopens #1204.

Required outcome

Done when

The change is merged with current-head checks and an independent review, with the measurements in the PR, or a recorded decision to keep the single read slot.

Activity

  1. rmcdaniel commented on Nov 26, 2026

    @rmcdaniel
    MemberAuthor

    Addition from #1358's final review: a later probe of a long held poll (20–60 s) that waits more than the 5 s acquisition deadline for the single read slot still fails the whole poll with 503 pool_timeout, instead of treating it as "not ready" and continuing to wait. This was not reached at 256 polls (the longest measured wait was 887 ms), but it is the first failure mode at higher counts. The fix belongs with this issue's capacity decision.

  2. rmcdaniel commented on Nov 26, 2026

    @rmcdaniel
    MemberAuthor

    From #1380's review: (1) the storage-pressure admission check (#951) runs at the top of the held-poll loop, before the read-slot wait, so a later probe can now claim on a pressure snapshot up to the poll's timeout old. Re-checking storage_admission.snapshot() after the slot is held would close that. (2) Under extreme load, later probes now keep waiting, so admissions and first probes (5 s cap) take the 503s instead. Both belong to this issue's capacity work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions