diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/EmbeddedServer.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/EmbeddedServer.java index b8d4f537890..bfa80246f56 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/EmbeddedServer.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/EmbeddedServer.java @@ -302,7 +302,7 @@ public EmbeddedServer build() throws Exception { // 2. Build metadata driver if (metadataDriver == null) { - if (ledgerManagerFactory == null && registrationManager == null) { + if (ledgerManagerFactory == null || registrationManager == null) { metadataDriver = BookieResources.createMetadataDriver(conf.getServerConf(), rootStatsLogger); serverBuilder.addComponent(new AutoCloseableLifecycleComponent("metadataDriver", metadataDriver)); }