geode git commit: GEODE-2193 a member is kicked out immediately after joining
Repository: geode Updated Branches: refs/heads/develop ac3a82241 -> ef86239f8 GEODE-2193 a member is kicked out immediately after joining The problem is happening because we send a shutdown message, initiating election of a new coordinator, but the old ViewCreator is allowed to send out a view announcing a new member. The new coordinator manages to send out a new view before the old ViewCreator sends out the new member's view. Other members ignore the old ViewCreator's view because its view ID is old. Then the reject the new member because it has an old view ID and it isn't in their membership view. initial view ID is x new coordinator prepares view x+10 old coordinator prepares view x+1 other members install x+10, reject view x+1 new member joins in view x+1 when it receives view-prepare message new member is rejected by other members because x+1 < x+10 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/ef86239f Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/ef86239f Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/ef86239f Branch: refs/heads/develop Commit: ef86239f872c12c0aad38d5ae3044e22fd5e87af Parents: ac3a822 Author: Bruce Schuchardt Authored: Fri Dec 9 14:01:46 2016 -0800 Committer: Bruce Schuchardt Committed: Fri Dec 9 14:01:46 2016 -0800 -- .../membership/gms/membership/GMSJoinLeave.java | 86 .../gms/messages/JoinResponseMessage.java | 7 ++ .../geode/distributed/LocatorJUnitTest.java | 3 + .../gms/membership/GMSJoinLeaveJUnitTest.java | 67 +-- 4 files changed, 119 insertions(+), 44 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/ef86239f/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java index 6d782b1..4ee3011 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java @@ -803,13 +803,6 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler { return newView; } - private void sendJoinResponses(NetView newView, List newMbrs) { -for (InternalDistributedMember mbr : newMbrs) { - JoinResponseMessage response = new JoinResponseMessage(mbr, newView, 0); - services.getMessenger().send(response); -} - } - private void sendRemoveMessages(List removals, List reasons, Set oldIds) { Iterator reason = reasons.iterator(); @@ -826,11 +819,19 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler { boolean prepareView(NetView view, List newMembers) throws InterruptedException { +if (services.getCancelCriterion().isCancelInProgress() +|| services.getManager().shutdownInProgress()) { + throw new InterruptedException("shutting down"); +} return sendView(view, true, this.prepareProcessor); } void sendView(NetView view, List newMembers) throws InterruptedException { +if (services.getCancelCriterion().isCancelInProgress() +|| services.getManager().shutdownInProgress()) { + throw new InterruptedException("shutting down"); +} sendView(view, false, this.viewProcessor); } @@ -1401,7 +1402,9 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler { for (Iterator it = viewRequests.iterator(); it.hasNext();) { DistributionMessage m = it.next(); if (m instanceof JoinRequestMessage) { - it.remove(); + if (currentView.contains(((JoinRequestMessage) m).getMemberID())) { +it.remove(); + } } else if (m instanceof LeaveRequestMessage) { if (!currentView.contains(((LeaveRequestMessage) m).getMemberID())) { it.remove(); @@ -1500,6 +1503,11 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler { if (viewCreator != null && !viewCreator.isShutdown()) { logger.debug("Shutting down ViewCreator"); viewCreator.shutdown(); + try { +viewCreator.join(1000); + } catch (InterruptedException e) { +Thread.currentThread().interrupt(); + } } } @@ -1641,8 +1649,6 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler { services.getMessenger().addHandler(ViewAckMessage.class, this); services.getMessenger().addHandler(LeaveRequestMess
geode git commit: Update website release references to remove incubator
Repository: geode Updated Branches: refs/heads/develop 09184881a -> ac3a82241 Update website release references to remove incubator The release location has changed due to TLP. After the next release, we should also update the archives location on the release page. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/ac3a8224 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/ac3a8224 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/ac3a8224 Branch: refs/heads/develop Commit: ac3a8224170c48358dba706d4704058eaf53608f Parents: 0918488 Author: Anthony Baker Authored: Fri Dec 9 12:47:56 2016 -0800 Committer: Anthony Baker Committed: Fri Dec 9 12:49:34 2016 -0800 -- geode-site/website/content/releases/index.html | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/ac3a8224/geode-site/website/content/releases/index.html -- diff --git a/geode-site/website/content/releases/index.html b/geode-site/website/content/releases/index.html index de0335d..8947839 100644 --- a/geode-site/website/content/releases/index.html +++ b/geode-site/website/content/releases/index.html @@ -39,10 +39,10 @@ under the License. --> Binaries - [ http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.asc";>PGP ] - - [http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.asc";>PGP ] + [ http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.asc";>PGP ] - + [http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.asc";>PGP ] Binary downloads are provided for the convenience of our users and are not official Apache Geode releases. @@ -51,11 +51,11 @@ under the License. --> Source - [ http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.asc";>PGP + [ http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.asc";>PGP ] - - [http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.asc";>PGP + [http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.asc";>PGP ] @@ -98,10 +98,10 @@ under the License. -->
geode git commit: Update website release references to remove incubator
Repository: geode Updated Branches: refs/heads/asf-site 53896567b -> a08e92e91 Update website release references to remove incubator The release location has changed due to TLP. After the next release, we should also update the archives location on the release page. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a08e92e9 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a08e92e9 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a08e92e9 Branch: refs/heads/asf-site Commit: a08e92e919b92dfd4a74a3043dbb451a768849be Parents: 5389656 Author: Anthony Baker Authored: Fri Dec 9 13:13:50 2016 -0800 Committer: Anthony Baker Committed: Fri Dec 9 13:13:50 2016 -0800 -- releases/index.html | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/a08e92e9/releases/index.html -- diff --git a/releases/index.html b/releases/index.html index 48bd549..47e0cb2 100644 --- a/releases/index.html +++ b/releases/index.html @@ -135,10 +135,10 @@ under the License. --> Binaries - [ http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.asc";>PGP ] - - [http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.asc";>PGP ] + [ http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.asc";>PGP ] - + [http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.asc";>PGP ] Binary downloads are provided for the convenience of our users and are not official Apache Geode releases. @@ -147,11 +147,11 @@ under the License. --> Source - [ http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.asc";>PGP + [ http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip";>ZIP, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.asc";>PGP ] - - [http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.sha256";>SHA-256, - https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.asc";>PGP + [http://apache.org/dyn/closer.cgi/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz";>TAR.GZ, https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.sha256";>SHA-256, + https://dist.apache.org/repos/dist/release/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.asc";>PGP ] @@ -194,10 +194,10 @@ under the License. --> Project releases are approved by vote of the Apache Geode Project Management Committee (PMC). Support for a release is provided by project v
geode git commit: GEODE-2186: Changing the gateway status to only looking running status
Repository: geode Updated Branches: refs/heads/develop adfd41f43 -> 09184881a GEODE-2186: Changing the gateway status to only looking running status Gateway senders may or may not be connected, depending on what is going on with the underlying queue. If a sender is a secondary, it may be disconnected because it doesn't need to send anything. Even primaries may be disconnected for periods of time if the connection is lost when there is nothing in the queue. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/09184881 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/09184881 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/09184881 Branch: refs/heads/develop Commit: 09184881aec9250fdf2e96f4fced4dedaac0bda7 Parents: adfd41f Author: Dan Smith Authored: Tue Dec 6 16:52:24 2016 -0800 Committer: Dan Smith Committed: Fri Dec 9 11:11:26 2016 -0800 -- .../internal/beans/DistributedSystemBridge.java | 4 +--- .../geode/management/WANManagementDUnitTest.java| 16 +++- 2 files changed, 8 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/09184881/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java index 3016277..5b8c115 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java @@ -1566,10 +1566,8 @@ public class DistributedSystemBridge { GatewaySenderMXBean bean = it.next(); Integer dsId = bean.getRemoteDSId(); if (dsId != null) { - senderMap.put(dsId.toString(), bean.isConnected()); + senderMap.merge(dsId.toString(), bean.isRunning(), Boolean::logicalAnd); } - - } return senderMap; http://git-wip-us.apache.org/repos/asf/geode/blob/09184881/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java -- diff --git a/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java index 3cc37eb..dc801be 100644 --- a/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java +++ b/geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java @@ -38,7 +38,6 @@ import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.wan.WANTestBase; import org.apache.geode.management.internal.MBeanJMXAdapter; import org.apache.geode.test.dunit.Host; -import org.apache.geode.test.dunit.LogWriterUtils; import org.apache.geode.test.dunit.SerializableRunnable; import org.apache.geode.test.dunit.VM; @@ -54,9 +53,6 @@ public class WANManagementDUnitTest extends ManagementTestBase { private static final long serialVersionUID = 1L; - - public static MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer; - public WANManagementDUnitTest() throws Exception { super(); } @@ -91,6 +87,7 @@ public class WANManagementDUnitTest extends ManagementTestBase { managing.invoke(() -> WANTestBase.createManagementCache(punePort)); startManagingNode(managing); + // keep a larger batch to minimize number of exception occurrences in the // log puneSender @@ -104,6 +101,7 @@ public class WANManagementDUnitTest extends ManagementTestBase { managing.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + "_PR", "pn", 1, 100, false)); + nyReceiver.invoke(() -> WANTestBase.createCache(nyPort)); nyReceiver.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + "_PR", null, 1, 100, false)); @@ -314,11 +312,11 @@ public class WANManagementDUnitTest extends ManagementTestBase { if (service.isManager()) { DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean(); - Map dsMap = dsBean.viewRemoteClusterStatus(); - - LogWriterUtils.getLogWriter() - .info(" Ds Map is: " + dsMap + " "); - + Awaitility.await().atMost(1, TimeUnit.MINUTES).until(() -> { +Map dsMap = dsBean.viewRemoteClusterStatus(); +dsMap.entrySet().stream() +.forEach(entry -> assertTrue("Should be true " + entry.getKey(), entry.getValue())); + }); } }
geode git commit: [GEODE-2196] Add test for Cluster Config. Refactor LocatorServerStartupRule.
Repository: geode Updated Branches: refs/heads/develop 213d8bc1c -> adfd41f43 [GEODE-2196] Add test for Cluster Config. Refactor LocatorServerStartupRule. * Add ClusterConfigDUnitTest * Refactor LocatorServerStartupRule * this closes #309 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/adfd41f4 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/adfd41f4 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/adfd41f4 Branch: refs/heads/develop Commit: adfd41f437d2a30255ae8368e355b497d6bb0164 Parents: 213d8bc Author: Jared Stewart Authored: Thu Dec 8 15:03:54 2016 -0800 Committer: Jinmei Liao Committed: Fri Dec 9 09:47:07 2016 -0800 -- .../internal/DistributionConfig.java| 2 +- .../internal/DistributionConfigImpl.java| 2 +- .../ConnectToLocatorSSLDUnitTest.java | 6 +- .../configuration/ClusterConfigDUnitTest.java | 243 +++ .../ClusterConfigWithoutSecurityDUnitTest.java | 8 +- .../security/PeerAuthenticatorDUnitTest.java| 12 +- ...eerSecurityWithEmbeddedLocatorDUnitTest.java | 18 +- .../SecurityClusterConfigDUnitTest.java | 13 +- .../SecurityWithoutClusterConfigDUnitTest.java | 7 +- .../security/StartServerAuthorizationTest.java | 33 ++- .../dunit/rules/LocatorServerStartupRule.java | 108 + .../test/dunit/rules/LocatorStarterRule.java| 11 +- .../apache/geode/test/dunit/rules/Member.java | 62 + .../test/dunit/rules/ServerStarterRule.java | 32 ++- .../internal/configuration/cluster_config.zip | Bin 0 -> 4666 bytes .../LuceneClusterConfigurationDUnitTest.java| 48 ++-- 16 files changed, 474 insertions(+), 131 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/adfd41f4/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java index 5eb070d..c2a395d 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java @@ -384,7 +384,7 @@ public interface DistributionConfig extends Config, LogConfig { * Default will be the current working directory as determined by * System.getProperty("user.dir"). */ - File DEFAULT_DEPLOY_WORKING_DIR = new File("."); + File DEFAULT_DEPLOY_WORKING_DIR = new File(System.getProperty("user.dir")); /** * Returns the value of the {@link ConfigurationProperties#USER_COMMAND_PACKAGES} property http://git-wip-us.apache.org/repos/asf/geode/blob/adfd41f4/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java index 0c6603d..fa6d13f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java @@ -124,7 +124,7 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement */ private File logFile = DEFAULT_LOG_FILE; - protected File deployWorkingDir = DEFAULT_DEPLOY_WORKING_DIR; + protected File deployWorkingDir = new File(System.getProperty("user.dir")); /** * The level at which log messages are logged http://git-wip-us.apache.org/repos/asf/geode/blob/adfd41f4/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java index 751425a..142ce17 100644 --- a/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java @@ -83,14 +83,14 @@ public class ConnectToLocatorSSLDUnitTest extends JUnit4DistributedTestCase { } public void setUpLocatorAndConnect(Properties securityProps) throws Exception { -lsRule.getLocatorVM(0, securityProps); +lsRule.startLocatorVM(0, securityProps); // saving the securityProps to a file OutputStream out = new FileOutputStream(securityPropsFile); securityProp
[4/4] geode git commit: GEODE-1984: Fix Issue Make GatewaySender destroy a public API
GEODE-1984: Fix Issue Make GatewaySender destroy a public API 1. Making destory API public 2. Added a new gfsh WAN command destroyGatewaySender 3. Impleted GatewaySenderDestroyFunction, which first stop gatewaysender and then call destroy on the same. 4. Added a WAN Rest Controller for destroy gatewaysender 5. Removed the need of explicit casting of sender to AbstractGatewaySender for calling destroy API 6. Renamed Test WanCommandCreateGatewaySenderDUnitTest to WanCommandCreateDestroyGatewaySenderDUnitTest 7. Each applicable test now also calls destroy gfsh command and verfies the result 8. Minor changes in the logging for each tests Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/0eb952a6 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/0eb952a6 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/0eb952a6 Branch: refs/heads/develop Commit: 0eb952a6e5524c66c8520c9e0d8cf09780ef8624 Parents: 1d951e3 Author: adongre Authored: Sat Dec 3 19:38:39 2016 +0530 Committer: adongre Committed: Fri Dec 9 05:08:36 2016 +0530 -- .../internal/AsyncEventQueueImpl.java | 2 +- .../apache/geode/cache/wan/GatewaySender.java | 15 + .../cache/wan/AbstractGatewaySender.java| 1 + .../internal/cli/commands/WanCommands.java | 59 +- .../functions/GatewaySenderDestroyFunction.java | 90 ++ .../GatewaySenderDestroyFunctionArgs.java | 33 + .../internal/cli/i18n/CliStrings.java | 18 + .../controllers/ShellCommandsController.java| 2 + .../web/controllers/WanCommandsController.java | 24 + .../codeAnalysis/sanctionedSerializables.txt| 2 + .../cli/commands/golden-help-offline.properties | 21 + .../cli/commands/golden-help-online.properties | 6 + .../geode/internal/cache/wan/WANTestBase.java | 2 +- .../wan/wancommand/WANCommandTestBase.java | 35 + ...mandCreateDestroyGatewaySenderDUnitTest.java | 921 +++ .../WanCommandCreateGatewaySenderDUnitTest.java | 663 - 16 files changed, 1223 insertions(+), 671 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/0eb952a6/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java index a5f0497..2eb53be 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java @@ -191,7 +191,7 @@ public class AsyncEventQueueImpl implements AsyncEventQueue { } public void destroy() { -((AbstractGatewaySender) this.sender).destroy(); +this.sender.destroy(); } public boolean isBucketSorted() { http://git-wip-us.apache.org/repos/asf/geode/blob/0eb952a6/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java b/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java index d950ef3..f9f8f91 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java +++ b/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java @@ -400,4 +400,19 @@ public interface GatewaySender { public int getMaxParallelismForReplicatedRegion(); + + /** + * Destroys the GatewaySender. Before destroying the sender, caller needs to to ensure that the + * sender is stopped so that all the resources (threads, connection pool etc.) will be released + * properly. Stopping the sender is not handled in the destroy. Destroy is carried out in + * following steps: 1. Take the lifeCycleLock. 2. If the sender is attached to any application + * region, throw an exception. 3. Close the GatewaySenderAdvisor. 4. Remove the sender from the + * cache. 5. Destroy the region underlying the GatewaySender. + * + * In case of ParallelGatewaySender, the destroy operation does distributed destroy of the QPR. In + * case of SerialGatewaySender, the queue region is destroyed locally. + */ + public void destroy(); + + } http://git-wip-us.apache.org/repos/asf/geode/blob/0eb952a6/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java b/geode-core/src/
[2/4] geode git commit: GEODE-1984: Addressed review comments, Removed copy pasted repeating code and moved it into a separate method.
GEODE-1984: Addressed review comments, Removed copy pasted repeating code and moved it into a separate method. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/f522f6ca Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/f522f6ca Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/f522f6ca Branch: refs/heads/develop Commit: f522f6ca6a3fd362e5d6657ef451743a68a4c0dc Parents: 0eb952a Author: adongre Authored: Thu Dec 8 12:53:05 2016 +0530 Committer: adongre Committed: Fri Dec 9 05:08:36 2016 +0530 -- .../apache/geode/cache/wan/GatewaySender.java | 16 +- .../functions/GatewaySenderDestroyFunction.java | 2 +- .../codeAnalysis/sanctionedSerializables.txt| 2 +- .../wan/wancommand/WANCommandTestBase.java | 4 +- ...mandCreateDestroyGatewaySenderDUnitTest.java | 265 +-- 5 files changed, 79 insertions(+), 210 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/f522f6ca/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java b/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java index f9f8f91..1dc1fb1 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java +++ b/geode-core/src/main/java/org/apache/geode/cache/wan/GatewaySender.java @@ -402,17 +402,15 @@ public interface GatewaySender { /** - * Destroys the GatewaySender. Before destroying the sender, caller needs to to ensure that the - * sender is stopped so that all the resources (threads, connection pool etc.) will be released - * properly. Stopping the sender is not handled in the destroy. Destroy is carried out in - * following steps: 1. Take the lifeCycleLock. 2. If the sender is attached to any application - * region, throw an exception. 3. Close the GatewaySenderAdvisor. 4. Remove the sender from the - * cache. 5. Destroy the region underlying the GatewaySender. + * Destroys the GatewaySender. * - * In case of ParallelGatewaySender, the destroy operation does distributed destroy of the QPR. In - * case of SerialGatewaySender, the queue region is destroyed locally. + * In case of ParallelGatewaySender, the destroy operation does distributed destroy of the Queue + * Region. In case of SerialGatewaySender, the Queue Region is destroyed locally. + * + * @since Geode 1.1 + * */ - public void destroy(); + void destroy(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f522f6ca/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/GatewaySenderDestroyFunction.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/GatewaySenderDestroyFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/GatewaySenderDestroyFunction.java index ba393fe..2873633 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/GatewaySenderDestroyFunction.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/GatewaySenderDestroyFunction.java @@ -28,7 +28,7 @@ import org.apache.geode.management.internal.cli.i18n.CliStrings; import org.apache.logging.log4j.Logger; public class GatewaySenderDestroyFunction extends FunctionAdapter implements InternalEntity { - private static final long serialVersionUID = 1459761440357690134L; + private static final long serialVersionUID = 1L; private static final Logger logger = LogService.getLogger(); private static final String ID = GatewaySenderDestroyFunction.class.getName(); http://git-wip-us.apache.org/repos/asf/geode/blob/f522f6ca/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt -- diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt index 5ce46bf..1aac8c2 100644 --- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt +++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt @@ -569,7 +569,7 @@ org/apache/geode/management/internal/cli/functions/GarbageCollectionFunction,tru org/apache/geode/management/internal/cli/functions/GatewayReceiverCreateFunction,true,8746830191680509335 org/apache/geode/management/internal/cli/functions/GatewayReceiverFunctionArgs,true,-5158224572470173267,bindAddress:java/lang/String,endPort:java/lang/Integer,g
[1/4] geode git commit: Merge branch 'bugfix/GEODE-1984' into develop
Repository: geode Updated Branches: refs/heads/develop 1d951e334 -> 213d8bc1c Merge branch 'bugfix/GEODE-1984' into develop Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/213d8bc1 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/213d8bc1 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/213d8bc1 Branch: refs/heads/develop Commit: 213d8bc1c3ad85365d7860e3a5d8ea334691cdd4 Parents: 1d951e3 f522f6c Author: adongre Authored: Fri Dec 9 05:08:36 2016 +0530 Committer: adongre Committed: Fri Dec 9 05:08:36 2016 +0530 -- .../internal/AsyncEventQueueImpl.java | 2 +- .../apache/geode/cache/wan/GatewaySender.java | 13 + .../cache/wan/AbstractGatewaySender.java| 1 + .../internal/cli/commands/WanCommands.java | 59 +- .../functions/GatewaySenderDestroyFunction.java | 90 +++ .../GatewaySenderDestroyFunctionArgs.java | 33 + .../internal/cli/i18n/CliStrings.java | 18 + .../controllers/ShellCommandsController.java| 2 + .../web/controllers/WanCommandsController.java | 24 + .../codeAnalysis/sanctionedSerializables.txt| 2 + .../cli/commands/golden-help-offline.properties | 21 + .../cli/commands/golden-help-online.properties | 6 + .../geode/internal/cache/wan/WANTestBase.java | 2 +- .../wan/wancommand/WANCommandTestBase.java | 33 + ...mandCreateDestroyGatewaySenderDUnitTest.java | 794 +++ .../WanCommandCreateGatewaySenderDUnitTest.java | 663 16 files changed, 1092 insertions(+), 671 deletions(-) --
[3/4] geode git commit: GEODE-1984: Fix Issue Make GatewaySender destroy a public API
http://git-wip-us.apache.org/repos/asf/geode/blob/0eb952a6/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java -- diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java deleted file mode 100644 index db9aa91..000 --- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java +++ /dev/null @@ -1,663 +0,0 @@ -/* - * 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.wan.wancommand; - -import org.apache.geode.cache.wan.GatewaySender; -import org.apache.geode.cache.wan.GatewaySender.OrderPolicy; -import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.internal.cache.wan.GatewaySenderException; -import org.apache.geode.management.cli.Result; -import org.apache.geode.management.internal.cli.i18n.CliStrings; -import org.apache.geode.management.internal.cli.result.CommandResult; -import org.apache.geode.management.internal.cli.result.TabularResultData; -import org.apache.geode.test.dunit.IgnoredException; -import org.apache.geode.test.junit.categories.DistributedTest; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import static org.apache.geode.distributed.ConfigurationProperties.*; -import static org.apache.geode.test.dunit.Assert.*; -import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter; - -@Category(DistributedTest.class) -public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase { - - private static final long serialVersionUID = 1L; - - private CommandResult executeCommandWithIgnoredExceptions(String command) { -final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect"); -try { - CommandResult commandResult = executeCommand(command); - return commandResult; -} finally { - exln.remove(); -} - } - - - /** - * GatewaySender with all default attributes - */ - @Test - public void testCreateGatewaySenderWithDefault() { - -Integer punePort = (Integer) vm1.invoke(() -> createFirstLocatorWithDSId(1)); - -Properties props = getDistributedSystemProperties(); -props.setProperty(MCAST_PORT, "0"); -props.setProperty(DISTRIBUTED_SYSTEM_ID, "1"); -props.setProperty(LOCATORS, "localhost[" + punePort + "]"); -setUpJmxManagerOnVm0ThenConnect(props); - -Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); - -vm3.invoke(() -> createCache(punePort)); -vm4.invoke(() -> createCache(punePort)); -vm5.invoke(() -> createCache(punePort)); - -String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID -+ "=ln" + " --" + CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID + "=2"; -CommandResult cmdResult = executeCommandWithIgnoredExceptions(command); -if (cmdResult != null) { - String strCmdResult = commandResultToString(cmdResult); - getLogWriter().info("testCreateGatewaySender stringResult : " + strCmdResult + ""); - assertEquals(Result.Status.OK, cmdResult.getStatus()); - - TabularResultData resultData = (TabularResultData) cmdResult.getResultData(); - List status = resultData.retrieveAllValues("Status"); - assertEquals(5, status.size()); - for (int i = 0; i < status.size(); i++) { -assertTrue("GatewaySender creation failed with: " + status.get(i), -status.get(i).indexOf("ERROR:") == -1); - } -} else { - fail("testCreateGatewaySender failed as did not get CommandResult"); -} - -vm3.invoke(() -> verifySenderState("ln", true, false)); -vm4.invoke(() -> verifySenderState("ln", true, false)); -vm5.invoke(() -> verifySenderState("ln", true, false)); - } - - /** - * GatewaySender with given attribute values -