You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by sh...@apache.org on 2024/06/18 03:10:39 UTC
(kafka) branch trunk updated: KAFKA-16969: Log error if config conficts with MV (#16366)
This is an automated email from the ASF dual-hosted git repository.
showuon pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new ceab1fe658e KAFKA-16969: Log error if config conficts with MV (#16366)
ceab1fe658e is described below
commit ceab1fe658eff6345dd0520d515d11411b0b8087
Author: Igor Soarez <i...@soarez.me>
AuthorDate: Tue Jun 18 06:10:34 2024 +0300
KAFKA-16969: Log error if config conficts with MV (#16366)
When broker configuration is incompatible with the current Metadata Version the Broker should log an error-level message but avoid shutting down.
Reviewers: Luke Chen <sh...@gmail.com>
---
core/src/main/java/kafka/server/MetadataVersionConfigValidator.java | 6 ++----
.../test/java/kafka/server/MetadataVersionConfigValidatorTest.java | 2 ++
docs/upgrade.html | 6 ++++++
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/core/src/main/java/kafka/server/MetadataVersionConfigValidator.java b/core/src/main/java/kafka/server/MetadataVersionConfigValidator.java
index 042ac09452f..a62987be203 100644
--- a/core/src/main/java/kafka/server/MetadataVersionConfigValidator.java
+++ b/core/src/main/java/kafka/server/MetadataVersionConfigValidator.java
@@ -57,15 +57,13 @@ public class MetadataVersionConfigValidator implements MetadataPublisher {
}
}
+ @SuppressWarnings("ThrowableNotThrown")
private void onMetadataVersionChanged(MetadataVersion metadataVersion) {
try {
this.config.validateWithMetadataVersion(metadataVersion);
} catch (Throwable t) {
- RuntimeException exception = this.faultHandler.handleFault(
+ this.faultHandler.handleFault(
"Broker configuration does not support the cluster MetadataVersion", t);
- if (exception != null) {
- throw exception;
- }
}
}
}
diff --git a/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java b/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java
index a484d592e23..168c3298343 100644
--- a/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java
+++ b/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java
@@ -27,6 +27,7 @@ import org.apache.kafka.server.common.MetadataVersion;
import org.apache.kafka.server.fault.FaultHandler;
import org.junit.jupiter.api.Test;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.BDDMockito.willAnswer;
import static org.mockito.Mockito.mock;
@@ -85,6 +86,7 @@ public class MetadataVersionConfigValidatorTest {
KafkaConfig config = mock(KafkaConfig.class);
FaultHandler faultHandler = mock(FaultHandler.class);
+ when(faultHandler.handleFault(any(), any())).thenReturn(new RuntimeException("returned exception"));
when(config.brokerId()).thenReturn(8);
willAnswer(invocation -> {
throw exception;
diff --git a/docs/upgrade.html b/docs/upgrade.html
index dbd2e513278..a16ac8c0e92 100644
--- a/docs/upgrade.html
+++ b/docs/upgrade.html
@@ -102,6 +102,12 @@
If READ is not authorized, checkpointing is limited to offsets mirrorred after the start of the task.
See <a href="https://issues.apache.org/jira/browse/KAFKA-15905">KAFKA-15905</a> for more details.
</li>
+ <li>
+ JBOD support in KRaft was introduced from Metadata Version (MV) 3.7-IV2.
+ Configuring Brokers with multiple log directories can lead to indefinite unavailability.
+ Brokers will now detect this situation and log an error.
+ See <a href="https://issues.apache.org/jira/browse/KAFKA-16606">KAFKA-16606</a> for more details.
+ </li>
</ul>
<h5><a id="upgrade_370_notable" href="#upgrade_370_notable">Notable changes in 3.7.0</a></h5>