lucasbru commented on code in PR #23803:
URL: https://github.com/apache/kafka/pull/23803#discussion_r4312869478


##########
docs/streams/developer-guide/streams-rebalance-protocol.md:
##########
@@ -39,7 +39,7 @@ The following features are available in the current release:
 
 * **Core Streams Group Rebalance Protocol**: The `group.protocol=streams` 
configuration enables the dedicated streams rebalance protocol. This separates 
streams groups from consumer groups and provides a streams-specific group 
membership lifecycle and metadata management on the broker.
 
-* **Sticky Task Assignor**: A basic task assignment strategy that minimizes 
task movement during rebalances is included. It is registered under the name 
`sticky` and is the default assignor.
+* **Built-in Task Assignors**: Two task assignment strategies are included. 
The `sticky` assignor minimizes task movement during rebalances and is the 
default assignor. The `balanced` assignor spreads the tasks of each subtopology 
across processes and evens out the per-thread task load, at the price of moving 
more tasks when the group membership changes; it is the counterpart of the 
`HighAvailabilityTaskAssignor` of the classic protocol, without the warmup task 
and rack-aware placement features, which are not assignor features in the 
streams protocol. A group selects an assignor with the group configuration 
`streams.assignor.name`.

Review Comment:
   "which are not assignor features in the streams protocol" holds for warmup 
tasks, but I don't think it holds for rack-aware placement.



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorConfig.java:
##########
@@ -395,7 +396,8 @@ public class GroupCoordinatorConfig {
     // The first entry is the default assignor for groups that do not select 
one. New built-in
     // assignors must be appended so that the default does not change for 
existing groups.
     private static final List<TaskAssignor> STREAMS_GROUP_BUILTIN_ASSIGNORS = 
List.of(
-        new StickyTaskAssignor()
+        new StickyTaskAssignor(),
+        new BalancedTaskAssignor()

Review Comment:
   What if somebody has a custom assignor called balanced in 4.4? Forgot what 
we did in terms of overriding



##########
core/src/test/scala/unit/kafka/server/StreamsGroupHeartbeatRequestTest.scala:
##########
@@ -978,6 +978,22 @@ class StreamsGroupHeartbeatRequestTest(cluster: 
ClusterInstance) extends GroupCo
         s"Expected InvalidConfigurationException but got 
${executionException.getCause}")
       
assertTrue(executionException.getCause.getMessage.contains("'does-not-exist' is 
not a registered task assignor"),
         s"Unexpected error message: ${executionException.getCause.getMessage}")
+
+      // Every built-in assignor is registered by default, so a group can 
select the balanced assignor without

Review Comment:
   This only checks that the group config is accepted and stored. Could we also 
heartbeat a member and check via `describeStreamsGroups` that the group 
actually reports `balanced` as its assignor? Also, I'd find this easier to read 
as a separate test instead of an addition to the invalid-name test.



-- 
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