You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by mo...@apache.org on 2019/04/08 20:39:24 UTC

[geode] branch develop updated: GEODE-6606: Support added MeterSubregistries in reconnect (#3418)

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

moleske pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new f1550e3  GEODE-6606: Support added MeterSubregistries in reconnect (#3418)
f1550e3 is described below

commit f1550e3cd0388a1fc0beb898d982ec15866db02a
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Mon Apr 8 13:39:02 2019 -0700

    GEODE-6606: Support added MeterSubregistries in reconnect (#3418)
---
 .../MeterSubregistryReconnectDistributedTest.java  | 194 +++++++++++++++++++++
 .../geode/cache/CacheFactoryIntegrationTest.java   |  13 +-
 .../internal/InternalDistributedSystem.java        |  12 +-
 .../geode/internal/cache/GemFireCacheImpl.java     |  10 +-
 .../apache/geode/internal/cache/InternalCache.java |   2 +-
 .../geode/internal/cache/InternalCacheBuilder.java |  11 +-
 .../cache/InternalCacheForClientAccess.java        |   5 +
 .../geode/internal/cache/ReconnectableCache.java   |  24 +++
 .../internal/cache/xmlcache/CacheCreation.java     |   5 +
 ...ernalCacheBuilderAllowsMultipleSystemsTest.java |  13 +-
 .../internal/cache/InternalCacheBuilderTest.java   |  19 +-
 11 files changed, 284 insertions(+), 24 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/metrics/MeterSubregistryReconnectDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/metrics/MeterSubregistryReconnectDistributedTest.java
new file mode 100644
index 0000000..f688fe3
--- /dev/null
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/metrics/MeterSubregistryReconnectDistributedTest.java
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.metrics;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static org.apache.geode.distributed.ConfigurationProperties.DISABLE_AUTO_RECONNECT;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
+import static org.apache.geode.distributed.ConfigurationProperties.MEMBER_TIMEOUT;
+import static org.apache.geode.distributed.ConfigurationProperties.NAME;
+import static org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper.getMembershipManager;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.getTimeout;
+import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
+import static org.apache.geode.test.dunit.VM.getController;
+import static org.apache.geode.test.dunit.VM.getVM;
+import static org.apache.geode.test.dunit.VM.toArray;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.File;
+import java.io.Serializable;
+import java.util.Properties;
+
+import io.micrometer.core.instrument.MeterRegistry;
+import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
+import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.ForcedDisconnectException;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.distributed.LocatorLauncher;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.distributed.internal.membership.gms.mgr.GMSMembershipManager;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.rules.DistributedRule;
+import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
+import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
+
+public class MeterSubregistryReconnectDistributedTest implements Serializable {
+
+  private static final long TIMEOUT = getTimeout().getValueInMS();
+
+  private static LocatorLauncher locatorLauncher;
+
+  private static InternalDistributedSystem system;
+  private static MeterRegistry addedSubregistry;
+  private static MeterRegistry discoveredSubregistry;
+
+  private VM locatorVM;
+  private VM server1VM;
+  private VM server2VM;
+
+  private String locatorName;
+  private String server1Name;
+  private String server2Name;
+
+  private File locatorDir;
+
+  @Rule
+  public DistributedRule distributedRule = new DistributedRule();
+
+  @Rule
+  public SerializableTemporaryFolder temporaryFolder = new SerializableTemporaryFolder();
+
+  @Rule
+  public SerializableTestName testName = new SerializableTestName();
+
+  @Before
+  public void setUp() throws Exception {
+    locatorName = "locator-" + testName.getMethodName();
+    server1Name = "server-" + testName.getMethodName() + "-1";
+    server2Name = "server-" + testName.getMethodName() + "-2";
+
+    locatorVM = getVM(0);
+    server1VM = getVM(1);
+    server2VM = getController();
+
+    locatorDir = temporaryFolder.newFolder(locatorName);
+
+    int locatorPort = locatorVM.invoke(() -> createLocator());
+
+    server1VM.invoke(() -> createServer(server1Name, locatorPort));
+    server2VM.invoke(() -> createServer(server2Name, locatorPort));
+
+    addIgnoredException(ForcedDisconnectException.class);
+    addIgnoredException("Possible loss of quorum");
+  }
+
+  @After
+  public void tearDown() {
+    locatorVM.invoke(() -> {
+      locatorLauncher.stop();
+      locatorLauncher = null;
+      system = null;
+    });
+
+    for (VM vm : toArray(server1VM, server2VM)) {
+      vm.invoke(() -> {
+        system.disconnect();
+        system = null;
+      });
+    }
+  }
+
+  @Test
+  public void meterSubregistryIsUsedAfterReconnect() {
+    locatorVM.invoke(() -> {
+      assertThat(system.getDistributionManager().getDistributionManagerIds()).hasSize(3);
+    });
+
+    server2VM.invoke(() -> {
+      GMSMembershipManager membershipManager = (GMSMembershipManager) getMembershipManager(system);
+      membershipManager.forceDisconnect("Forcing disconnect in " + testName.getMethodName());
+
+      await().until(() -> system.isReconnecting());
+      system.waitUntilReconnected(TIMEOUT, MILLISECONDS);
+      assertThat(system.getReconnectedSystem()).isNotSameAs(system);
+    });
+
+    locatorVM.invoke(() -> {
+      assertThat(system.getDistributionManager().getDistributionManagerIds()).hasSize(3);
+    });
+
+    server2VM.invoke(() -> {
+      system = (InternalDistributedSystem) system.getReconnectedSystem();
+      InternalCache cache = system.getCache();
+      CompositeMeterRegistry compositeMeterRegistry =
+          (CompositeMeterRegistry) cache.getMeterRegistry();
+      assertThat(compositeMeterRegistry.getRegistries()).containsOnly(addedSubregistry);
+    });
+  }
+
+  private int createLocator() {
+    LocatorLauncher.Builder builder = new LocatorLauncher.Builder();
+    builder.setMemberName(locatorName);
+    builder.setWorkingDirectory(locatorDir.getAbsolutePath());
+    builder.setPort(0);
+    builder.set(DISABLE_AUTO_RECONNECT, "false");
+    builder.set(ENABLE_CLUSTER_CONFIGURATION, "false");
+    builder.set(MAX_WAIT_TIME_RECONNECT, "1000");
+    builder.set(MEMBER_TIMEOUT, "2000");
+
+    locatorLauncher = builder.build();
+    locatorLauncher.start();
+
+    system = (InternalDistributedSystem) locatorLauncher.getCache().getDistributedSystem();
+
+    return locatorLauncher.getPort();
+  }
+
+  private void createServer(String serverName, int locatorPort) {
+    Properties configProperties = new Properties();
+    configProperties.setProperty(LOCATORS, "localHost[" + locatorPort + "]");
+    configProperties.setProperty(DISABLE_AUTO_RECONNECT, "false");
+    configProperties.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    configProperties.setProperty(MAX_WAIT_TIME_RECONNECT, "1000");
+    configProperties.setProperty(MEMBER_TIMEOUT, "2000");
+    configProperties.setProperty(NAME, serverName);
+
+    addedSubregistry = new SimpleMeterRegistry();
+
+    CacheFactory cacheFactory = new CacheFactory(configProperties);
+    cacheFactory.addMeterSubregistry(addedSubregistry);
+
+    InternalCache cache = (InternalCache) cacheFactory.create();
+
+    CompositeMeterRegistry compositeMeterRegistry =
+        (CompositeMeterRegistry) cache.getMeterRegistry();
+    assertThat(compositeMeterRegistry.getRegistries()).contains(addedSubregistry);
+
+    // same as a discovered ServerLoader that created a subregistry
+    discoveredSubregistry = new SimpleMeterRegistry();
+    compositeMeterRegistry.add(discoveredSubregistry);
+
+    system = cache.getInternalDistributedSystem();
+  }
+}
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/CacheFactoryIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/CacheFactoryIntegrationTest.java
index 9719b37..7c08aa2 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/cache/CacheFactoryIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/CacheFactoryIntegrationTest.java
@@ -15,6 +15,7 @@
 package org.apache.geode.cache;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.catchThrowable;
 
 import io.micrometer.core.instrument.MeterRegistry;
 import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
@@ -30,7 +31,9 @@ public class CacheFactoryIntegrationTest {
 
   @After
   public void tearDown() {
-    cache.close();
+    if (cache != null) {
+      cache.close();
+    }
   }
 
   @Test
@@ -61,6 +64,14 @@ public class CacheFactoryIntegrationTest {
         .containsExactlyInAnyOrder(firstMeterRegistry, secondMeterRegistry, thirdMeterRegistry);
   }
 
+  @Test
+  public void addMeterSubregistryThrowsNullPointerExceptionIfTheSubregistryIsNull() {
+    Throwable thrown = catchThrowable(() -> cache = (InternalCache) new CacheFactory()
+        .addMeterSubregistry(null)
+        .create());
+    assertThat(thrown).isInstanceOf(NullPointerException.class);
+  }
+
   private CompositeMeterRegistry getCacheMeterRegistry(InternalCache cache) {
     return (CompositeMeterRegistry) cache.getMeterRegistry();
   }
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index af5a73e..1b539e9 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -43,6 +43,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
+import io.micrometer.core.instrument.MeterRegistry;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelCriterion;
@@ -2449,11 +2450,13 @@ public class InternalDistributedSystem extends DistributedSystem
     // reconnecting for lost roles then this will be null
     String cacheXML = null;
     List<CacheServerCreation> cacheServerCreation = null;
+    Set<MeterRegistry> meterRegistries = null;
 
     InternalCache cache = GemFireCacheImpl.getInstance();
     if (cache != null) {
       cacheXML = cache.getCacheConfig().getCacheXMLDescription();
       cacheServerCreation = cache.getCacheConfig().getCacheServerCreation();
+      meterRegistries = cache.getMeterSubregistries();
     }
 
     DistributionConfig oldConfig = ids.getConfig();
@@ -2635,9 +2638,12 @@ public class InternalDistributedSystem extends DistributedSystem
             do {
               retry = false;
               try {
-                cache = new InternalCacheBuilder()
-                    .setCacheXMLDescription(cacheXML)
-                    .create(reconnectDS);
+                InternalCacheBuilder cacheBuilder = new InternalCacheBuilder()
+                    .setCacheXMLDescription(cacheXML);
+                for (MeterRegistry meterRegistry : meterRegistries) {
+                  cacheBuilder.addMeterSubregistry(meterRegistry);
+                }
+                cache = cacheBuilder.create(reconnectDS);
 
                 if (!cache.isClosed()) {
                   createAndStartCacheServers(cacheServerCreation, cache);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index 63031ee..1e4fcda 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -600,6 +600,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
   private Optional<HttpService> httpService = Optional.ofNullable(null);
 
   private final MeterRegistry meterRegistry;
+  private final Set<MeterRegistry> meterSubregistries;
 
   static {
     // this works around jdk bug 6427854, reported in ticket #44434
@@ -774,12 +775,14 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
    */
   GemFireCacheImpl(boolean isClient, PoolFactory poolFactory,
       InternalDistributedSystem internalDistributedSystem, CacheConfig cacheConfig,
-      boolean useAsyncEventListeners, TypeRegistry typeRegistry, MeterRegistry meterRegistry) {
+      boolean useAsyncEventListeners, TypeRegistry typeRegistry, MeterRegistry meterRegistry,
+      Set<MeterRegistry> meterSubregistries) {
     this.isClient = isClient;
     this.poolFactory = poolFactory;
     this.cacheConfig = cacheConfig; // do early for bug 43213
     this.pdxRegistry = typeRegistry;
     this.meterRegistry = meterRegistry;
+    this.meterSubregistries = meterSubregistries;
 
     // Synchronized to prevent a new cache from being created
     // before an old one has finished closing
@@ -951,6 +954,11 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
   }
 
   @Override
+  public Set<MeterRegistry> getMeterSubregistries() {
+    return meterSubregistries;
+  }
+
+  @Override
   public Optional<HttpService> getHttpService() {
     return httpService;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
index ddd0a92..8b5edbb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
@@ -78,7 +78,7 @@ import org.apache.geode.pdx.internal.TypeRegistry;
  * @see org.apache.geode.cache.Cache
  * @since GemFire 7.0
  */
-public interface InternalCache extends Cache, Extensible<Cache>, CacheTime {
+public interface InternalCache extends Cache, Extensible<Cache>, CacheTime, ReconnectableCache {
 
   InternalDistributedMember getMyId();
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheBuilder.java b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheBuilder.java
index fa980e7..2734def 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheBuilder.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheBuilder.java
@@ -121,7 +121,10 @@ public class InternalCacheBuilder {
         InternalDistributedSystem::getConnectedInstance,
         InternalDistributedSystem::connectInternal,
         GemFireCacheImpl::getInstance,
-        GemFireCacheImpl::new);
+        (isClient1, poolFactory1, internalDistributedSystem, cacheConfig1, useAsyncEventListeners1,
+            typeRegistry1, meterRegistry, addedMeterSubregistries) -> new GemFireCacheImpl(
+                isClient1, poolFactory1, internalDistributedSystem, cacheConfig1,
+                useAsyncEventListeners1, typeRegistry1, meterRegistry, addedMeterSubregistries));
   }
 
   @VisibleForTesting
@@ -209,7 +212,8 @@ public class InternalCacheBuilder {
 
             cache =
                 internalCacheConstructor.construct(isClient, poolFactory, internalDistributedSystem,
-                    cacheConfig, useAsyncEventListeners, typeRegistry, compositeMeterRegistry);
+                    cacheConfig, useAsyncEventListeners, typeRegistry, compositeMeterRegistry,
+                    meterSubregistries);
 
             internalDistributedSystem.setCache(cache);
             cache.initialize();
@@ -430,7 +434,8 @@ public class InternalCacheBuilder {
   interface InternalCacheConstructor {
     InternalCache construct(boolean isClient, PoolFactory poolFactory,
         InternalDistributedSystem internalDistributedSystem, CacheConfig cacheConfig,
-        boolean useAsyncEventListeners, TypeRegistry typeRegistry, MeterRegistry meterRegistry);
+        boolean useAsyncEventListeners, TypeRegistry typeRegistry, MeterRegistry meterRegistry,
+        Set<MeterRegistry> addedMeterSubregistries);
   }
 
   @VisibleForTesting
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheForClientAccess.java b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheForClientAccess.java
index 39d9b73..09438a0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheForClientAccess.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCacheForClientAccess.java
@@ -1241,4 +1241,9 @@ public class InternalCacheForClientAccess implements InternalCache {
   public MeterRegistry getMeterRegistry() {
     return delegate.getMeterRegistry();
   }
+
+  @Override
+  public Set<MeterRegistry> getMeterSubregistries() {
+    return delegate.getMeterSubregistries();
+  }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ReconnectableCache.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ReconnectableCache.java
new file mode 100644
index 0000000..3f4e96d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ReconnectableCache.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache;
+
+import java.util.Set;
+
+import io.micrometer.core.instrument.MeterRegistry;
+
+public interface ReconnectableCache {
+
+  Set<MeterRegistry> getMeterSubregistries();
+}
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
index 2548f23..618c698 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
@@ -2448,4 +2448,9 @@ public class CacheCreation implements InternalCache {
   public MeterRegistry getMeterRegistry() {
     throw new UnsupportedOperationException("Should not be invoked");
   }
+
+  @Override
+  public Set<MeterRegistry> getMeterSubregistries() {
+    throw new UnsupportedOperationException("Should not be invoked");
+  }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderAllowsMultipleSystemsTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderAllowsMultipleSystemsTest.java
index e229599..b140ad7 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderAllowsMultipleSystemsTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderAllowsMultipleSystemsTest.java
@@ -76,7 +76,7 @@ public class InternalCacheBuilderAllowsMultipleSystemsTest {
         throw new AssertionError("throwing system constructor");
       };
   private static final InternalCacheConstructor THROWING_CACHE_CONSTRUCTOR =
-      (a, b, c, d, e, f, g) -> {
+      (a, b, c, d, e, f, g, addedMeterSubregistries) -> {
         throw new AssertionError("throwing cache constructor");
       };
 
@@ -185,7 +185,7 @@ public class InternalCacheBuilderAllowsMultipleSystemsTest {
     internalCacheBuilder.create();
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(constructedSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
 
@@ -251,7 +251,7 @@ public class InternalCacheBuilderAllowsMultipleSystemsTest {
         .create(givenSystem);
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(givenSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
   @Test
@@ -304,7 +304,7 @@ public class InternalCacheBuilderAllowsMultipleSystemsTest {
         .create(givenSystem);
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(givenSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
   @Test
@@ -471,8 +471,9 @@ public class InternalCacheBuilderAllowsMultipleSystemsTest {
   private static InternalCacheConstructor constructorOf(InternalCache constructedCache) {
     InternalCacheConstructor constructor =
         mock(InternalCacheConstructor.class, "internal cache constructor");
-    when(constructor.construct(anyBoolean(), any(), any(), any(), anyBoolean(), any(), any()))
-        .thenReturn(constructedCache);
+    when(
+        constructor.construct(anyBoolean(), any(), any(), any(), anyBoolean(), any(), any(), any()))
+            .thenReturn(constructedCache);
     return constructor;
   }
 
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderTest.java
index ec43567..604c107 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/InternalCacheBuilderTest.java
@@ -74,7 +74,7 @@ public class InternalCacheBuilderTest {
         throw new AssertionError("throwing system constructor");
       };
   private static final InternalCacheConstructor THROWING_CACHE_CONSTRUCTOR =
-      (a, b, c, d, e, f, g) -> {
+      (a, b, c, d, e, f, g, addedMeterSubregistries) -> {
         throw new AssertionError("throwing cache constructor");
       };
 
@@ -191,7 +191,7 @@ public class InternalCacheBuilderTest {
         .create();
 
     verify(cacheConstructor).construct(anyBoolean(), any(), any(), any(),
-        anyBoolean(), any(), same(theCompositeMeterRegistry));
+        anyBoolean(), any(), same(theCompositeMeterRegistry), any());
   }
 
   @Test
@@ -244,7 +244,7 @@ public class InternalCacheBuilderTest {
         .create();
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(constructedSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
   @Test
@@ -299,7 +299,7 @@ public class InternalCacheBuilderTest {
         .create();
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(singletonSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
   @Test
@@ -351,7 +351,7 @@ public class InternalCacheBuilderTest {
         .create();
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(singletonSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
   @Test
@@ -465,7 +465,7 @@ public class InternalCacheBuilderTest {
         .create(givenSystem);
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(givenSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
   @Test
@@ -517,7 +517,7 @@ public class InternalCacheBuilderTest {
         .create(givenSystem);
 
     verify(cacheConstructor).construct(anyBoolean(), any(), same(givenSystem), any(),
-        anyBoolean(), any(), any());
+        anyBoolean(), any(), any(), any());
   }
 
   @Test
@@ -694,8 +694,9 @@ public class InternalCacheBuilderTest {
   private static InternalCacheConstructor constructorOf(InternalCache constructedCache) {
     InternalCacheConstructor constructor =
         mock(InternalCacheConstructor.class, "internal cache constructor");
-    when(constructor.construct(anyBoolean(), any(), any(), any(), anyBoolean(), any(), any()))
-        .thenReturn(constructedCache);
+    when(
+        constructor.construct(anyBoolean(), any(), any(), any(), anyBoolean(), any(), any(), any()))
+            .thenReturn(constructedCache);
     return constructor;
   }