suzhiking opened a new pull request, #24101:
URL: https://github.com/apache/kafka/pull/24101
The streams group coordinator refines the target assignment for the
whole group on every heartbeat of a stable group (KAFKA-20665).
`AssignmentRefinerBenchmark` measures one refiner call in isolation. This
adds `StreamsGroupHeartbeatBenchmark`, which measures a whole heartbeat
as the coordinator shard handles it, so the refiner's share can be
compared with everything else a heartbeat does.
The group is loaded into a `GroupCoordinatorShard` by replaying its
records, built from the `AssignmentRefinerBenchmark` fixtures, and every
member reports its restore progress once. Each invocation is a heartbeat
of the next member, round-robin. The returned records are not replayed,
so every heartbeat finds the group in the same state. Besides the group
shape parameters of `AssignmentRefinerBenchmark`, it has:
- `groupState`: `STABLE`, where every heartbeat refines afresh, or
`RECONCILING`, where the members are one assignment epoch behind and a
heartbeat reuses the epoch's cached intermediate assignment and runs
the reconciler.
- `refiner`: `NO_OP` or `IMPL`, set through
`group.streams.assignment.refiner.class`.
It also lets other benchmark packages import the two assignor fixture
classes, and adds 1.0 to `AssignmentRefinerBenchmark`'s
`migratingTaskFraction` so that every run includes the most expensive
call.
Testing: `./gradlew :jmh-benchmarks:compileJava checkstyleMain
spotbugsMain` passes. At 1000 members, 5,000 stateful tasks, one standby
and `lagPicture=MIXED` (on a laptop, 5 warm-up and 5 measured iterations
of 1 s), a stable heartbeat takes 6.3 ms with the refiner and 0.29 ms
with the no-op refiner, so the refiner is about 95% of it. With every
stateful task migrating it takes 9.7 ms. A reconciling heartbeat takes
about 35 µs with either refiner.
--
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]