[geode] branch feature/introduce-codeowners updated: nominate myself as codeowner for dependency, license, and release scripts (#5802)

2020-12-07 Thread onichols
This is an automated email from the ASF dual-hosted git repository.

onichols pushed a commit to branch feature/introduce-codeowners
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/introduce-codeowners 
by this push:
 new 99a03d5  nominate myself as codeowner for dependency, license, and 
release scripts (#5802)
99a03d5 is described below

commit 99a03d51a6ef764531ed9cb101edb8b67720ed02
Author: Owen Nichols <34043438+onichols-pivo...@users.noreply.github.com>
AuthorDate: Mon Dec 7 16:53:14 2020 -0800

nominate myself as codeowner for dependency, license, and release scripts 
(#5802)
---
 CODEOWNERS | 29 +++--
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/CODEOWNERS b/CODEOWNERS
index 4b4115c..54fc390 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -1,3 +1,19 @@
+# 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.
+
 #
 # CODEOWNERS and .asf.yml - owned by everyone
 #
@@ -268,10 +284,11 @@ CODEOWNERS @apache/geode-committers
 #etc/**
 #build.gradle
 #buildSrc/**
-#ci/**
-#dev-tools/**
-#docker/**
-#etc/**
+buildSrc/**/DependencyConstraints.groovy @onichols-pivotal
+ci/**@onichols-pivotal
+dev-tools/** @onichols-pivotal
+docker/**@onichols-pivotal
+geode-management/src/test/script/update-management-wiki.sh   @onichols-pivotal
 #boms/**
 #*gradle*
 #static-analysis/**
@@ -286,7 +303,7 @@ CODEOWNERS @apache/geode-committers
 #geode-docs/**
 #BUILDING.md
 #CODE_OF_CONDUCT.md
-#LICENSE
-#NOTICE
+LICENSE  @onichols-pivotal
+NOTICE   @onichols-pivotal
 #README.md
 #TESTING.md



[geode] branch develop updated: GEODE-8329: Fix for durable CQ reqistration recovery (#5360)

2020-12-07 Thread mkevo
This is an automated email from the ASF dual-hosted git repository.

mkevo 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 38139fb  GEODE-8329: Fix for durable CQ reqistration recovery (#5360)
38139fb is described below

commit 38139fbb00cbea872348d3554f9589bd7c5bfdde
Author: Jakov Varenina <62134331+jvaren...@users.noreply.github.com>
AuthorDate: Mon Dec 7 12:35:49 2020 +0100

GEODE-8329: Fix for durable CQ reqistration recovery (#5360)

* GEODE-8329: Fix for durable CQ reqistration recovery

This change solves the issue when the client without configured HA is
wrongly re-registering durable CQs as non durable during the server
failover.

* Fix for stressTest

* empty commit to re-launch CI
---
 .../cache/client/internal/QueueManagerImpl.java|   3 +-
 .../tier/sockets/DurableClientCQDUnitTest.java | 139 +
 .../cache/tier/sockets/DurableClientTestBase.java  |  52 ++--
 3 files changed, 183 insertions(+), 11 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
 
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
index 212d2de..145817c 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
@@ -1112,7 +1112,8 @@ public class QueueManagerImpl implements QueueManager {
 .set(((DefaultQueryService) 
this.pool.getQueryService()).getUserAttributes(name));
   }
   try {
-if (((CqStateImpl) cqi.getState()).getState() != CqStateImpl.INIT) {
+if (((CqStateImpl) cqi.getState()).getState() != CqStateImpl.INIT
+&& cqi.isDurable() == isDurable) {
   cqi.createOn(recoveredConnection, isDurable);
 }
   } finally {
diff --git 
a/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientCQDUnitTest.java
 
b/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientCQDUnitTest.java
index 4b24be9..cc171eb 100644
--- 
a/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientCQDUnitTest.java
+++ 
b/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientCQDUnitTest.java
@@ -18,6 +18,7 @@ package org.apache.geode.internal.cache.tier.sockets;
 import static org.apache.geode.cache.Region.SEPARATOR;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.apache.geode.test.dunit.NetworkUtils.getServerHostName;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -51,10 +52,13 @@ import org.apache.geode.distributed.internal.ServerLocation;
 import org.apache.geode.distributed.internal.ServerLocationAndMemberId;
 import org.apache.geode.internal.cache.ClientServerObserverAdapter;
 import org.apache.geode.internal.cache.ClientServerObserverHolder;
+import org.apache.geode.test.awaitility.GeodeAwaitility;
 import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.IgnoredException;
+import org.apache.geode.test.dunit.NetworkUtils;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 
 @Category({ClientSubscriptionTest.class})
@@ -145,6 +149,107 @@ public class DurableClientCQDUnitTest extends 
DurableClientTestBase {
   }
 
   /**
+   * Test that durable CQ is correctly re-registered to new server after the 
failover and
+   * that the durable client functionality works as expected.
+   * Steps:
+   * 1. Start two servers
+   * 2. Start durable client without HA and register durable CQs
+   * 3. Shutdown the server that is hosting CQs subscription queue (primary 
server)
+   * 4. Wait for the durable client to perform the failover to the another 
server
+   * 5. Shutdown the durable client with keepAlive flag set to true
+   * 6. Provision remaining server with the data that should fulfil CQ 
condition and fill the queue
+   * 7. Start the durable client again and check that it receives correct 
events from queue
+   */
+  @Test
+  public void testDurableCQServerFailoverWithoutHAConfigured()
+  throws Exception {
+String greaterThan5Query = "select * from " + SEPARATOR + regionName + " p 
where p.ID > 5";
+String allQuery = "select * from " + SEPARATOR + regionName + " p where 
p.ID > -1";
+String lessThan5Query = "select * from " + SEPARATOR + regionName + " p 
where p.ID < 5";
+
+// Start a server 1
+ 

[geode] branch develop updated: GEODE-8742: fix list gateways command when dispatcher-threads is set … (#5803)

2020-12-07 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac 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 1714cb3  GEODE-8742: fix list gateways command when dispatcher-threads 
is set … (#5803)
1714cb3 is described below

commit 1714cb3c03f8319f68729382714ff366b7ca9cb6
Author: Mario Kevo <48509719+mk...@users.noreply.github.com>
AuthorDate: Mon Dec 7 10:27:52 2020 +0100

GEODE-8742: fix list gateways command when dispatcher-threads is set … 
(#5803)

* GEODE-8742: fix list gateways command when dispatcher-threads is set to 1

* empty commit to re-launch CI

* using CommandStringBuilder instead of hard-coding command

* small test change

* empty commit to re-launch CI

* empty commit to re-launch CI
---
 .../internal/beans/GatewaySenderMBeanBridge.java   | 18 ++---
 .../wancommand/ListGatewaysCommandDUnitTest.java   | 30 ++
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBeanBridge.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBeanBridge.java
index 7eda2b4..c07802b 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBeanBridge.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBeanBridge.java
@@ -324,10 +324,20 @@ public class GatewaySenderMBeanBridge {
 }
   }
 } else {
-  ConcurrentSerialGatewaySenderEventProcessor cProc =
-  (ConcurrentSerialGatewaySenderEventProcessor) 
((AbstractGatewaySender) sender)
-  .getEventProcessor();
-  for (SerialGatewaySenderEventProcessor lProc : cProc.getProcessors()) {
+  if (getDispatcherThreads() > 1) {
+ConcurrentSerialGatewaySenderEventProcessor cProc =
+(ConcurrentSerialGatewaySenderEventProcessor) 
((AbstractGatewaySender) sender)
+.getEventProcessor();
+for (SerialGatewaySenderEventProcessor lProc : cProc.getProcessors()) {
+  if (lProc.getDispatcher() != null && 
lProc.getDispatcher().isConnectedToRemote()) {
+this.dispatcher = lProc.getDispatcher();
+return true;
+  }
+}
+  } else {
+SerialGatewaySenderEventProcessor lProc =
+(SerialGatewaySenderEventProcessor) ((AbstractGatewaySender) 
sender)
+.getEventProcessor();
 if (lProc.getDispatcher() != null && 
lProc.getDispatcher().isConnectedToRemote()) {
   this.dispatcher = lProc.getDispatcher();
   return true;
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/wancommand/ListGatewaysCommandDUnitTest.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/wancommand/ListGatewaysCommandDUnitTest.java
index ba1de8e..b90159c 100644
--- 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/wancommand/ListGatewaysCommandDUnitTest.java
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/wancommand/ListGatewaysCommandDUnitTest.java
@@ -35,6 +35,7 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.management.GatewayReceiverMXBean;
+import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
 import org.apache.geode.management.internal.i18n.CliStrings;
 import org.apache.geode.test.awaitility.GeodeAwaitility;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
@@ -450,6 +451,35 @@ public class ListGatewaysCommandDUnitTest implements 
Serializable {
 
.hasRowSize(expectedGwReceiverSectionSize).hasColumns().contains("Port", 
"Member");
   }
 
+  @Test
+  public void testListGatewaysWithOneDispatcherThread() {
+String command = new CommandStringBuilder(CliStrings.CREATE_GATEWAYSENDER)
+.addOption(CliStrings.CREATE_GATEWAYSENDER__ID, "ln_Serial")
+.addOption(CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID, 
"2")
+.addOption(CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS, "1")
+.getCommandString();
+
+int lnPort = locatorSite1.getPort();
+
+// setup servers in Site #1 (London)
+server1 = clusterStartupRule.startServerVM(3, lnPort);
+server2 = clusterStartupRule.startServerVM(4, lnPort);
+server3 = clusterStartupRule.startServerVM(5, lnPort);
+
+gfsh.executeAndAssertThat(command).statusIsSuccess();
+
+gfsh.executeAndAssertThat(CliStrings.LIST_GATEWAY).statusIsSuccess()
+.hasTableSection("gatewaySenders")
+.hasRowSize(3).hasColumn("Status").contains("Running, not Connected");
+
+gfsh.executeAndAssertThat(
+CliStrings.LIST_GATEWAY + " --" + 
CliStrings.LIST_GATEWAY__SHOW_SENDERS_ONLY)
+