Skip to content

[improve][pip] PIP-486: Scalable Topic Key-Shared Consumption - #26077

Merged
merlimat merged 3 commits into
apache:masterfrom
merlimat:mmerli/pip-486
Jun 29, 2026
Merged

merlimat merged 3 commits into
apache:masterfrom
merlimat:mmerli/pip-486

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Motivation

PIP-468 and
PIP-483 give scalable topics a DAG of
range segments whose steady-state ordered-consumption model is one consumer per segment. Several
situations need key-shared (per-message-key) ordered consumption instead: draining a sealed-segment
backlog after a scale-up, consolidating many low-throughput topics, and getting consumer parallelism
beyond the max-segments ceiling.

Today, key-shared dispatch couples the producer's batching mode to the consumer's subscription mode
(the producer must disable batching or use the key-based batcher). This PIP removes that coupling for
scalable topics.

Modifications

Adds the design document pip/pip-486.md. In summary:

  • Entry-bucketing: a second, independent 16-bit hash (hashB, the low half of the same 32-bit key
    hash whose high half drives segment routing) divides each segment into a configurable number of
    buckets; the producer keeps each batch within one bucket and stamps the bucket's hashB range in the
    outer MessageMetadata.
  • Routing by range: the broker dispatches a whole entry to the consumer that owns that bucket — no
    per-key hashing, no decompression, one entry to exactly one consumer.
  • Per-topic bucket budget, divided across segments (a split halves a segment's buckets); bucket
    count is immutable per segment, changed only by a controller-driven "rebucket rollover" (a no-op
    split reusing the PIP-468 seal/redirect flow).
  • Controller-driven bucket→consumer assignment; reassignment reuses the existing Key_Shared
    blocked-hash handling, tracking pending state per bucket. No shared-entry ack machinery.

This is a documentation-only PR (the design proposal). Implementation will follow in separate PRs.
A discussion thread will be started on [email protected].

Adds the PIP-486 design document: key-shared (per-message-key) ordered
consumption on scalable topics via producer-side entry-bucketing, decoupling
the producer's batching mode from the consumer's subscription mode.

Discussion to follow on [email protected].
@github-actions github-actions Bot added the PIP label Jun 22, 2026
Comment thread pip/pip-486.md
…trary bucket boundaries

- The entry now carries the effective hashB range of its messages (entry_hash_min/
  entry_hash_max) — the actual min/max, a tighter bound than the nominal bucket. This
  lets a geo-replication relay forward a batch as-is when its real contents still fit a
  differently-bounded destination segment, re-batching only on a genuine straddle.
- Add a forward-compatibility note: the range-based wire/dispatch do not require
  equal-width buckets, so the controller could later place arbitrary bucket boundaries
  to balance buckets by traffic (as PIP-468 does for segments).
Comment thread pip/pip-486.md
@merlimat
merlimat merged commit 808133d into apache:master Jun 29, 2026
13 checks passed
@merlimat
merlimat deleted the mmerli/pip-486 branch June 29, 2026 19:06
@merlimat merlimat added this to the 5.0.0-M2 milestone Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants