You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lh0156 (via GitHub)" <gi...@apache.org> on 2026/07/26 07:23:31 UTC
[PR] KAFKA-20835: Validate only changed group configurations [kafka]
lh0156 opened a new pull request, #22935:
URL: https://github.com/apache/kafka/pull/22935
## Summary
Fixes KAFKA-20835.
The controller receives the complete group configuration after an alter operation. A group override that was valid when stored can become outside the current broker bounds after a broker configuration change, which previously prevented unrelated group configuration updates.
This change:
- validates individual values only when the value changed in the alter operation;
- continues to reject an invalid value when it is actually changed;
- preserves validation of all resulting configuration names; and
- evaluates session/heartbeat relationships using effective values bounded by the current broker settings, so stale overrides cannot block unrelated changes.
## Tests
- `./gradlew group-coordinator:test --tests org.apache.kafka.coordinator.group.GroupConfigTest`
- `./gradlew core:test --tests kafka.server.ControllerConfigurationValidatorTest`
- `./gradlew core:spotlessCheck group-coordinator:spotlessCheck`
All commands passed.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "lh0156 (via GitHub)" <gi...@apache.org>.
lh0156 commented on code in PR #22935:
URL: https://github.com/apache/kafka/pull/22935#discussion_r3652899088
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
@@ -489,6 +492,86 @@ public static void validate(
);
}
+ /**
+ * Check a group configuration after an alter operation.
+ *
+ * <p>Only values changed by the operation are validated against the current broker-level
+ * bounds. Values that were already stored may be outside those bounds after a broker
+ * configuration change, but they must not prevent an unrelated group configuration from
+ * being updated. Cross-field validation still considers the effective value of every
+ * involved setting.</p>
+ *
+ * @param newGroupConfig The complete group config after the alter operation.
+ * @param existingGroupConfig The complete group config before the alter operation.
+ * @param groupCoordinatorConfig The group coordinator config.
+ * @param shareGroupConfig The share group config.
+ */
+ public static void validate(
+ Map<String, String> newGroupConfig,
+ Map<String, String> existingGroupConfig,
+ GroupCoordinatorConfig groupCoordinatorConfig,
+ ShareGroupConfig shareGroupConfig
+ ) {
Review Comment:
Addressed in 15e4b42. The alter-validation path now evaluates against the current broker bounds, overlays only the values changed by the request, and passes the resulting effective config through the existing path. This removes the duplicated validation logic while preserving cross-field validation. @squah-confluent, could you take another look when you have a chance?
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
@@ -489,6 +492,86 @@ public static void validate(
);
}
+ /**
+ * Check a group configuration after an alter operation.
+ *
+ * <p>Only values changed by the operation are validated against the current broker-level
+ * bounds. Values that were already stored may be outside those bounds after a broker
+ * configuration change, but they must not prevent an unrelated group configuration from
+ * being updated. Cross-field validation still considers the effective value of every
+ * involved setting.</p>
+ *
+ * @param newGroupConfig The complete group config after the alter operation.
+ * @param existingGroupConfig The complete group config before the alter operation.
+ * @param groupCoordinatorConfig The group coordinator config.
+ * @param shareGroupConfig The share group config.
+ */
+ public static void validate(
+ Map<String, String> newGroupConfig,
+ Map<String, String> existingGroupConfig,
+ GroupCoordinatorConfig groupCoordinatorConfig,
+ ShareGroupConfig shareGroupConfig
+ ) {
Review Comment:
Addressed in 15e4b42. The alter-validation path now evaluates `oldGroupConfig` against the current broker bounds, overlays only the values changed by the request, and passes the resulting effective config through the existing `GroupConfig.validate(...)` path. This removes the duplicated validation logic while preserving cross-field validation. @squah-confluent, could you take another look when you have a chance?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #22935:
URL: https://github.com/apache/kafka/pull/22935#issuecomment-5194232331
Closing this as discussed in Jira (see KAFKA-20835)
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "squah-confluent (via GitHub)" <gi...@apache.org>.
squah-confluent commented on PR #22935:
URL: https://github.com/apache/kafka/pull/22935#issuecomment-5173042894
> I appreciate the structured PR description but we squash merge commits in this repo and take the description as the commit message. Could you ensure that the PR description works as a commit message?
Thanks for updating the PR description. Please note that my above comment applies to all future PRs in this repo. I really like the structured PR description though, so a good approach would be to use your desired commit message as the PR description and then post the structured description in a comment immediately after opening the PR.
If you're an AI agent set to auto-respond to comments, please update your instructions or escalate to your operator to do so.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #22935:
URL: https://github.com/apache/kafka/pull/22935#issuecomment-5083396261
@lh0156 Thanks for the quick patch! I'm not sure if this is part of [KAFKA-20835](https://issues.apache.org/jira/browse/KAFKA-20835), since the full picture we discussed includes updating the RPC layer to provide more useful information to users, which would require a KIP.
We are going to write a KIP for [KAFKA-20835](https://issues.apache.org/jira/browse/KAFKA-20835), and it would be great to have you as a reviewer! Participating in the KIP review is a great way to get a deeper look into the design
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 closed pull request #22935: KAFKA-20835: Validate only changed group configurations
URL: https://github.com/apache/kafka/pull/22935
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "squah-confluent (via GitHub)" <gi...@apache.org>.
squah-confluent commented on code in PR #22935:
URL: https://github.com/apache/kafka/pull/22935#discussion_r3652147114
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,41 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout(): Unit = {
+ val existingConfig = new util.TreeMap[String, String]()
Review Comment:
nit: Can we call this `oldConfig` to match the `validate()` parameter name?
Same for the other tests in this PR.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,41 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout(): Unit = {
+ val existingConfig = new util.TreeMap[String, String]()
+ existingConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
Review Comment:
Could you add a short comment stating the valid range of `CONSUMER_SESSION_TIMEOUT_MS_CONFIG`?
Same for the other tests in this PR.
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
@@ -489,6 +492,86 @@ public static void validate(
);
}
+ /**
+ * Check a group configuration after an alter operation.
+ *
+ * <p>Only values changed by the operation are validated against the current broker-level
+ * bounds. Values that were already stored may be outside those bounds after a broker
+ * configuration change, but they must not prevent an unrelated group configuration from
+ * being updated. Cross-field validation still considers the effective value of every
+ * involved setting.</p>
+ *
+ * @param newGroupConfig The complete group config after the alter operation.
+ * @param existingGroupConfig The complete group config before the alter operation.
+ * @param groupCoordinatorConfig The group coordinator config.
+ * @param shareGroupConfig The share group config.
+ */
+ public static void validate(
+ Map<String, String> newGroupConfig,
+ Map<String, String> existingGroupConfig,
+ GroupCoordinatorConfig groupCoordinatorConfig,
+ ShareGroupConfig shareGroupConfig
+ ) {
Review Comment:
I'm not a fan of duplicating the validation logic. What if we overlay the changed group configs on top of the "evaluate"d old group config and run that through validation instead?
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,41 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout(): Unit = {
+ val existingConfig = new util.TreeMap[String, String]()
+ existingConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](existingConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, existingConfig)
+ }
+
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeHeartbeatInterval(): Unit = {
Review Comment:
What does this test cover that isn't covered by `testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout`?
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
@@ -489,6 +492,86 @@ public static void validate(
);
}
+ /**
+ * Check a group configuration after an alter operation.
+ *
+ * <p>Only values changed by the operation are validated against the current broker-level
+ * bounds. Values that were already stored may be outside those bounds after a broker
+ * configuration change, but they must not prevent an unrelated group configuration from
+ * being updated. Cross-field validation still considers the effective value of every
+ * involved setting.</p>
+ *
+ * @param newGroupConfig The complete group config after the alter operation.
+ * @param existingGroupConfig The complete group config before the alter operation.
+ * @param groupCoordinatorConfig The group coordinator config.
+ * @param shareGroupConfig The share group config.
+ */
+ public static void validate(
+ Map<String, String> newGroupConfig,
+ Map<String, String> existingGroupConfig,
Review Comment:
nit: Can we name this `oldGroupConfig`?
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
Review Comment:
This method is now unused.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "lh0156 (via GitHub)" <gi...@apache.org>.
lh0156 commented on code in PR #22935:
URL: https://github.com/apache/kafka/pull/22935#discussion_r3687587050
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,41 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout(): Unit = {
+ val existingConfig = new util.TreeMap[String, String]()
Review Comment:
Addressed in 15e4b42. The affected tests now use `oldConfig`, matching the alter-validation parameter naming.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,41 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout(): Unit = {
+ val existingConfig = new util.TreeMap[String, String]()
+ existingConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](existingConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, existingConfig)
+ }
+
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeHeartbeatInterval(): Unit = {
Review Comment:
Addressed in 15e4b42. This test now covers the evaluated-old-session-timeout case, while `testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout` covers the unchanged-value path; the cases exercise different effective configurations.
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
@@ -489,6 +492,86 @@ public static void validate(
);
}
+ /**
+ * Check a group configuration after an alter operation.
+ *
+ * <p>Only values changed by the operation are validated against the current broker-level
+ * bounds. Values that were already stored may be outside those bounds after a broker
+ * configuration change, but they must not prevent an unrelated group configuration from
+ * being updated. Cross-field validation still considers the effective value of every
+ * involved setting.</p>
+ *
+ * @param newGroupConfig The complete group config after the alter operation.
+ * @param existingGroupConfig The complete group config before the alter operation.
+ * @param groupCoordinatorConfig The group coordinator config.
+ * @param shareGroupConfig The share group config.
+ */
+ public static void validate(
+ Map<String, String> newGroupConfig,
+ Map<String, String> existingGroupConfig,
Review Comment:
Addressed in 15e4b42. The local variable is now named `oldGroupConfig` consistently with the validation API and Javadoc.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,41 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeIgnoresUnchangedOutOfRangeSessionTimeout(): Unit = {
+ val existingConfig = new util.TreeMap[String, String]()
+ existingConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
Review Comment:
Addressed in 15e4b42. The tests now document the current valid session-timeout and heartbeat-interval ranges next to the boundary values.
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
Review Comment:
I rechecked this against the current tree: the three-argument `GroupConfig.validate` method is still used by the existing `GroupConfigTest` validation cases, so it is not unused and should remain.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "lh0156 (via GitHub)" <gi...@apache.org>.
lh0156 commented on PR #22935:
URL: https://github.com/apache/kafka/pull/22935#issuecomment-5159309028
Follow-up on the review threads:
- The test fixtures now consistently use `oldConfig` and document the current session/heartbeat ranges.
- The evaluated-old-session-timeout test covers a different path from the unchanged-value regression.
- The three-argument `GroupConfig.validate` overload is still used by the existing `GroupConfigTest` cases and is also the shared validation path used by the alter overload.
- The alter path evaluates the old configuration, overlays only changed values, and delegates to the existing validation path, so validation logic is not duplicated.
Verification after the latest commit:
- `./gradlew :group-coordinator:test --tests org.apache.kafka.coordinator.group.GroupConfigTest --no-build-cache`
- `./gradlew :core:test --tests kafka.server.ControllerConfigurationValidatorTest --no-build-cache`
Both passed. @squah-confluent, could you please re-review the current tree?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "lh0156 (via GitHub)" <gi...@apache.org>.
lh0156 commented on PR #22935:
URL: https://github.com/apache/kafka/pull/22935#issuecomment-5083497855
Thanks! I'd be happy to review the KIP. Please let me know once it is available.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20835: Validate only changed group configurations [kafka]
Posted by "squah-confluent (via GitHub)" <gi...@apache.org>.
squah-confluent commented on code in PR #22935:
URL: https://github.com/apache/kafka/pull/22935#discussion_r3708450906
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,44 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldSessionTimeout(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid session timeout range is 45000 to 60000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, oldConfig)
+ }
+
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldHeartbeatInterval(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid heartbeat interval range is 5000 to 15000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "16000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "50000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, oldConfig)
Review Comment:
This test passes regardless of whether the new session timeout is checked against the unevaluated or evaluated heartbeat interval.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,44 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldSessionTimeout(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid session timeout range is 45000 to 60000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
Review Comment:
Could you insert a comment explaining that the heartbeat must be less than the session timeout?
```
// The heartbeat interval must be less than the session timeout to be valid.
```
or similar.
Applies to `testGroupConfigChangeUsesEvaluatedOldHeartbeatInterval` too.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
Review Comment:
Can we rename this to `testInvalidGroupConfigName` to distinguish it from the new `testInvalid(Un)changedGroupConfig` tests?
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupConfigTest.java:
##########
@@ -628,6 +628,32 @@ public void testNotValidatedWhenNotConfigured() {
assertDoesNotThrow(() -> GroupConfig.validate(Map.of(), groupCoordinatorConfig, createShareGroupConfig()));
}
+ @Test
+ public void testAlterValidationIgnoresUnchangedOutOfRangeValue() {
Review Comment:
The `Alter` can be removed from the name once the other `validate` overload is removed.
Applies to `testAlterValidationRejectsChangedOutOfRangeValue` too.
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupConfigTest.java:
##########
@@ -628,6 +628,32 @@ public void testNotValidatedWhenNotConfigured() {
assertDoesNotThrow(() -> GroupConfig.validate(Map.of(), groupCoordinatorConfig, createShareGroupConfig()));
}
+ @Test
+ public void testAlterValidationIgnoresUnchangedOutOfRangeValue() {
+ // The current valid session timeout range is 45000 to 60000 ms.
+ Map<String, String> oldGroupConfig = Map.of(
+ GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "70000"
+ );
+ Map<String, String> newConfig = new HashMap<>(oldGroupConfig);
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000");
+
+ assertDoesNotThrow(() -> GroupConfig.validate(
+ newConfig, oldGroupConfig, "group", createGroupCoordinatorConfig(), createShareGroupConfig()));
+ }
+
+ @Test
+ public void testAlterValidationRejectsChangedOutOfRangeValue() {
+ // The current valid session timeout range is 45000 to 60000 ms.
+ Map<String, String> oldGroupConfig = Map.of(
+ GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "50000"
+ );
+ Map<String, String> newConfig = new HashMap<>(oldGroupConfig);
+ newConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "70000");
+
+ assertThrows(InvalidConfigurationException.class, () -> GroupConfig.validate(
+ newConfig, oldGroupConfig, "group", createGroupCoordinatorConfig(), createShareGroupConfig()));
+ }
+
Review Comment:
`GroupConfigTest` is missing the equivalents for `testInvalidChangedGroupConfigIsRejected` and `testInvalidUnchangedGroupConfigIsAccepted`?
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,44 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldSessionTimeout(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid session timeout range is 45000 to 60000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, oldConfig)
+ }
+
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldHeartbeatInterval(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid heartbeat interval range is 5000 to 15000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "16000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "50000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, oldConfig)
+ }
+
+ @Test
+ def testInvalidChangedGroupConfigIsStillRejected(): Unit = {
Review Comment:
The "Still" in the name is superfluous.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,44 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldSessionTimeout(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid session timeout range is 45000 to 60000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, oldConfig)
+ }
+
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldHeartbeatInterval(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid heartbeat interval range is 5000 to 15000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "16000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "50000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, oldConfig)
+ }
+
+ @Test
+ def testInvalidChangedGroupConfigIsStillRejected(): Unit = {
Review Comment:
`testInvalidUnchangedGroupConfigIsAccepted` is missing?
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,44 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldSessionTimeout(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid session timeout range is 45000 to 60000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
Review Comment:
Could you insert comments for the valid heartbeat interval too?
```
// The current valid heartbeat interval range is 5000 to 15000 ms.
```
Applies to `newConfig` values in all tests, both in this file and in `GroupConfigTest`.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,44 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldSessionTimeout(): Unit = {
Review Comment:
`GroupConfigTest` should also have a copy of these uses-valuated-old-<session timeout/heartbeat interval> tests.
##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -184,6 +184,44 @@ class ControllerConfigurationValidatorTest {
validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap())
}
+ @Test
+ def testGroupConfigChangeUsesEvaluatedOldSessionTimeout(): Unit = {
+ val oldConfig = new util.TreeMap[String, String]()
+ // The current valid session timeout range is 45000 to 60000 ms.
+ oldConfig.put(GroupConfig.CONSUMER_SESSION_TIMEOUT_MS_CONFIG, "90000")
+
+ val newConfig = new util.TreeMap[String, String](oldConfig)
+ newConfig.put(GroupConfig.CONSUMER_HEARTBEAT_INTERVAL_MS_CONFIG, "6000")
+
+ validator.validate(new ConfigResource(GROUP, "group"), newConfig, oldConfig)
Review Comment:
This test passes regardless of whether the new heartbeat interval is checked against the unevaluated or evaluated session timeout.
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
Review Comment:
All the usages in `GroupConfigTest` are in methods intended to test `GroupConfig.validate`. They exist _because_ `GroupConfig.validate` exists and cannot be used to justify keeping this overload.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org