1fanwang commented on PR #23304:
URL: https://github.com/apache/kafka/pull/23304#issuecomment-6958474868

   Both runs below used JDK 17, with the console output trimmed. On trunk 
34ea45cf with only this PR's DynamicBrokerReconfigurationTest.scala, a broker 
restarted without a current local snapshot runs with the static 1: line 1156 
checks that active value, and the broker log shows the persisted 4 rejected 
against the current 1.
   
   ```text
   $ git checkout 34ea45cf6ca81e6fad6d6e18c0bb366840c0f6e8
   $ git checkout fa64c47ec7824cb1a510f52be65efb10b9a84279 -- 
core/src/test/scala/integration/kafka/server/DynamicBrokerReconfigurationTest.scala
   $ ./gradlew :core:test --tests 
'kafka.server.DynamicBrokerReconfigurationTest.testRestoreDynamicConfigFromMetadataLog'
 --tests 
'kafka.server.DynamicBrokerReconfigurationTest.testRemoveDynamicConfigWhileBrokerIsStopped'
   Gradle Test Run :core:test > Gradle Test Executor 10 > 
DynamicBrokerReconfigurationTest > 
testRemoveDynamicConfigWhileBrokerIsStopped() PASSED
   Gradle Test Run :core:test > Gradle Test Executor 10 > 
DynamicBrokerReconfigurationTest > 
testRestoreDynamicConfigFromMetadataLog(String) > snapshot=none FAILED
       org.opentest4j.AssertionFailedError: expected: <4> but was: <1>
           at 
app//kafka.server.DynamicBrokerReconfigurationTest.testRestoreDynamicConfigFromMetadataLog(DynamicBrokerReconfigurationTest.scala:1156)
   Gradle Test Run :core:test > Gradle Test Executor 10 > 
DynamicBrokerReconfigurationTest > 
testRestoreDynamicConfigFromMetadataLog(String) > snapshot=stale FAILED
       org.opentest4j.AssertionFailedError: expected: <4> but was: <1>
           at 
app//kafka.server.DynamicBrokerReconfigurationTest.testRestoreDynamicConfigFromMetadataLog(DynamicBrokerReconfigurationTest.scala:1156)
   Gradle Test Run :core:test > Gradle Test Executor 10 > 
DynamicBrokerReconfigurationTest > 
testRestoreDynamicConfigFromMetadataLog(String) > snapshot=current PASSED
   4 tests completed, 2 failed
   BUILD FAILED in 1m 13s
   
   $ grep -E 'ERROR Cluster default configs could not be 
applied|^org.apache.kafka.common.config.ConfigException: Dynamic thread count 
update validation failed' 
core/build/test-results/test/TEST-kafka.server.DynamicBrokerReconfigurationTest.xml
   org.apache.kafka.common.config.ConfigException: Dynamic thread count update 
validation failed for num.recovery.threads.per.data.dir=4, value should not be 
greater than double the current value 1
   [2026-11-17 12:17:23,480] ERROR Cluster default configs could not be 
applied: [num.recovery.threads.per.data.dir, min.insync.replicas] 
(kafka.server.DynamicBrokerConfig:63)
   org.apache.kafka.common.config.ConfigException: Dynamic thread count update 
validation failed for num.recovery.threads.per.data.dir=4, value should not be 
greater than double the current value 1
   [2026-11-17 12:17:35,836] ERROR Cluster default configs could not be 
applied: [num.recovery.threads.per.data.dir, min.insync.replicas] 
(kafka.server.DynamicBrokerConfig:63)
   ```
   
   On fa64c47e all three restarts pass those assertions, and the broker log has 
no such rejection.
   
   ```text
   $ git checkout fa64c47ec7824cb1a510f52be65efb10b9a84279
   $ ./gradlew :core:test --tests 
'kafka.server.DynamicBrokerReconfigurationTest.testRestoreDynamicConfigFromMetadataLog'
 --tests 
'kafka.server.DynamicBrokerReconfigurationTest.testRemoveDynamicConfigWhileBrokerIsStopped'
 --tests 
'kafka.server.metadata.BrokerMetadataPublisherTest.testInitialDynamicConfigFailureKeepsPublisherRemovable'
   Gradle Test Run :core:test > Gradle Test Executor 13 > 
BrokerMetadataPublisherTest > 
testInitialDynamicConfigFailureKeepsPublisherRemovable() PASSED
   Gradle Test Run :core:test > Gradle Test Executor 12 > 
DynamicBrokerReconfigurationTest > 
testRemoveDynamicConfigWhileBrokerIsStopped() PASSED
   Gradle Test Run :core:test > Gradle Test Executor 12 > 
DynamicBrokerReconfigurationTest > 
testRestoreDynamicConfigFromMetadataLog(String) > snapshot=none PASSED
   Gradle Test Run :core:test > Gradle Test Executor 12 > 
DynamicBrokerReconfigurationTest > 
testRestoreDynamicConfigFromMetadataLog(String) > snapshot=stale PASSED
   Gradle Test Run :core:test > Gradle Test Executor 12 > 
DynamicBrokerReconfigurationTest > 
testRestoreDynamicConfigFromMetadataLog(String) > snapshot=current PASSED
   BUILD SUCCESSFUL in 1m 12s
   
   $ grep -c -E 'ERROR Cluster default configs could not be 
applied|^org.apache.kafka.common.config.ConfigException: Dynamic thread count 
update validation failed' 
core/build/test-results/test/TEST-kafka.server.DynamicBrokerReconfigurationTest.xml
   0
   ```
   


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