This is an automated email from the ASF dual-hosted git repository.

davidarthur pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 10b15e3  MINOR: Fix a startup NPE in BrokerServer (#10989)
10b15e3 is described below

commit 10b15e3442277d9e963bc3c8de34585b9f9a8cd1
Author: David Arthur <[email protected]>
AuthorDate: Wed Jul 7 14:51:13 2021 -0400

    MINOR: Fix a startup NPE in BrokerServer (#10989)
    
    Reviewers: Colin P. McCabe <[email protected]>
---
 core/src/main/scala/kafka/server/BrokerServer.scala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/src/main/scala/kafka/server/BrokerServer.scala 
b/core/src/main/scala/kafka/server/BrokerServer.scala
index dbbd98e..39ca0ce 100644
--- a/core/src/main/scala/kafka/server/BrokerServer.scala
+++ b/core/src/main/scala/kafka/server/BrokerServer.scala
@@ -170,12 +170,13 @@ class BrokerServer(
 
       logDirFailureChannel = new LogDirFailureChannel(config.logDirs.size)
 
+      metadataCache = MetadataCache.kRaftMetadataCache(config.nodeId)
+
       // Create log manager, but don't start it because we need to delay any 
potential unclean shutdown log recovery
       // until we catch up on the metadata log and have up-to-date topic and 
broker configs.
       logManager = LogManager(config, initialOfflineDirs, metadataCache, 
kafkaScheduler, time,
         brokerTopicStats, logDirFailureChannel, keepPartitionMetadataFile = 
true)
 
-      metadataCache = MetadataCache.kRaftMetadataCache(config.nodeId)
       // Enable delegation token cache for all SCRAM mechanisms to simplify 
dynamic update.
       // This keeps the cache up-to-date if new SCRAM mechanisms are enabled 
dynamically.
       tokenCache = new DelegationTokenCache(ScramMechanism.mechanismNames)

Reply via email to