[geode] branch support/1.12 updated: GEODE-10103: Retrieve full region path names (#7419)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new 2ff0343 GEODE-10103: Retrieve full region path names (#7419) 2ff0343 is described below commit 2ff0343454216171811275939032e92ae2ce63fd Author: Barry Oglesby AuthorDate: Wed Mar 9 07:11:30 2022 -1000 GEODE-10103: Retrieve full region path names (#7419) * GEODE-10103: Retrieve full region path names This commit modifies RebalanceOperationPerformer getMemberRegionList to invoke listAllRegionPaths instead of listNames. (cherry picked from commit 8610ee70d470a8b30ab067db912bd0ac345d9df0) (cherry picked from commit d8f5afcecab615113c4326a32e9f56e0dfaa44f6) (cherry picked from commit 3b4ecd09a685b41e5b5d4df3927dd0e93ad87162) (cherry picked from commit ef29acb596039472a0f9a1c9b455942fe557d5b9) --- .../rest/RebalanceManagementDunitTest.java | 10 +- .../operation/RebalanceOperationPerformer.java | 8 +- .../RebalanceSubregionDistributedTest.java | 111 + .../internal/cli/commands/RebalanceCommand.java| 4 +- 4 files changed, 123 insertions(+), 10 deletions(-) diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java index ae6e034..cc5c4b6 100644 --- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java @@ -15,6 +15,7 @@ package org.apache.geode.management.internal.rest; +import static org.apache.geode.cache.Region.SEPARATOR; import static org.assertj.core.api.Assertions.assertThat; import java.util.ArrayList; @@ -94,7 +95,8 @@ public class RebalanceManagementDunitTest { .isGreaterThanOrEqualTo(cmr.getOperationStart().getTime()); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(2); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isIn("customers1", "customers2"); +assertThat(firstRegionSummary.getRegionName()).isIn(SEPARATOR + "customers1", +SEPARATOR + "customers2"); } @Test @@ -109,7 +111,7 @@ public class RebalanceManagementDunitTest { RebalanceResult result = cmr.getFutureResult().get(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } @@ -124,7 +126,7 @@ public class RebalanceManagementDunitTest { RebalanceResult result = cmr.getFutureResult().get(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } @@ -161,7 +163,7 @@ public class RebalanceManagementDunitTest { RebalanceResult result = cmr.getFutureResult().get(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers1"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers1"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java index e59b46d..d9b1956 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java @@ -157,7 +157,7 @@ public class
[geode] branch develop updated (09cd192 -> 19b889e)
This is an automated email from the ASF dual-hosted git repository. dixie pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 09cd192 GEODE-10108: Add version field to AbstractRedisData and deltas (#7429) add 19b889e GEODE-10099: Add 1.12.9 as old version (#7438) No new revisions were added by this update. Summary of changes: settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[geode-benchmarks] branch develop updated: GEODE-10080: Upgrade jedis to 4.1.1 (#165)
This is an automated email from the ASF dual-hosted git repository. donalevans pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git The following commit(s) were added to refs/heads/develop by this push: new 0604473 GEODE-10080: Upgrade jedis to 4.1.1 (#165) 0604473 is described below commit 0604473ec335dd2d70ce9045bc1eceecd2a2834f Author: Eric Zoerner AuthorDate: Thu Mar 10 09:44:21 2022 -0800 GEODE-10080: Upgrade jedis to 4.1.1 (#165) --- .../benchmark/redis/tasks/JedisClientManager.java | 24 -- .../redis/tasks/LettuceClientManager.java | 11 -- .../redis/tasks/LettucePubSubClientManager.java| 14 + .../geode/benchmark/redis/tasks/RedisClient.java | 5 ++--- .../redis/tasks/ZrangeByScoreRedisTask.java| 8 .../benchmark/redis/tasks/ZrangeRedisTask.java | 8 gradle/dependency-versions.properties | 2 +- 7 files changed, 28 insertions(+), 44 deletions(-) diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/JedisClientManager.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/JedisClientManager.java index 9cb7be5..3ea6a5c 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/JedisClientManager.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/JedisClientManager.java @@ -16,21 +16,20 @@ package org.apache.geode.benchmark.redis.tasks; import static java.lang.Thread.currentThread; -import static redis.clients.jedis.BinaryJedisCluster.HASHSLOTS; import java.net.InetSocketAddress; import java.util.Collection; -import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.stream.Collectors; import io.vavr.Function3; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import redis.clients.jedis.ConnectionPoolConfig; import redis.clients.jedis.HostAndPort; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisCluster; -import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisPubSub; import org.apache.geode.benchmark.redis.tests.PubSubBenchmarkConfiguration; @@ -72,12 +71,12 @@ public final class JedisClientManager implements RedisClientManager { } @Override -public Set zrange(final String key, final long start, final long stop) { +public List zrange(final String key, final long start, final long stop) { return jedisCluster.zrange(key, start, stop); } @Override -public Set zrangeByScore(final String key, final long start, final long stop) { +public List zrangeByScore(final String key, final long start, final long stop) { return jedisCluster.zrangeByScore(key, start, stop); } @@ -122,15 +121,8 @@ public final class JedisClientManager implements RedisClientManager { @Override public void flushdb() { - final Set seen = new HashSet<>(); - for (int i = 0; i < HASHSLOTS; ++i) { -try (final Jedis connectionFromSlot = jedisCluster.getConnectionFromSlot(i)) { - if (seen.add(connectionFromSlot.getClient().getHost())) { -logger.info("Executing flushdb on {}", connectionFromSlot.getClient().getHost()); -connectionFromSlot.flushDB(); - } -} - } + jedisCluster.getClusterNodes() + .forEach((nodeKey, nodePool) -> new Jedis(nodePool.getResource()).flushDB()); } }; @@ -141,7 +133,7 @@ public final class JedisClientManager implements RedisClientManager { final Set nodes = servers.stream() .map(i -> new HostAndPort(i.getHostString(), i.getPort())).collect(Collectors.toSet()); -final JedisPoolConfig poolConfig = new JedisPoolConfig(); +final ConnectionPoolConfig poolConfig = new ConnectionPoolConfig(); poolConfig.setMaxTotal(-1); poolConfig.setMaxIdle(-1); poolConfig.setLifo(false); @@ -149,7 +141,7 @@ public final class JedisClientManager implements RedisClientManager { final long start = System.nanoTime(); while (true) { - try (final Jedis jedis = jedisCluster.getConnectionFromSlot(0)) { + try (final Jedis jedis = new Jedis(jedisCluster.getConnectionFromSlot(0))) { logger.info("Waiting for cluster to come up."); final String clusterInfo = jedis.clusterInfo(); if (clusterInfo.contains("cluster_state:ok")) { diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/LettuceClientManager.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/LettuceClientManager.java index c917873..8520500 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/LettuceClientManager.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/redis/tasks/LettuceClientManager.java @@ -19,9 +19,7 @@ import static
[geode] branch develop updated (19b889e -> ac0c3d5)
This is an automated email from the ASF dual-hosted git repository. nnag pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 19b889e GEODE-10099: Add 1.12.9 as old version (#7438) add ac0c3d5 GEODE-10117: Added section in docs about memory (#7439) No new revisions were added by this update. Summary of changes: .../storing_data_on_disk/storing_data_on_disk.html.md.erb | 8 1 file changed, 4 insertions(+), 4 deletions(-)
[geode] branch support/1.13 updated: GEODE-10103: Retrieve full region path names (#7419)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new ef29acb GEODE-10103: Retrieve full region path names (#7419) ef29acb is described below commit ef29acb596039472a0f9a1c9b455942fe557d5b9 Author: Barry Oglesby AuthorDate: Wed Mar 9 07:11:30 2022 -1000 GEODE-10103: Retrieve full region path names (#7419) * GEODE-10103: Retrieve full region path names This commit modifies RebalanceOperationPerformer getMemberRegionList to invoke listAllRegionPaths instead of listNames. (cherry picked from commit 8610ee70d470a8b30ab067db912bd0ac345d9df0) (cherry picked from commit d8f5afcecab615113c4326a32e9f56e0dfaa44f6) (cherry picked from commit 3b4ecd09a685b41e5b5d4df3927dd0e93ad87162) --- .../rest/RebalanceManagementDunitTest.java | 10 +- .../operation/RebalanceOperationPerformer.java | 8 +- .../operation/RebalanceOperationPerformerTest.java | 9 +- .../operation/RestoreRedundancyPerformerTest.java | 2 +- .../RebalanceSubregionDistributedTest.java | 111 + .../internal/cli/commands/RebalanceCommand.java| 4 +- 6 files changed, 129 insertions(+), 15 deletions(-) diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java index dc7cafb..1b16681 100644 --- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java @@ -15,6 +15,7 @@ package org.apache.geode.management.internal.rest; +import static org.apache.geode.cache.Region.SEPARATOR; import static org.assertj.core.api.Assertions.assertThat; import java.util.ArrayList; @@ -99,7 +100,8 @@ public class RebalanceManagementDunitTest { RebalanceResult result = endResult.getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(2); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isIn("customers1", "customers2"); +assertThat(firstRegionSummary.getRegionName()).isIn(SEPARATOR + "customers1", +SEPARATOR + "customers2"); } @Test @@ -116,7 +118,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); @@ -136,7 +138,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } @@ -194,7 +196,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers1"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers1"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java index 219d97c..17a48e4 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java @@ -159,7 +159,7 @@ public class RebalanceOperationPerformer // translate to the
[geode] branch support/1.15 updated: GEODE-10103: Retrieve full region path names (#7419)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch support/1.15 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.15 by this push: new d8f5afc GEODE-10103: Retrieve full region path names (#7419) d8f5afc is described below commit d8f5afcecab615113c4326a32e9f56e0dfaa44f6 Author: Barry Oglesby AuthorDate: Wed Mar 9 07:11:30 2022 -1000 GEODE-10103: Retrieve full region path names (#7419) * GEODE-10103: Retrieve full region path names This commit modifies RebalanceOperationPerformer getMemberRegionList to invoke listAllRegionPaths instead of listNames. (cherry picked from commit 8610ee70d470a8b30ab067db912bd0ac345d9df0) --- .../rest/RebalanceManagementDunitTest.java | 9 +- .../operation/RebalanceOperationPerformer.java | 8 +- .../operation/RebalanceOperationPerformerTest.java | 8 +- .../operation/RestoreRedundancyPerformerTest.java | 2 +- .../RebalanceSubregionDistributedTest.java | 110 + .../internal/cli/commands/RebalanceCommand.java| 4 +- 6 files changed, 126 insertions(+), 15 deletions(-) diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java index 5808b7e..fdfff56 100644 --- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java @@ -100,7 +100,8 @@ public class RebalanceManagementDunitTest { RebalanceResult result = endResult.getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(2); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isIn("customers1", "customers2"); +assertThat(firstRegionSummary.getRegionName()).isIn(SEPARATOR + "customers1", +SEPARATOR + "customers2"); } @Test @@ -117,7 +118,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); @@ -137,7 +138,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } @@ -195,7 +196,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers1"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers1"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java index 21f2d00..26ae3dc 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java @@ -162,7 +162,7 @@ public class RebalanceOperationPerformer // translate to the return type we want RebalanceRegionResultImpl result = new RebalanceRegionResultImpl(); - result.setRegionName(regionName.replace(SEPARATOR, "")); + result.setRegionName(regionName); result.setBucketCreateBytes(results.getTotalBucketCreateBytes()); result.setBucketCreateTimeInMilliseconds(results.getTotalBucketCreateTime());
[geode] branch support/1.14 updated: GEODE-9910: Stop embedded locator after failed start (#7393)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.14 by this push: new dd665e9 GEODE-9910: Stop embedded locator after failed start (#7393) dd665e9 is described below commit dd665e9699960facea5ce62215359165d175648c Author: Barry Oglesby AuthorDate: Mon Mar 7 08:50:19 2022 -1000 GEODE-9910: Stop embedded locator after failed start (#7393) The start-locator property causes a locator to be started when the InternalDistributedSystem is initialized. The initialize method creates the locator and then creates a ClusterDistributionManager. If the creation of the ClusterDistributionManager failed, the started locator was not stopped. This change addresses that by stopping the locator if an exception occurs. (cherry picked from commit 72665b1ec5c6a6b91d0d6c57e997c23033578c58) (cherry picked from commit 5a32ec00bdbd949bc473322c3643f3d96165d62d) --- ...nalDistributedSystemBuilderIntegrationTest.java | 44 +++- .../internal/InternalDistributedSystem.java| 48 ++ 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java index 5bb5ebe..971859a 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java @@ -14,8 +14,11 @@ */ package org.apache.geode.distributed.internal; +import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT; import static org.apache.geode.distributed.ConfigurationProperties.NAME; +import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -26,6 +29,11 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.apache.geode.SystemConnectException; +import org.apache.geode.distributed.Locator; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.api.MembershipLocator; +import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.metrics.internal.MetricsService; import org.apache.geode.security.PostProcessor; import org.apache.geode.security.SecurityManager; @@ -43,7 +51,9 @@ public class InternalDistributedSystemBuilderIntegrationTest { @After public void tearDown() { -system.disconnect(); +if (system != null) { + system.disconnect(); +} } @Test @@ -76,4 +86,36 @@ public class InternalDistributedSystemBuilderIntegrationTest { assertThat(system.getSecurityService().getPostProcessor()) .isSameAs(thePostProcessor); } + + @Test + public void buildThatStartsLocatorAndFailsThenStopsLocator() { +// Create properties the cause the locator to be started +int locatorPort = AvailablePortHelper.getRandomAvailableTCPPort(); +Properties configProperties = new Properties(); +configProperties.setProperty(MCAST_PORT, "0"); +configProperties.setProperty(START_LOCATOR, "localhost[" + locatorPort + "]"); + +// Create a Builder with the TestClusterDistributionManagerConstructor +InternalDistributedSystem.Builder builder = +new InternalDistributedSystem.Builder(configProperties, metricsSessionBuilder) +.setClusterDistributionManagerConstructor( +new TestClusterDistributionManagerConstructor()); + +// Assert that attempting to build the InternalDistributedSystem throws the +// SystemConnectException + assertThatExceptionOfType(SystemConnectException.class).isThrownBy(builder::build); + +// Assert that no locator exists after the build attempt +assertThat(Locator.getLocator()).isNull(); + } + + static class TestClusterDistributionManagerConstructor implements + InternalDistributedSystem.ClusterDistributionManagerConstructor { + +@Override +public ClusterDistributionManager create(InternalDistributedSystem system, +MembershipLocator membershipLocator) { + throw new SystemConnectException("Problem starting up membership services"); +} + } } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
[geode] branch support/1.13 updated: GEODE-9910: Stop embedded locator after failed start (#7393)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new 732b735 GEODE-9910: Stop embedded locator after failed start (#7393) 732b735 is described below commit 732b735c1229ffda1e9d30f9cd23ccf6db34a999 Author: Barry Oglesby AuthorDate: Mon Mar 7 08:50:19 2022 -1000 GEODE-9910: Stop embedded locator after failed start (#7393) The start-locator property causes a locator to be started when the InternalDistributedSystem is initialized. The initialize method creates the locator and then creates a ClusterDistributionManager. If the creation of the ClusterDistributionManager failed, the started locator was not stopped. This change addresses that by stopping the locator if an exception occurs. (cherry picked from commit 72665b1ec5c6a6b91d0d6c57e997c23033578c58) (cherry picked from commit 5a32ec00bdbd949bc473322c3643f3d96165d62d) (cherry picked from commit 53e2b2e07a6312fa5307265d7e418e65667671cd) --- ...nalDistributedSystemBuilderIntegrationTest.java | 44 +++- .../internal/InternalDistributedSystem.java| 48 ++ 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java index 5bb5ebe..971859a 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java @@ -14,8 +14,11 @@ */ package org.apache.geode.distributed.internal; +import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT; import static org.apache.geode.distributed.ConfigurationProperties.NAME; +import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -26,6 +29,11 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.apache.geode.SystemConnectException; +import org.apache.geode.distributed.Locator; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.api.MembershipLocator; +import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.metrics.internal.MetricsService; import org.apache.geode.security.PostProcessor; import org.apache.geode.security.SecurityManager; @@ -43,7 +51,9 @@ public class InternalDistributedSystemBuilderIntegrationTest { @After public void tearDown() { -system.disconnect(); +if (system != null) { + system.disconnect(); +} } @Test @@ -76,4 +86,36 @@ public class InternalDistributedSystemBuilderIntegrationTest { assertThat(system.getSecurityService().getPostProcessor()) .isSameAs(thePostProcessor); } + + @Test + public void buildThatStartsLocatorAndFailsThenStopsLocator() { +// Create properties the cause the locator to be started +int locatorPort = AvailablePortHelper.getRandomAvailableTCPPort(); +Properties configProperties = new Properties(); +configProperties.setProperty(MCAST_PORT, "0"); +configProperties.setProperty(START_LOCATOR, "localhost[" + locatorPort + "]"); + +// Create a Builder with the TestClusterDistributionManagerConstructor +InternalDistributedSystem.Builder builder = +new InternalDistributedSystem.Builder(configProperties, metricsSessionBuilder) +.setClusterDistributionManagerConstructor( +new TestClusterDistributionManagerConstructor()); + +// Assert that attempting to build the InternalDistributedSystem throws the +// SystemConnectException + assertThatExceptionOfType(SystemConnectException.class).isThrownBy(builder::build); + +// Assert that no locator exists after the build attempt +assertThat(Locator.getLocator()).isNull(); + } + + static class TestClusterDistributionManagerConstructor implements + InternalDistributedSystem.ClusterDistributionManagerConstructor { + +@Override +public ClusterDistributionManager create(InternalDistributedSystem system, +MembershipLocator membershipLocator) { + throw new SystemConnectException("Problem starting up membership services"); +} + } } diff --git
[geode] branch support/1.14 updated: GEODE-10103: Retrieve full region path names (#7419)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch support/1.14 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.14 by this push: new 3b4ecd0 GEODE-10103: Retrieve full region path names (#7419) 3b4ecd0 is described below commit 3b4ecd09a685b41e5b5d4df3927dd0e93ad87162 Author: Barry Oglesby AuthorDate: Wed Mar 9 07:11:30 2022 -1000 GEODE-10103: Retrieve full region path names (#7419) * GEODE-10103: Retrieve full region path names This commit modifies RebalanceOperationPerformer getMemberRegionList to invoke listAllRegionPaths instead of listNames. (cherry picked from commit 8610ee70d470a8b30ab067db912bd0ac345d9df0) (cherry picked from commit d8f5afcecab615113c4326a32e9f56e0dfaa44f6) --- .../rest/RebalanceManagementDunitTest.java | 9 +- .../operation/RebalanceOperationPerformer.java | 8 +- .../operation/RebalanceOperationPerformerTest.java | 8 +- .../operation/RestoreRedundancyPerformerTest.java | 2 +- .../RebalanceSubregionDistributedTest.java | 110 + .../internal/cli/commands/RebalanceCommand.java| 4 +- 6 files changed, 126 insertions(+), 15 deletions(-) diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java index b187a24..d292855 100644 --- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RebalanceManagementDunitTest.java @@ -100,7 +100,8 @@ public class RebalanceManagementDunitTest { RebalanceResult result = endResult.getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(2); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isIn("customers1", "customers2"); +assertThat(firstRegionSummary.getRegionName()).isIn(SEPARATOR + "customers1", +SEPARATOR + "customers2"); } @Test @@ -117,7 +118,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); @@ -137,7 +138,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers2"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers2"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } @@ -195,7 +196,7 @@ public class RebalanceManagementDunitTest { .getOperationResult(); assertThat(result.getRebalanceRegionResults().size()).isEqualTo(1); RebalanceRegionResult firstRegionSummary = result.getRebalanceRegionResults().get(0); -assertThat(firstRegionSummary.getRegionName()).isEqualTo("customers1"); +assertThat(firstRegionSummary.getRegionName()).isEqualTo(SEPARATOR + "customers1"); assertThat(firstRegionSummary.getBucketCreateBytes()).isEqualTo(0); assertThat(firstRegionSummary.getTimeInMilliseconds()).isGreaterThanOrEqualTo(0); } diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java index 21f2d00..26ae3dc 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/operation/RebalanceOperationPerformer.java @@ -162,7 +162,7 @@ public class RebalanceOperationPerformer // translate to the return type we want RebalanceRegionResultImpl result = new RebalanceRegionResultImpl(); - result.setRegionName(regionName.replace(SEPARATOR, "")); + result.setRegionName(regionName); result.setBucketCreateBytes(results.getTotalBucketCreateBytes());
[geode] branch support/1.12 updated: GEODE-9910: Stop embedded locator after failed start (#7393)
This is an automated email from the ASF dual-hosted git repository. boglesby pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new f435ec9 GEODE-9910: Stop embedded locator after failed start (#7393) f435ec9 is described below commit f435ec93ab3b8796bed39d3b67729449cb9a8f47 Author: Barry Oglesby AuthorDate: Mon Mar 7 08:50:19 2022 -1000 GEODE-9910: Stop embedded locator after failed start (#7393) The start-locator property causes a locator to be started when the InternalDistributedSystem is initialized. The initialize method creates the locator and then creates a ClusterDistributionManager. If the creation of the ClusterDistributionManager failed, the started locator was not stopped. This change addresses that by stopping the locator if an exception occurs. (cherry picked from commit 72665b1ec5c6a6b91d0d6c57e997c23033578c58) (cherry picked from commit 5a32ec00bdbd949bc473322c3643f3d96165d62d) (cherry picked from commit 53e2b2e07a6312fa5307265d7e418e65667671cd) (cherry picked from commit 490900535b1fc1582be63a4eed266e42cb170213) --- ...nalDistributedSystemBuilderIntegrationTest.java | 44 +++- .../internal/InternalDistributedSystem.java| 48 ++ 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java index 5bb5ebe..971859a 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemBuilderIntegrationTest.java @@ -14,8 +14,11 @@ */ package org.apache.geode.distributed.internal; +import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT; import static org.apache.geode.distributed.ConfigurationProperties.NAME; +import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -26,6 +29,11 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.apache.geode.SystemConnectException; +import org.apache.geode.distributed.Locator; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.api.MembershipLocator; +import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.metrics.internal.MetricsService; import org.apache.geode.security.PostProcessor; import org.apache.geode.security.SecurityManager; @@ -43,7 +51,9 @@ public class InternalDistributedSystemBuilderIntegrationTest { @After public void tearDown() { -system.disconnect(); +if (system != null) { + system.disconnect(); +} } @Test @@ -76,4 +86,36 @@ public class InternalDistributedSystemBuilderIntegrationTest { assertThat(system.getSecurityService().getPostProcessor()) .isSameAs(thePostProcessor); } + + @Test + public void buildThatStartsLocatorAndFailsThenStopsLocator() { +// Create properties the cause the locator to be started +int locatorPort = AvailablePortHelper.getRandomAvailableTCPPort(); +Properties configProperties = new Properties(); +configProperties.setProperty(MCAST_PORT, "0"); +configProperties.setProperty(START_LOCATOR, "localhost[" + locatorPort + "]"); + +// Create a Builder with the TestClusterDistributionManagerConstructor +InternalDistributedSystem.Builder builder = +new InternalDistributedSystem.Builder(configProperties, metricsSessionBuilder) +.setClusterDistributionManagerConstructor( +new TestClusterDistributionManagerConstructor()); + +// Assert that attempting to build the InternalDistributedSystem throws the +// SystemConnectException + assertThatExceptionOfType(SystemConnectException.class).isThrownBy(builder::build); + +// Assert that no locator exists after the build attempt +assertThat(Locator.getLocator()).isNull(); + } + + static class TestClusterDistributionManagerConstructor implements + InternalDistributedSystem.ClusterDistributionManagerConstructor { + +@Override +public ClusterDistributionManager create(InternalDistributedSystem system, +MembershipLocator membershipLocator) { + throw new SystemConnectException("Problem starting up