merlimat opened a new pull request, #25611:
URL: https://github.com/apache/pulsar/pull/25611
## Summary
End-to-end coverage for the scalable-topic-specific behaviors of the V5
client (split / merge / key routing / cumulative ack / DAG following), plus two
consumer-side fixes the tests surfaced.
### Tests
- **V5KeyRoutingTest** — same key always lands on the same segment (per-key
order preservation), and a varied key set on a 4-segment topic flows end-to-end.
- **V5SegmentSplitTest** — admin-triggered split with producer + consumer
running through it; messages produced before and after are delivered exactly
once.
- **V5SegmentMergeTest** — same shape, with a merge.
- **V5DAGFollowingTest** —
- Existing subscription drains across a chain of splits.
- Brand-new EARLIEST subscription replays the sealed parent (newly
possible with the QueueConsumer fix below).
- **V5CumulativeAckTest** — three StreamConsumer cumulative-ack scenarios:
- Single ack on the last received id → empty backlog on re-attach.
- Mid-stream ack → re-attach replays only the unacked tail.
- Cross-split ack → ack parent fully, split, ack children, re-attach sees
no backlog.
- **V5QueueConsumerMultiSegmentAckTest** — QueueConsumer counterparts:
- Individual acks on every message of a multi-segment topic → re-attach
sees no backlog.
- Partial acks → re-attach replays exactly the unacked tail.
### V5 client fixes
- **`ClientSegmentLayout`** — also expose `sealedSegments()` from the DAG.
- **`ScalableQueueConsumer`** — subscribe to *all* segments (active +
sealed) so a fresh subscription replays sealed-parent backlog before
transitioning onto the children. Defer the per-segment v4 consumer close from
layout-change time to `TopicTerminated` time so acks for messages pulled before
the seal still flow.
- **`ScalableStreamConsumer`** — keep controller-driven (active-only)
subscription, but apply the same close-on-`TopicTerminated` deferral.
Layout-dynamics waits use `Awaitility.await()` for polling, with a comment
explaining why the wait is needed (V5 client's DAG watch is async even though
the admin call is synchronous server-side).
## Test plan
- [x] `./gradlew :pulsar-broker:test --tests
\"org.apache.pulsar.client.api.v5.V5KeyRoutingTest\"`
- [x] `./gradlew :pulsar-broker:test --tests
\"org.apache.pulsar.client.api.v5.V5SegmentSplitTest\"`
- [x] `./gradlew :pulsar-broker:test --tests
\"org.apache.pulsar.client.api.v5.V5SegmentMergeTest\"`
- [x] `./gradlew :pulsar-broker:test --tests
\"org.apache.pulsar.client.api.v5.V5DAGFollowingTest\"`
- [x] `./gradlew :pulsar-broker:test --tests
\"org.apache.pulsar.client.api.v5.V5CumulativeAckTest\"`
- [x] `./gradlew :pulsar-broker:test --tests
\"org.apache.pulsar.client.api.v5.V5QueueConsumerMultiSegmentAckTest\"`
## Matching PR
- [ ] No matching PR.
### area/client
--
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]