merlimat opened a new pull request, #25938:
URL: https://github.com/apache/pulsar/pull/25938

   This PIP proposes automatic segment split/merge for scalable topics, a 
sub-PIP of [PIP-468: Scalable Topic 
Controller](https://github.com/apache/pulsar/blob/master/pip/pip-468.md).
   
   ## Motivation
   
   PIP-468 gives the controller the ability to split and merge segments, but 
only on explicit operator request. This PIP makes the controller scale a topic 
automatically, eliminating the partition-count-style operational toil scalable 
topics were meant to remove.
   
   ## Key design points
   
   - **Splits are fast; merges are lazy.** Splits fire quickly with only a 
short `splitCooldown` (1m) to coalesce bursts; merges are gated by a longer 
`mergeCooldown` (5m) + cold `mergeWindow`.
   - **The controller reacts, it does not poll.** New stream/checkpoint 
consumers register directly with the controller, so consumer-count scale-up is 
event-driven (within seconds). Traffic load is *pushed* into the metadata store 
by each segment's owning broker (only on a significant change, default ±25%) 
and read by the controller on a 60s tick — no per-tick RPC fan-out.
   - **Pure decision function.** `AutoScalePolicyEvaluator.decide(layout, load, 
consumerCounts, policy, now)` → `Split | Merge | None`, unit-testable in 
isolation.
   - **Bounded churn.** `maxSegments` (64) caps growth; `maxDagDepth` (10) caps 
merges-in-lineage to stop split↔merge flip-flopping (splits always remain 
available); threshold hysteresis between split and merge.
   - **Default-on cluster-wide** with per-namespace (`Policies`) and per-topic 
(`ScalableTopicMetadata`) overrides, following the existing 
`autoTopicCreationOverride` pattern.
   
   The PIP also specifies the new `SegmentLoadStats` metadata record, the 
`broker.conf` knobs, the admin client API, and the observability surface.
   
   ### Links
   
   - Parent PIP: 
[PIP-468](https://github.com/apache/pulsar/blob/master/pip/pip-468.md)
   - Grand-parent PIP: 
[PIP-460](https://github.com/apache/pulsar/blob/master/pip/pip-460.md)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to