[geode] branch develop updated: Adding the PGP keys for Mario Kevo with apache ID (#7863)

2022-09-27 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 76b647f3aa Adding the PGP keys for Mario Kevo with apache ID (#7863)
76b647f3aa is described below

commit 76b647f3aa0572f330e88a9946af73a5e920e1e6
Author: Mario Kevo <48509719+mk...@users.noreply.github.com>
AuthorDate: Tue Sep 27 13:28:18 2022 +0200

Adding the PGP keys for Mario Kevo with apache ID (#7863)
---
 KEYS | 38 ++
 1 file changed, 38 insertions(+)

diff --git a/KEYS b/KEYS
index 7e212a486e..de81511da5 100644
--- a/KEYS
+++ b/KEYS
@@ -1768,3 +1768,41 @@ Pmm2dVyNptU2+K50ACDOyHXfYjpQx1T4G1P9pw==
 =YieM
 -END PGP PUBLIC KEY BLOCK-
 
+pub   rsa2048 2022-09-08 [SC]
+  1A3694A1448840FC3B1137B2CAE347D5AE2E5C93
+uid   [ultimate] Mario Kevo 
+sig 3CAE347D5AE2E5C93 2022-09-08  Mario Kevo 
+sub   rsa2048 2022-09-08 [E]
+sig  CAE347D5AE2E5C93 2022-09-08  Mario Kevo 
+
+-BEGIN PGP PUBLIC KEY BLOCK-
+
+mQENBGMZiSYBCADaCbcnRY5amANlEz7MlzHHeJcbypwbFQgsMF83g3tWwUDa+1dW
++FCgulpr74AD1JSqwgqRqr8pc0FvQV4ZabjPKLGz6u4YTER5xCuafcQ219wsQm55
+pKUwzTF56aFaazO99JRgVZYIbEUZ6sJDyPCY2L0YSGZn26qGj8bljs1Vrqu9LJxN
+c52jfZN6kQwJrCDRG1qLzeWWlIyYiJXoYPe4c3vPvKdZ7P4qMeU+MbZThyFKS04n
+D8I9MTWfWRLVJWVv//BzkmleoLfc0N6onIMZ5p1br/TlL7r9aOyF1ICBjU0ma3R0
+GW3QjIJpSvMKG95osOSlVV7I+YooAI8T6ImpABEBAAG0HU1hcmlvIEtldm8gPG1r
+ZXZvQGFwYWNoZS5vcmc+iQFOBBMBCgA4FiEEGjaUoUSIQPw7ETeyyuNH1a4uXJMF
+AmMZiSYCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQyuNH1a4uXJP6EQgA
+kSnWwugXEIg1gVWKd/EEIJ9nWrzsU5Fg3eH5cFX8Vhs9D5gc1A/VmGkQEswDPyTA
+C8W86JKz63BJ6yzpZBhcooyrQec7EgBk2+54iRkS2AZ4wNQ7kun5dHOqD6gPGwYI
+49n2aS+lMr796Fw47JEbdbWfk063QQWn1R6GDDAMvgNBhU36zxKScHc8EX+Cqgck
+Kw7doqME/an2XwEks4Akpdkr4LInyzLb3Xx+veKZS4EKjcmxNrb488vwtUa7Kr1X
+i7XXvDA2lfSN4NqADnQr05Gk7jjsWHJtvTsOgg3/hpqunl5oy69rc8WwLoVtzVp2
+8lrJk+ORuLdcagBCVb8CMbkBDQRjGYkmAQgAzLrBYaVTXwkvr7nTAJ6RlsBdEiYT
+FXu/0AmGtHnunBO3uaNYGIhDQTYavaN9qLBrMAqcvo0/lpW5pJG5tDrenfm6IMan
+XJ4WGA9THkFiMiguo9TrTwIx5M7/LjSFjK325napJHysP9czT+2pG21BPTgZW6QO
+rNw+3XOaziz7Dv9GH2VnNtikmXVvmDRo1SlNzJVrvIX7fn/szpzps8OQ8pqoBoIr
+Kr4UCVNN419Q4wq5gYPyGwsZ0vXyj8Mch1B9TMTFQxh1HDaLsFSE0Tj3opfgrPdX
+paa2x+KJqPUM7c9eQp1bVPaBtampxXiao3D3aAUkKZ4zX7zmntzyo6hyAwARAQAB
+iQE2BBgBCgAgFiEEGjaUoUSIQPw7ETeyyuNH1a4uXJMFAmMZiSYCGwwACgkQyuNH
+1a4uXJNxcQf/f4KXDaSsLrEg4S8ayq2ck4f5YGEC2pc/bXxafhJ4Ra2myTM/1KTM
+kbqMrkA64uXe6IgMgqhG6VqeXy1sODvkIxZvstmfw+D+mwd0TyFWzvvzzyQdei37
+sHYdXT/rE+5IcuqwOqwVoFA2XDO6PksLtIcFbl868NVlEKU3rBW9Z5xgo3lcr5pR
+c+WqL6XiOGnapvv6/Ac2jeawmKNR3Hh0HSnEgS/jbmf9POyA7JQWkxeDo8u8l7Hh
+IAyBCq+C/GdADVw3Mng9yQ6BNrFV7uip5WortNS5dyJonyx+RPFnhpNURneoVYSw
+ReHLdfM+xSILW9t8kCkcx28kYYDh9OYUPA==
+=MdLY
+-END PGP PUBLIC KEY BLOCK-
+



[geode] branch develop updated: GEODE-10331: schedule delayed CloseEndpoint (#7849)

2022-09-19 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 7d7a98b103 GEODE-10331: schedule delayed CloseEndpoint (#7849)
7d7a98b103 is described below

commit 7d7a98b10355cb25985c031bfd2a67c77f1b6e43
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Mon Sep 19 08:17:42 2022 +0200

GEODE-10331: schedule delayed CloseEndpoint (#7849)

* GEODE-10331: schedule delayed CloseEndpoint

* GEODE-10331: added TCs
---
 .../distributed/internal/DistributionImpl.java |  20 +
 .../distributed/internal/direct/DirectChannel.java |  46 ++
 .../distributed/internal/DistributionTest.java |  31 ---
 .../internal/direct/DirectChannelTest.java | 100 +
 4 files changed, 168 insertions(+), 29 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java
index fcba8e4c3e..68059bb898 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java
@@ -74,7 +74,6 @@ import 
org.apache.geode.internal.serialization.SerializationContext;
 import org.apache.geode.internal.tcp.ConnectExceptions;
 import org.apache.geode.internal.tcp.ConnectionException;
 import org.apache.geode.internal.util.Breadcrumbs;
-import org.apache.geode.logging.internal.executors.LoggingThread;
 import org.apache.geode.logging.internal.log4j.api.LogService;
 import org.apache.geode.security.AuthenticationRequiredException;
 import org.apache.geode.security.GemFireSecurityException;
@@ -648,28 +647,13 @@ public class DistributionImpl implements Distribution {
 }
   }
 
-  private void destroyMember(final InternalDistributedMember member, final 
String reason) {
+  void destroyMember(final InternalDistributedMember member, final String 
reason) {
 final DirectChannel dc = directChannel;
 if (dc != null) {
   // Bug 37944: make sure this is always done in a separate thread,
   // so that shutdown conditions don't wedge the view lock
   // fix for bug 34010
-  new LoggingThread("disconnect thread for " + member, () -> {
-try {
-  Thread.sleep(Integer.getInteger("p2p.disconnectDelay", 3000));
-} catch (InterruptedException ie) {
-  Thread.currentThread().interrupt();
-  // Keep going, try to close the endpoint.
-}
-if (!dc.isOpen()) {
-  return;
-}
-if (logger.isDebugEnabled()) {
-  logger.debug("Membership: closing connections for departed member 
{}", member);
-}
-// close connections, but don't do membership notification since it's 
already been done
-dc.closeEndpoint(member, reason, false);
-  }).start();
+  dc.scheduleCloseEndpoint(member, reason, false);
 }
   }
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
index eaac79f2b8..55108741a5 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java
@@ -24,6 +24,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.logging.log4j.Logger;
 
@@ -56,6 +59,7 @@ import org.apache.geode.internal.tcp.ConnectionException;
 import org.apache.geode.internal.tcp.MsgStreamer;
 import org.apache.geode.internal.tcp.TCPConduit;
 import org.apache.geode.internal.util.Breadcrumbs;
+import org.apache.geode.logging.internal.executors.LoggingExecutors;
 import org.apache.geode.logging.internal.log4j.api.LogService;
 
 /**
@@ -86,6 +90,11 @@ public class DirectChannel {
 
   InternalDistributedMember localAddr;
 
+  private ScheduledExecutorService closeEndpointExecutor;
+
+  private final int CLOSE_ENDPOINT_POOL_SIZE =
+  Integer.getInteger("DirectChannel.CLOSE_ENDPOINT_POOL_SIZE", 1);
+
   /**
* Callback to set the local address, must be done before this channel is 
used.
*
@@ -147,6 +156,9 @@ public class DirectChannel {
   logger.info("GemFire P2P Listener started on {}",
   conduit.getSocketId());
 
+  closeEndpointExecutor = 
LoggingExecutors.newScheduledThreadPool(CLOSE_ENDPOINT_POOL_SIZE,
+  "DirectChannel.closeEndpoint", 

[geode] branch develop updated: GEODE-10421: Improve start gw sender with clean-queue (#7856)

2022-09-16 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 c4e5a034d8 GEODE-10421: Improve start gw sender with clean-queue 
(#7856)
c4e5a034d8 is described below

commit c4e5a034d8cccb0a2814221d0cd3a8c5242e913d
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Fri Sep 16 10:40:20 2022 +0200

GEODE-10421: Improve start gw sender with clean-queue (#7856)

* GEODE-10421: added check gw status

* GEODE-10421: added TC

* GEODE-10421: add document impacts

* GEODE-10421: update after comments
---
 .../geode/management/internal/i18n/CliStrings.java |  7 ++
 .../gfsh/command-pages/start.html.md.erb   |  2 +-
 .../cli/commands/StartGatewaySenderCommand.java| 38 +
 .../StartGatewaySenderCommandDUnitTest.java| 91 ++
 4 files changed, 137 insertions(+), 1 deletion(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/i18n/CliStrings.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/i18n/CliStrings.java
index f533c77960..3734eedce4 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/i18n/CliStrings.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/i18n/CliStrings.java
@@ -3007,6 +3007,13 @@ public class CliStrings {
   public static final String GATEWAY_RECEIVER_IS_NOT_AVAILABLE_ON_MEMBER_0 =
   "GatewayReceiver is not available on member {0}";
 
+  public static final String START_GATEWAYSENDER_REJECTED = "Command rejected. 
Reasons:";
+
+  public static final String REJECT_START_GATEWAYSENDER_REASON = "Reasons 
command is rejected";
+
+  public static final String EXECUTE_ON_ALL_GATEWAYSENDER_MEMBERS =
+  "Command must be executed on all members on which gateway sender is 
created";
+
   public static final String GATEWAY_SENDER_IS_NOT_AVAILABLE = "GatewaySender 
is not available";
   public static final String GATEWAY_SENDER_0_IS_ALREADY_STARTED_ON_MEMBER_1 =
   "GatewaySender {0} is already started on member {1}";
diff --git a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb 
b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb
index f25b6b5be0..b41bfb02bb 100644
--- a/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb
+++ b/geode-docs/tools_modules/gfsh/command-pages/start.html.md.erb
@@ -121,7 +121,7 @@ start gateway-sender --id=value [--groups=value(,value)*] 
[--members=value(,valu
 | id   | *Required.* ID of the GatewaySender.
  | |
 | groups   | Group(s) of members on which to start the 
Gateway Sender. | |
 | members  | Member(s) on which to start the Gateway Sender. 
| |
-| clean-queues | Option to clean existing queue at start of the 
Gateway Sender. This option is only applicable for Gateway Senders with enabled 
persistence. | false |
+| clean-queues | Option to clean existing queue at start of the 
Gateway Sender. This option can be executed only on all members on which 
Gateway Sender is created. | false |
 
 **Example Commands:**
 
diff --git 
a/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java
 
b/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java
index 996e85be8e..d02277d4ac 100644
--- 
a/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java
+++ 
b/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java
@@ -77,6 +77,44 @@ public class StartGatewaySenderCommand extends GfshCommand {
   return ResultModel.createError(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
 }
 
+if (cleanQueues) {
+
+  GatewaySenderMXBean bean;
+  boolean commandRejected = false;
+
+  ResultModel rejectResultModel =
+  ResultModel.createError(CliStrings.START_GATEWAYSENDER_REJECTED);
+  TabularResultModel rejectResultData =
+  
rejectResultModel.addTable(CliStrings.REJECT_START_GATEWAYSENDER_REASON);
+
+  Set allServers = findMembers(null, null);
+
+  for (DistributedMember member : allServers) {
+if 
(cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId()))
 {
+  bean = service.getLocalGatewaySenderMXBean(senderId);
+} else {
+  ObjectName objectName = service.getGatewaySenderMBeanName(member, 
senderId);
+  bean = service.getMBeanProxy(objectName, GatewaySenderMXBean.class);
+}
+if (bean != null) {
+  if (!dsMembers.contains(member)) {
+return 
ResultModel.createError(CliStrings.EXECUTE_ON_ALL_GATEWAYSENDER_MEMBERS);
+  }

[geode] branch develop updated: GEODE-10419: Enhancment of backup disk-store command (#7851)

2022-09-14 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 e4d2f16c5d GEODE-10419: Enhancment of backup disk-store command (#7851)
e4d2f16c5d is described below

commit e4d2f16c5dad27a96f39a4bec695572040bcedb7
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Sep 14 16:39:18 2022 +0200

GEODE-10419: Enhancment of backup disk-store command (#7851)

* GEODE-10419: initial commit

* GEODE-10419: documentation impacts

* GEODE-10419: added DT
---
 .../DistributedSystemBridgeIntegrationTest.java|   4 +-
 .../InternalConfigurationPersistenceService.java   |   2 +-
 .../internal/cache/backup/BackupConfigFactory.java |  10 +
 .../internal/cache/backup/BackupOperation.java |   8 +
 .../geode/internal/cache/backup/BackupService.java |   8 +-
 .../geode/internal/cache/backup/BackupTask.java|  36 ++-
 .../cache/backup/FileSystemBackupWriterConfig.java |   1 +
 .../geode/internal/cache/backup/PrepareBackup.java |   8 +-
 .../cache/backup/PrepareBackupFactory.java |   5 +-
 .../geode/management/internal/i18n/CliStrings.java |   8 +
 .../gfsh/command-pages/backup.html.md.erb  |  10 +-
 .../commands/BackupDiskStoreCommandDUnitTest.java  | 273 +
 .../cli/commands/BackupDiskStoreCommand.java   |  40 ++-
 13 files changed, 399 insertions(+), 14 deletions(-)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeIntegrationTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeIntegrationTest.java
index 9c184c843f..6f53fa411a 100644
--- 
a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeIntegrationTest.java
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeIntegrationTest.java
@@ -19,6 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.inOrder;
@@ -68,7 +69,6 @@ public class DistributedSystemBridgeIntegrationTest {
 backupService = mock(BackupService.class);
 when(cache.getBackupService()).thenReturn(backupService);
 when(cache.getPersistentMemberManager()).thenReturn(memberManager);
-when(cache.getBackupService()).thenReturn(backupService);
 
 DLockService dlock = mock(DLockService.class);
 when(dlock.lock(any(), anyLong(), anyLong())).thenReturn(true);
@@ -114,7 +114,7 @@ public class DistributedSystemBridgeIntegrationTest {
 
 InOrder inOrder = inOrder(dm, backupService);
 inOrder.verify(dm).putOutgoing(isA(PrepareBackupRequest.class));
-inOrder.verify(backupService).prepareBackup(any(), any());
+inOrder.verify(backupService).prepareBackup(any(), any(), eq(null));
 inOrder.verify(dm).putOutgoing(isA(FinishBackupRequest.class));
 inOrder.verify(backupService).doBackup();
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalConfigurationPersistenceService.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalConfigurationPersistenceService.java
index f59591fe7f..6d68af 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalConfigurationPersistenceService.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalConfigurationPersistenceService.java
@@ -95,7 +95,7 @@ public class InternalConfigurationPersistenceService 
implements ConfigurationPer
*/
   public static final String CLUSTER_CONFIG_ARTIFACTS_DIR_NAME = 
"cluster_config";
 
-  private static final String CLUSTER_CONFIG_DISK_STORE_NAME = 
"cluster_config";
+  public static final String CLUSTER_CONFIG_DISK_STORE_NAME = "cluster_config";
 
   public static final String CLUSTER_CONFIG_DISK_DIR_PREFIX = "ConfigDiskDir_";
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/backup/BackupConfigFactory.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/backup/BackupConfigFactory.java
index e77f5ece96..f04d06d5ef 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/backup/BackupConfigFactory.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/backup/BackupConfigFactory.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.cache.backup;
 import static 
org.apache.geode.internal.cache.backup.Abstra

[geode] branch develop updated: GEODE-10422: add Note for parallel recovery disk store (#7858)

2022-09-14 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 16627d7b48 GEODE-10422: add Note for parallel recovery disk store 
(#7858)
16627d7b48 is described below

commit 16627d7b48e7a7801929b6ece7d588c875464900
Author: Mario Kevo <48509719+mk...@users.noreply.github.com>
AuthorDate: Wed Sep 14 15:45:12 2022 +0200

GEODE-10422: add Note for parallel recovery disk store (#7858)

* GEODE-10422: add Note for parallel recovery disk store

* empty commit to re-launch CI
---
 .../disk_storage/optimize_availability_and_performance.html.md.erb| 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/geode-docs/managing/disk_storage/optimize_availability_and_performance.html.md.erb
 
b/geode-docs/managing/disk_storage/optimize_availability_and_performance.html.md.erb
index f0bfd8b6be..d15b185891 100644
--- 
a/geode-docs/managing/disk_storage/optimize_availability_and_performance.html.md.erb
+++ 
b/geode-docs/managing/disk_storage/optimize_availability_and_performance.html.md.erb
@@ -33,5 +33,7 @@ Optimize availability and performance by following the 
guidelines in this sectio
 ```
 start server --name=server1 --J=-Dgeode.parallelDiskStoreRecovery=false
 ```
-
+**Note:**
+In case using parallel disk store recovery, use different disk stores for the 
PDX and the region.
+Otherwise, it will run in the sequential recovery mode, regardless of the 
above flag.
 



[geode] branch develop updated: GEODE-10335_1: add compareAndSet (#7850)

2022-09-09 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 ac8b1786ac GEODE-10335_1: add compareAndSet (#7850)
ac8b1786ac is described below

commit ac8b1786ac5b70e1e252de9726ddcb0a927705d7
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Fri Sep 9 15:05:39 2022 +0200

GEODE-10335_1: add compareAndSet (#7850)
---
 .../main/java/org/apache/geode/internal/cache/TXManagerImpl.java| 6 ++
 .../java/org/apache/geode/internal/cache/TXManagerImplTest.java | 4 +++-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
index 1dacdcd06d..e901a03bd5 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
@@ -688,10 +688,8 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
 for (final TransactionListener listener : listeners) {
   closeListener(listener);
 }
-TXManagerImpl instance = currentInstance.get();
-if (instance != null) {
-  currentInstance.set(null);
-}
+
+currentInstance.compareAndSet(this, null);
   }
 
   private void closeListener(TransactionListener tl) {
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
index 24b1af2ccb..a0e6cd8f44 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
@@ -72,7 +72,6 @@ public class TXManagerImplTest {
   public void setUp() {
 cache = Fakes.cache();
 dm = mock(ClusterDistributionManager.class);
-txMgr = new TXManagerImpl(mock(CachePerfStats.class), cache, 
disabledClock());
 txid = new TXId(null, 0);
 msg = mock(DestroyMessage.class);
 txCommitMsg = mock(TXCommitMessage.class);
@@ -94,6 +93,9 @@ public class TXManagerImplTest {
 spyTxMgr = spy(new TXManagerImpl(mock(CachePerfStats.class), spyCache, 
disabledClock()));
 timer = mock(SystemTimer.class);
 doReturn(timer).when(spyCache).getCCPTimer();
+
+txMgr = new TXManagerImpl(mock(CachePerfStats.class), cache, 
disabledClock());
+
   }
 
   @Test



[geode] branch develop updated: GEODE-10336: set lastInstance to null (#7843)

2022-09-09 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 c4ab763dea GEODE-10336: set lastInstance to null (#7843)
c4ab763dea is described below

commit c4ab763dea39328ba276e8c527bf531050f20cde
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Fri Sep 9 08:05:51 2022 +0200

GEODE-10336: set lastInstance to null (#7843)

* GEODE-10336: set lastInstance to null

* GEODE-10336: added test
---
 .../apache/geode/internal/tcp/ConnectionTable.java  |  6 ++
 .../geode/internal/tcp/ConnectionTableTest.java | 21 -
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java 
b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
index f1d157d27f..0a4cf5f8dd 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
@@ -655,6 +655,7 @@ public class ConnectionTable {
   map.clear();
 }
 socketCloser.close();
+emergencyClose();
   }
 
   public void executeCommand(Runnable runnable) {
@@ -1025,6 +1026,11 @@ public class ConnectionTable {
 return receivers.size();
   }
 
+  static boolean checkLastInstanceIsNull() {
+ConnectionTable ct = lastInstance.get();
+return ct == null;
+  }
+
   private class PendingConnection {
 
 /**
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionTableTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionTableTest.java
index 06112f73c1..31c9c3f20e 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionTableTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionTableTest.java
@@ -14,7 +14,7 @@
  */
 package org.apache.geode.internal.tcp;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -74,7 +74,10 @@ public class ConnectionTableTest {
 when(connection.isSocketClosed()).thenReturn(true);
 
 connectionTable.acceptConnection(socket, factory);
-assertEquals(0, connectionTable.getNumberOfReceivers());
+assertThat(connectionTable.getNumberOfReceivers()).isEqualTo(0);
+
+connectionTable.close();
+assertThat(ConnectionTable.checkLastInstanceIsNull()).isTrue();
   }
 
   @Test
@@ -86,7 +89,10 @@ public class ConnectionTableTest {
 when(connection.isReceiverStopped()).thenReturn(true);
 
 connectionTable.acceptConnection(socket, factory);
-assertEquals(0, connectionTable.getNumberOfReceivers());
+assertThat(connectionTable.getNumberOfReceivers()).isEqualTo(0);
+
+connectionTable.close();
+assertThat(ConnectionTable.checkLastInstanceIsNull()).isTrue();
   }
 
   @Test
@@ -95,7 +101,10 @@ public class ConnectionTableTest {
 when(connection.isSocketClosed()).thenReturn(false);
 
 connectionTable.acceptConnection(socket, factory);
-assertEquals(1, connectionTable.getNumberOfReceivers());
+assertThat(connectionTable.getNumberOfReceivers()).isEqualTo(1);
+
+connectionTable.close();
+assertThat(ConnectionTable.checkLastInstanceIsNull()).isTrue();
   }
 
   @Test
@@ -106,11 +115,13 @@ public class ConnectionTableTest {
   Map threadConnectionMap = new HashMap<>();
   ConnectionTable.threadOrderedConnMap.set(threadConnectionMap);
   ConnectionTable.releaseThreadsSockets();
-  assertEquals(0, threadConnectionMap.size());
+  assertThat(threadConnectionMap.size()).isEqualTo(0);
 } finally {
   if (wantsResources != Boolean.FALSE) {
 ConnectionTable.threadWantsSharedResources();
   }
 }
+connectionTable.close();
+assertThat(ConnectionTable.checkLastInstanceIsNull()).isTrue();
   }
 }



[geode] branch develop updated: GEODE-10056: Improve gateway-receiver load balance (#7378)

2022-09-08 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 e627e60bae GEODE-10056: Improve gateway-receiver load balance (#7378)
e627e60bae is described below

commit e627e60bae087a2874f2439994ab6d745dbd66a1
Author: Jakov Varenina <62134331+jvaren...@users.noreply.github.com>
AuthorDate: Thu Sep 8 10:59:42 2022 +0200

GEODE-10056: Improve gateway-receiver load balance (#7378)

* GEODE-10056: Improve gateway-receiver load balance

The problem is that servers send incorrect gateway-receiver connection
load to locators within CacheServerLoadMessage. Additionally, locators
do not refresh gateway-receivers load with the load received in
CacheServerLoadMessage. The only time locator increments
gateway-receiver load is after it receives
ClientConnectionRequest{group=__recv_group...} and returns selected
server in ClientConnectionResponse message. This is done only by
coordinator, so that means that other locators will have load with
initial values, since it is never updated.

The solution is to correctly track gateway-receiver acceptor
connection count and then based on it correctly calculate the load
when sending CacheServerLoadMessage. Additionally each locator will
read the load received from CacheServerLoadMessage and update load
for gateway-receiver location id in group __recv__group accordingly.

* Updates after the review

* Fix for the flaky test cases

* Updates after review

* Empty commit to trigger test

* Updates after review

* Fix failed distributed test

The test case testMultiUser failed because Wan service is available
in geode-core distributed tests, and therefore test now throws:

org.apache.geode.internal.cache.wan.GatewaySenderConfigurationException
: Locators must be configured before starting gateway-sender.

instead of:

java.lang.IllegalStateException: WAN service is not available.

* Synchronize handling of receiver load

This commit synchronizes the getting and sending of gateway-receiver
load (CacheServerLoadMessage) on all servers.
---
 geode-core/build.gradle|   1 +
 .../WanConnectionsLoadBalanceDistributedTest.java  | 299 +
 .../internal/security/MultiGfshDUnitTest.java  |   3 +-
 .../internal/locator/ClientConnectionRequest.java  |   2 +-
 .../internal/locator/QueueConnectionRequest.java   |   7 +-
 .../geode/cache/server/internal/LoadMonitor.java   |  33 +-
 .../distributed/internal/LocatorLoadSnapshot.java  |  80 ++--
 .../geode/distributed/internal/ServerLocator.java  |  20 +-
 .../geode/internal/cache/CacheServerImpl.java  |   2 +-
 .../internal/cache/FindDurableQueueProcessor.java  |   7 +-
 ...JUnitTest.java => LocatorLoadSnapshotTest.java} | 466 +++--
 11 files changed, 658 insertions(+), 262 deletions(-)

diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index a63aefa0ae..e15b1eb6bb 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -378,6 +378,7 @@ dependencies {
 
 
   distributedTestImplementation(project(':geode-gfsh'))
+  distributedTestImplementation(project(':geode-wan'))
   distributedTestImplementation(project(':geode-junit')) {
 exclude module: 'geode-core'
   }
diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/WanConnectionsLoadBalanceDistributedTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/WanConnectionsLoadBalanceDistributedTest.java
new file mode 100644
index 00..503d5fdb75
--- /dev/null
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/WanConnectionsLoadBalanceDistributedTest.java
@@ -0,0 +1,299 @@
+/*
+ * 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.distributed.internal;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.DISTRIBU

[geode] branch develop updated: GEODE-10335: TXManagerImpl.close resets currentInstance (#7844)

2022-09-08 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 d73bcd9a2a GEODE-10335: TXManagerImpl.close resets currentInstance 
(#7844)
d73bcd9a2a is described below

commit d73bcd9a2aa0eeb94fad0e9d225a87b9af024000
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Thu Sep 8 08:10:05 2022 +0200

GEODE-10335: TXManagerImpl.close resets currentInstance (#7844)

* GEODE-10335: TXManagerImpl.close resets currentInstance

* GEODE-10335: added test
---
 .../apache/geode/internal/cache/TXManagerImpl.java |  32 ++--
 .../geode/internal/cache/TXManagerImplTest.java| 164 +
 2 files changed, 122 insertions(+), 74 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
index 96b8a2a7d5..1dacdcd06d 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
@@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.LockSupport;
 
 import org.apache.logging.log4j.Logger;
@@ -88,7 +89,7 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
   private final ThreadLocal pauseJTA;
 
   @MakeNotStatic
-  private static TXManagerImpl currentInstance = null;
+  private static final AtomicReference currentInstance = new 
AtomicReference<>();
 
   // The unique transaction ID for this Manager
   private final AtomicInteger uniqId;
@@ -202,16 +203,16 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
 isTXDistributed = new ThreadLocal<>();
 transactionTimeToLive = Integer
 .getInteger(GeodeGlossary.GEMFIRE_PREFIX + 
"cacheServer.transactionTimeToLive", 180);
-currentInstance = this;
+currentInstance.set(this);
 this.statisticsClock = statisticsClock;
   }
 
   public static TXManagerImpl getCurrentInstanceForTest() {
-return currentInstance;
+return currentInstance.get();
   }
 
   public static void setCurrentInstanceForTest(TXManagerImpl instance) {
-currentInstance = instance;
+currentInstance.set(instance);
   }
 
   InternalCache getCache() {
@@ -687,6 +688,10 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
 for (final TransactionListener listener : listeners) {
   closeListener(listener);
 }
+TXManagerImpl instance = currentInstance.get();
+if (instance != null) {
+  currentInstance.set(null);
+}
   }
 
   private void closeListener(TransactionListener tl) {
@@ -855,17 +860,19 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
   }
 
   public static int getCurrentTXUniqueId() {
-if (currentInstance == null) {
+TXManagerImpl instance = currentInstance.get();
+if (instance == null) {
   return NOTX;
 }
-return currentInstance.getMyTXUniqueId();
+return instance.getMyTXUniqueId();
   }
 
   public static TXStateProxy getCurrentTXState() {
-if (currentInstance == null) {
+TXManagerImpl instance = currentInstance.get();
+if (instance == null) {
   return null;
 }
-return currentInstance.getTXState();
+return instance.getTXState();
   }
 
   public int getMyTXUniqueId() {
@@ -1633,7 +1640,10 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
 
 @Override
 public void run2() {
-  TXManagerImpl mgr = TXManagerImpl.currentInstance;
+  TXManagerImpl mgr = TXManagerImpl.currentInstance.get();
+  if (mgr == null) {
+return;
+  }
   TXStateProxy tx = mgr.suspendedTXs.remove(txId);
   if (tx != null) {
 try {
@@ -1781,7 +1791,7 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
   };
 
   public static void incRefCount(AbstractRegionEntry re) {
-TXManagerImpl mgr = currentInstance;
+TXManagerImpl mgr = currentInstance.get();
 if (mgr != null) {
   mgr.refCountMap.create(re, incCallback, null, null, true);
 }
@@ -1791,7 +1801,7 @@ public class TXManagerImpl implements 
CacheTransactionManager, MembershipListene
* Return true if refCount went to zero.
*/
   public static boolean decRefCount(AbstractRegionEntry re) {
-TXManagerImpl mgr = currentInstance;
+TXManagerImpl mgr = currentInstance.get();
 if (mgr != null) {
   return mgr.refCountMap.removeConditi

[geode] branch develop updated: GEODE-10337: add use of SocketCreatorFactory.close() (#7842)

2022-09-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 596a601d19 GEODE-10337: add use of SocketCreatorFactory.close() (#7842)
596a601d19 is described below

commit 596a601d199ed810caf06cbc0bfc58ae3581f691
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Sep 7 15:16:38 2022 +0200

GEODE-10337: add use of SocketCreatorFactory.close() (#7842)

* GEODE-10337: add use of SocketCreatorFactory.close()

* GEODE-10337: added UT
---
 .../internal/InternalDistributedSystem.java|   1 +
 .../geode/internal/net/SocketCreatorFactory.java   |  14 +-
 .../net/SocketCreatorFactoryJUnitTest.java | 435 -
 3 files changed, 253 insertions(+), 197 deletions(-)

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 c8e7ba8241..cf90439791 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
@@ -1642,6 +1642,7 @@ public class InternalDistributedSystem extends 
DistributedSystem
   removeSystem(this);
   if (!attemptingToReconnect) {
 loggingSession.shutdown();
+SocketCreatorFactory.close();
   }
   alertingService.useAlertMessaging(new NullAlertMessaging());
   clusterAlertMessaging.get().close();
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreatorFactory.java
 
b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreatorFactory.java
index 415c5bacd2..477ecaec46 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreatorFactory.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreatorFactory.java
@@ -54,10 +54,14 @@ public class SocketCreatorFactory {
   }
 
   private static synchronized SocketCreatorFactory getInstance(boolean 
closing) {
-if (instance == null && !closing) {
-  instance = new SocketCreatorFactory();
+SocketCreatorFactory result = instance;
+if (result == null && !closing) {
+  result = new SocketCreatorFactory();
+  instance = result;
+} else if (result != null && closing) {
+  instance = null;
 }
-return instance;
+return result;
   }
 
   private static synchronized SocketCreatorFactory getInstance() {
@@ -74,6 +78,10 @@ public class SocketCreatorFactory {
 sslConfigForComponent);
   }
 
+  static boolean checkInstanceIsNull() {
+return instance == null;
+  }
+
   public static SocketCreator getSocketCreatorForComponent(
   SecurableCommunicationChannel sslEnabledComponent) {
 return getSocketCreatorForComponent(getInstance().getDistributionConfig(), 
sslEnabledComponent);
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
index 2fc2c072bd..f76e540520 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
@@ -72,8 +72,7 @@ import static 
org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_A
 import static 
org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
 import static 
org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
 import static 
org.apache.geode.test.util.ResourceUtils.createTempFileFromResource;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
 import java.io.IOException;
@@ -110,18 +109,21 @@ public class SocketCreatorFactoryJUnitTest {
 DistributionConfigImpl distributionConfig = new 
DistributionConfigImpl(properties);
 SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-assertTrue(SocketCreatorFactory
-
.getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR).useSSL());
-assertFalse(SocketCreatorFactory
-
.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).useSSL());
-assertFalse(SocketCreatorFactory
-
.getSocketCreatorForComponent(SecurableCommunicationChannel.GATEWAY).useSSL());
-
assertFalse(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.JMX)
-.useSSL());
-assertFalse(SocketCreatorFactory
-
.getSocketCreatorForComponent(SecurableCommunicationChannel.SERVER

[geode] branch develop updated: GEODE-10338: Fix LogWriterAppender shutdown (#7725)

2022-09-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 754e5c3b9c GEODE-10338: Fix LogWriterAppender shutdown (#7725)
754e5c3b9c is described below

commit 754e5c3b9cdd0cd6eeebe9a28443ff1f1cad23e0
Author: Jakov Varenina <62134331+jvaren...@users.noreply.github.com>
AuthorDate: Wed Sep 7 09:05:20 2022 +0200

GEODE-10338: Fix LogWriterAppender shutdown (#7725)

* GEODE-10338: Fix LogWriterAppender shutdown

When a stop session is called on the LogWriterAppender, it closes the
ManagerLogWriter's files. Still, it does not release
ManagerLogWriter's reference, so the LogWriterAppender instance is
kept around after disconnect. This situation ends up keeping the
InternalDistributedSystem alive.

The fix is to clear the LogWriterAppender's reference to the
ManagerLogWriter when the appender session is stopped.

* Update after review

* Fix integration test

* Add nullptr check in stopSession()
---
 .../LogWriterAppenderShutdownIntegrationTest.java  | 130 +
 .../log4j/internal/impl/LogWriterAppender.java |  14 ++-
 2 files changed, 141 insertions(+), 3 deletions(-)

diff --git 
a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderShutdownIntegrationTest.java
 
b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderShutdownIntegrationTest.java
new file mode 100644
index 00..8453713f62
--- /dev/null
+++ 
b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderShutdownIntegrationTest.java
@@ -0,0 +1,130 @@
+/*
+ * 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.logging.log4j.internal.impl;
+
+import static org.apache.geode.test.util.ResourceUtils.createFileFromResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.net.URL;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+
+import org.apache.geode.logging.internal.log4j.api.LogService;
+import org.apache.geode.logging.internal.spi.LogConfig;
+import org.apache.geode.logging.internal.spi.LogConfigSupplier;
+import org.apache.geode.logging.internal.spi.SessionContext;
+import org.apache.geode.test.junit.categories.LoggingTest;
+
+/**
+ * Integration tests for {@link LogWriterAppender}.
+ */
+@Category(LoggingTest.class)
+public class LogWriterAppenderShutdownIntegrationTest {
+
+  private static final String CONFIG_FILE_NAME = 
"LogWriterAppenderIntegrationTest_log4j2.xml";
+  private static final String APPENDER_NAME = "LOGWRITER";
+
+  private static String configFilePath;
+
+  private File logFile;
+
+  private String logMessage;
+
+  private Logger logger;
+
+  private LogWriterAppender logWriterAppender;
+
+  private SessionContext sessionContext;
+
+  @ClassRule
+  public static TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+  @Rule
+  public LoggerContextRule loggerContextRule = new 
LoggerContextRule(configFilePath);
+
+  @Rule
+  public TestName testName = new TestName();
+
+  @BeforeClass
+  public static void setUpLogConfigFile() {
+URL resource = getResource(CONFIG_FILE_NAME);
+configFilePath = createFileFromResource(resource, 
temporaryFolder.getRoot(), CONFIG_FILE_NAME)
+.getAbsolutePath();
+  }
+
+  @Before
+  public void setUp() {
+String name = testName.getMethodName();
+logF

[geode] branch develop updated: GEODE-10405: added ignore exceprion for GW queue region (#7831)

2022-09-06 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 6fcb258a65 GEODE-10405: added ignore exceprion for GW queue region 
(#7831)
6fcb258a65 is described below

commit 6fcb258a6515f268b119eacd88207860a8750720
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Sep 6 11:26:15 2022 +0200

GEODE-10405: added ignore exceprion for GW queue region (#7831)

* GEODE-10405: added ignore exceprion for GW queue region

* GEODE-10405: added test
---
 .../cache/persistence/PersistenceAdvisorImpl.java  |  19 +-
 ...NPersistenceEnabledGatewaySender2DUnitTest.java | 205 +
 2 files changed, 223 insertions(+), 1 deletion(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
index 174e4e042c..185bb4b486 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
@@ -45,10 +45,13 @@ import 
org.apache.geode.distributed.internal.ProfileListener;
 import org.apache.geode.distributed.internal.ReplyException;
 import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.CopyOnWriteHashSet;
+import org.apache.geode.internal.cache.BucketAdvisor;
 import org.apache.geode.internal.cache.CacheDistributionAdvisor;
 import org.apache.geode.internal.cache.CacheDistributionAdvisor.CacheProfile;
 import 
org.apache.geode.internal.cache.CacheDistributionAdvisor.InitialImageAdvice;
 import org.apache.geode.internal.cache.DiskRegionStats;
+import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.ProxyBucketRegion;
 import 
org.apache.geode.internal.cache.persistence.PersistentMemberManager.MemberRevocationListener;
 import 
org.apache.geode.internal.cache.persistence.PersistentStateQueryMessage.PersistentStateQueryReplyProcessor;
 import org.apache.geode.internal.logging.log4j.LogMarker;
@@ -542,8 +545,22 @@ public class PersistenceAdvisorImpl implements 
InternalPersistenceAdvisor {
 if (copyOfReplicates == null) {
   copyOfReplicates = new HashSet<>(replicates);
 }
+
+boolean gwRegion = false;
+
+if (cacheDistributionAdvisor instanceof BucketAdvisor) {
+  BucketAdvisor ba = (BucketAdvisor) cacheDistributionAdvisor;
+  if (ba.getAdvisee() instanceof ProxyBucketRegion) {
+ProxyBucketRegion pbr = (ProxyBucketRegion) ba.getAdvisee();
+PartitionedRegion pr = pbr.getPartitionedRegion();
+if (pr != null) {
+  gwRegion = pr.isShadowPR();
+}
+  }
+}
+
 copyOfReplicates.remove(member);
-if (copyOfReplicates.isEmpty()) {
+if (copyOfReplicates.isEmpty() && !gwRegion) {
   throw new ConflictingPersistentDataException(message);
 } else {
   logger.info(message);
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySender2DUnitTest.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySender2DUnitTest.java
new file mode 100644
index 00..c510a58147
--- /dev/null
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySender2DUnitTest.java
@@ -0,0 +1,205 @@
+/*
+ * 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.parallel;
+
+
+
+import org.apache.logging.log4j.Logger;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.internal.cache.wan.WANTestBase;
+import org.apache.geode.loggin

[geode] branch develop updated: GEODE-10408: in case corrupted oplogs, use fullGII (#7834)

2022-08-27 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 cce1d7c216 GEODE-10408: in case corrupted oplogs, use fullGII (#7834)
cce1d7c216 is described below

commit cce1d7c216f25fbbd3066d516de36f3f55199c20
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Sat Aug 27 10:37:15 2022 +0200

GEODE-10408: in case corrupted oplogs, use fullGII (#7834)
---
 .../java/org/apache/geode/internal/cache/DiskStoreImpl.java  | 12 
 .../apache/geode/internal/cache/InitialImageOperation.java   |  6 ++
 .../src/main/java/org/apache/geode/internal/cache/Oplog.java |  1 +
 3 files changed, 19 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index 92187c6c9f..8415a00b34 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -383,6 +383,8 @@ public class DiskStoreImpl implements DiskStore {
 
   private volatile Future lastDelayedWrite;
 
+  private boolean dataCorrupted;
+
   private static int calcCompactionThreshold(int ct) {
 if (ct == DiskStoreFactory.DEFAULT_COMPACTION_THRESHOLD) {
   // allow the old sys prop for backwards compat.
@@ -448,6 +450,8 @@ public class DiskStoreImpl implements DiskStore {
 
 // start simple init
 
+this.dataCorrupted = false;
+
 isCompactionPossible = isOfflineCompacting() || (!isOffline()
 && (getAutoCompact() || getAllowForceCompaction() || 
ENABLE_NOTIFY_TO_ROLL));
 maxAsyncItems = getQueueSize();
@@ -4739,4 +4743,12 @@ public class DiskStoreImpl implements DiskStore {
 }
 return (100 - getDiskUsagePercentage());
   }
+
+  public boolean isDataCorrupted() {
+return dataCorrupted;
+  }
+
+  public void setDataCorrupted(boolean data) {
+dataCorrupted = data;
+  }
 }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
index 42f746088a..612fbb02f9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
@@ -458,6 +458,12 @@ public class InitialImageOperation {
   MAXIMUM_UNFINISHED_OPERATIONS);
 }
 m.versionVector = null;
+
+  } else if (region.getDiskStore() != null && 
region.getDiskStore().isDataCorrupted()) {
+if (isDebugEnabled) {
+  logger.debug("Data corrupted, do full GII instead");
+}
+m.versionVector = null;
   } else {
 if (recoveredRVV.isNewerThanOrCanFillExceptionsFor(remote_rvv)) {
   m.versionVector = null;
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
index 7d8737040b..53ebdafa98 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
@@ -2303,6 +2303,7 @@ public class Oplog implements CompactableOplog, Flushable 
{
 int b = di.readByte();
 if (b != END_OF_RECORD_ID) {
   if (b == 0) {
+parent.setDataCorrupted(true);
 logger.warn(
 "Detected a partial record in oplog file. Partial records can be 
caused by an abnormal shutdown in which case this warning can be safely 
ignored. They can also be caused by the oplog file being corrupted.");
 



[geode] branch develop updated: GEODE-10407: check if class allready loaded (#7832)

2022-08-24 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 de7834a03f GEODE-10407: check if class allready loaded (#7832)
de7834a03f is described below

commit de7834a03fb638401ce1f7c95a14e42febae8d9b
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Aug 24 10:14:18 2022 +0200

GEODE-10407: check if class allready loaded (#7832)

* GEODE-10407: check if class allready loaded
---
 .../internal/classloader/ClassPathLoader.java  |  6 +++
 .../internal/classloader/ClasspathService.java |  3 ++
 .../DeployJarChildFirstClassLoader.java|  7 +++
 .../deployment/JarDeployerIntegrationTest.java | 54 ++
 .../internal/LegacyClasspathServiceImpl.java   |  4 ++
 5 files changed, 74 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/classloader/ClassPathLoader.java
 
b/geode-core/src/main/java/org/apache/geode/internal/classloader/ClassPathLoader.java
index 3059cc3f15..2d503c02f4 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/classloader/ClassPathLoader.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/classloader/ClassPathLoader.java
@@ -196,4 +196,10 @@ public class ClassPathLoader {
   public JarDeploymentService getJarDeploymentService() {
 return jarDeploymentService;
   }
+
+  public ClassLoader getClassloaderForArtifact(String artifactId) {
+return classPathService.getClassloaderForArtifact(artifactId);
+  }
+
+
 }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/classloader/ClasspathService.java
 
b/geode-core/src/main/java/org/apache/geode/internal/classloader/ClasspathService.java
index 047b20980b..de10cfd845 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/classloader/ClasspathService.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/classloader/ClasspathService.java
@@ -55,4 +55,7 @@ public interface ClasspathService {
   InputStream getResourceAsStream(final String name);
 
   Enumeration getResources(final String name) throws IOException;
+
+  ClassLoader getClassloaderForArtifact(String artifactId);
+
 }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/classloader/DeployJarChildFirstClassLoader.java
 
b/geode-core/src/main/java/org/apache/geode/internal/classloader/DeployJarChildFirstClassLoader.java
index 457df4287a..f10974a5f2 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/classloader/DeployJarChildFirstClassLoader.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/classloader/DeployJarChildFirstClassLoader.java
@@ -70,6 +70,13 @@ public class DeployJarChildFirstClassLoader extends 
ChildFirstClassLoader {
   for (DeployJarChildFirstClassLoader sibling : 
artifactIdsToClassLoader.values().stream()
   .filter(Objects::nonNull).collect(Collectors.toList())) {
 try {
+  if (sibling.thisIsOld()) {
+continue;
+  }
+  c = sibling.findLoadedClass(name);
+  if (c != null) {
+break;
+  }
   c = sibling.findClass(name);
   if (c != null) {
 break;
diff --git 
a/geode-deployment/geode-deployment-legacy/src/integrationTest/java/org/apache/geode/internal/deployment/JarDeployerIntegrationTest.java
 
b/geode-deployment/geode-deployment-legacy/src/integrationTest/java/org/apache/geode/internal/deployment/JarDeployerIntegrationTest.java
index c4154db798..044fa9efa1 100644
--- 
a/geode-deployment/geode-deployment-legacy/src/integrationTest/java/org/apache/geode/internal/deployment/JarDeployerIntegrationTest.java
+++ 
b/geode-deployment/geode-deployment-legacy/src/integrationTest/java/org/apache/geode/internal/deployment/JarDeployerIntegrationTest.java
@@ -52,6 +52,8 @@ public class JarDeployerIntegrationTest {
   private static File plainJarVersion1, plainJarVersion1b, plainJarVersion2, 
semanticJarVersion1,
   semanticJarVersion2, semanticJarVersion1b, semanticJarVersion1c;
 
+  private static File baseJar;
+
   private File deployedDir;
 
   @BeforeClass
@@ -74,6 +76,10 @@ public class JarDeployerIntegrationTest {
 jarBuilder.buildJar(semanticJarVersion1b, createClassContent("version1b", 
"Def"));
 semanticJarVersion1c = new File(stagedTempDir.newFolder("v1c"), "def.jar");
 jarBuilder.buildJar(semanticJarVersion1c, createClassContent("version1c", 
"Def"));
+
+baseJar = new File(stagedDir, "base.jar");
+jarBuilder.buildJar(baseJar, create1ClassContent("ExceptionA"),
+create2ClassContent("ExceptionB", "ExceptionA"));
   }
 
   @Before
@@ -202,6 +208,31 @@ public class JarDeployerIntegrationTest {
 .isInstanceOf(ClassNotFoun

[geode] branch develop updated: GEODE-10401: Configurable .drf recovery HashMap overflow threshold (#7828)

2022-07-27 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 649015b7a8 GEODE-10401: Configurable .drf recovery HashMap overflow 
threshold (#7828)
649015b7a8 is described below

commit 649015b7a880c4e1cff42126bf368cad0c0ec1bc
Author: Jakov Varenina <62134331+jvaren...@users.noreply.github.com>
AuthorDate: Wed Jul 27 15:08:53 2022 +0200

GEODE-10401: Configurable .drf recovery HashMap overflow threshold (#7828)

Configurable with the jvm parameter:

gemfire.disk.drfHashMapOverflowThreshold

Default value: 805306368

When configured threshold value is reached, then server will overflow to
the new hashmap during the recovery of .drf files. Warning: If you set
threshold parameter over 805306368, then uneeded delay will happen due
to bug in fastutil dependency.
---
 .../apache/geode/internal/cache/DiskStoreImpl.java | 61 +++--
 .../OplogEntryIdSetDrfHashSetThresholdTest.java| 62 ++
 2 files changed, 107 insertions(+), 16 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index 19990c7030..92187c6c9f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -183,6 +183,13 @@ public class DiskStoreImpl implements DiskStore {
   public static final String RECOVER_VALUES_SYNC_PROPERTY_NAME =
   GeodeGlossary.GEMFIRE_PREFIX + "disk.recoverValuesSync";
 
+  /**
+   * When configured threshold value is reached, then server will overflow to
+   * the new hashmap during the recovery of .drf files
+   */
+  public static final String DRF_HASHMAP_OVERFLOW_THRESHOLD_NAME =
+  GeodeGlossary.GEMFIRE_PREFIX + "disk.drfHashMapOverflowThreshold";
+
   /**
* Allows recovering values for LRU regions. By default values are not 
recovered for LRU regions
* during recovery.
@@ -190,6 +197,10 @@ public class DiskStoreImpl implements DiskStore {
   public static final String RECOVER_LRU_VALUES_PROPERTY_NAME =
   GeodeGlossary.GEMFIRE_PREFIX + "disk.recoverLruValues";
 
+  static final long DRF_HASHMAP_OVERFLOW_THRESHOLD_DEFAULT = 805306368;
+  static final long DRF_HASHMAP_OVERFLOW_THRESHOLD =
+  Long.getLong(DRF_HASHMAP_OVERFLOW_THRESHOLD_NAME, 
DRF_HASHMAP_OVERFLOW_THRESHOLD_DEFAULT);
+
   boolean RECOVER_VALUES = 
getBoolean(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, true);
 
   boolean RECOVER_VALUES_SYNC = 
getBoolean(DiskStoreImpl.RECOVER_VALUES_SYNC_PROPERTY_NAME, false);
@@ -3546,31 +3557,49 @@ public class DiskStoreImpl implements DiskStore {
   }
 
   try {
-if (id > 0 && id <= 0xL) {
-  currentInts.get().add((int) id);
+if (shouldOverflow(id)) {
+  overflowToNewHashMap(id);
 } else {
-  currentLongs.get().add(id);
+  if (id > 0 && id <= 0xL) {
+this.currentInts.get().add((int) id);
+  } else {
+this.currentLongs.get().add(id);
+  }
 }
   } catch (IllegalArgumentException illegalArgumentException) {
 // See GEODE-8029.
-// Too many entries on the accumulated drf files, overflow and 
continue.
+// Too many entries on the accumulated drf files, overflow next 
[Int|Long]OpenHashSet and
+// continue.
+overflowToNewHashMap(id);
+  }
+}
+
+boolean shouldOverflow(final long id) {
+  if (id > 0 && id <= 0xL) {
+return currentInts.get().size() == DRF_HASHMAP_OVERFLOW_THRESHOLD;
+  } else {
+return currentLongs.get().size() == DRF_HASHMAP_OVERFLOW_THRESHOLD;
+  }
+}
+
+void overflowToNewHashMap(final long id) {
+  if (DRF_HASHMAP_OVERFLOW_THRESHOLD == 
DRF_HASHMAP_OVERFLOW_THRESHOLD_DEFAULT) {
 logger.warn(
 "There is a large number of deleted entries within the disk-store, 
please execute an offline compaction.");
+  }
 
-// Overflow to the next [Int|Long]OpenHashSet and continue.
-if (id > 0 && id <= 0xL) {
-  IntOpenHashSet overflownHashSet = new IntOpenHashSet((int) 
INVALID_ID);
-  allInts.add(overflownHashSet);
-  currentInts.set(overflownHashSet);
+  if (id > 0 && id <= 0xL) {
+IntOpenHashSet overflownHashSet = new IntOpenHashSet((int) INVALID_ID);
+allInts.add(overflownHashSet);
+currentInts.set(overflownHashSet);
 
-  currentInts.get().add((int) id);
-} else {
- 

[geode] branch develop updated: GEODE-10398: fix updating stats after restart (#7822)

2022-07-22 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 9673d2bc4e GEODE-10398: fix updating stats after restart (#7822)
9673d2bc4e is described below

commit 9673d2bc4eaec478f06e75808a04d0ae459bc1df
Author: Mario Kevo <48509719+mk...@users.noreply.github.com>
AuthorDate: Fri Jul 22 14:39:59 2022 +0200

GEODE-10398: fix updating stats after restart (#7822)

* GEODE-10398: fix updating stats after restart

* empty commit to re-launch CI
---
 .../geode/internal/statistics/ResourceInstance.java  | 20 
 .../geode/internal/statistics/SampleCollector.java   |  1 +
 .../geode/internal/statistics/StatArchiveWriter.java |  8 
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
index ad8eb92a80..a946d9c275 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
@@ -35,6 +35,10 @@ public class ResourceInstance {
   private int[] updatedStats = null;
   private boolean statValuesNotified;
 
+  private long[] previousStatArchiveValues = null;
+
+  private long[] latestStatArchiveValues = null;
+
   public ResourceInstance(int id, Statistics statistics, ResourceType type) {
 this.id = id;
 this.statistics = statistics;
@@ -94,6 +98,22 @@ public class ResourceInstance {
 this.updatedStats = updatedStats;
   }
 
+  public long[] getLatestStatArchiveValues() {
+return latestStatArchiveValues;
+  }
+
+  public void setLatestStatArchiveValues(long[] latestStatValues) {
+this.latestStatArchiveValues = latestStatValues;
+  }
+
+  public long[] getPreviousStatArchiveValues() {
+return previousStatArchiveValues;
+  }
+
+  public void setPreviousStatArchiveValues(long[] previousStatValues) {
+this.previousStatArchiveValues = previousStatValues;
+  }
+
   @Override
   public String toString() {
 final StringBuilder sb = new StringBuilder(getClass().getName());
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
index 53072263c1..6d1b7f01a0 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
@@ -262,6 +262,7 @@ public class SampleCollector {
 
   ri.setUpdatedStats(updatedStats);
   ri.setLatestStatValues(statValues);
+  ri.setLatestStatArchiveValues(statValues);
   updatedResources.add(ri);
 }
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
index d53d74febb..a4a959671b 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
@@ -506,8 +506,8 @@ public class StatArchiveWriter implements 
StatArchiveFormat, SampleHandler {
   }
   writeTimeStamp(nanosTimeStamp);
   for (ResourceInstance ri : resourceInstances) {
-ri.setStatValuesNotified(true);
 writeSample(ri);
+ri.setPreviousStatArchiveValues(ri.getLatestStatArchiveValues());
   }
   writeResourceInst(ILLEGAL_RESOURCE_INST_ID);
   dataOut.flush();
@@ -555,7 +555,7 @@ public class StatArchiveWriter implements 
StatArchiveFormat, SampleHandler {
   sampleWrittenForResources.add(ri);
 }
 
-long[] previousStatValues = ri.getPreviousStatValues();
+long[] previousStatValues = ri.getPreviousStatArchiveValues();
 if (isDebugEnabled_STATISTICS) {
   logger.trace(LogMarker.STATISTICS_VERBOSE,
   "StatArchiveWriter#writeSample checkForChange={}, 
previousStatValues={}, stats.length={}",
@@ -563,13 +563,13 @@ public class StatArchiveWriter implements 
StatArchiveFormat, SampleHandler {
 }
 if (previousStatValues == null) {
   previousStatValues = new long[stats.length];
-  ri.setPreviousStatValues(previousStatValues);
+  ri.setPreviousStatArchiveValues(previousStatValues);
 }
 
 int statsWritten = 0;
 try {
   for (int i = 0; i < stats.length; i++) {
-long value = ri.getLatestStatValues()[i];
+long value = ri.getLatestStatArchiveValues()[i];
 if (!checkForChange || value != previousStatValues[i]) {
   long delta = checkForChange ? value - previousStatValues[i] : value;
   if (!wroteInstId) {



[geode] branch develop updated: GEODE-10392: When gw sender started with cleanqueue remove EvictionController from diskstore (#7817)

2022-07-05 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 d6261cc3cc GEODE-10392: When gw sender started with cleanqueue remove 
EvictionController from diskstore (#7817)
d6261cc3cc is described below

commit d6261cc3cce1b661714fb136c732addb8c11a33e
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Jul 5 13:24:48 2022 +0200

GEODE-10392: When gw sender started with cleanqueue remove 
EvictionController from diskstore (#7817)
---
 .../apache/geode/internal/cache/DiskStoreImpl.java |   9 +
 .../geode/internal/cache/PartitionedRegion.java|   9 +
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   1 +
 .../ParallelWANOverflowStatsDistributedTest.java   | 367 +
 4 files changed, 386 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index 0f9865b720..19990c7030 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -4079,6 +4079,15 @@ public class DiskStoreImpl implements DiskStore {
 }
   }
 
+  void clearExistingPREvictionContoller(PartitionedRegion pr) {
+final String prName = pr.getFullPath();
+synchronized (prEvictionControllerMap) {
+  prEvictionControllerMap.remove(prName);
+}
+  }
+
+
+
   /**
* Lock the disk store to prevent updates. This is the first step of the 
backup process. Once all
* disk stores on all members are locked, we still move on to prepareBackup.
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 896af32576..e14a159fc2 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -556,6 +556,15 @@ public class PartitionedRegion extends LocalRegion
 return result;
   }
 
+
+  public void clearPREvictionControllerFromDiskInitialization() {
+if (getDiskStore() != null) {
+  getDiskStore().clearExistingPREvictionContoller(this);
+}
+  }
+
+
+
   @Override
   public boolean remove(Object key, Object value, Object callbackArg) {
 final long startTime = prStats.getTime();
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index c37b4aefc8..7dc5f18e63 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -497,6 +497,7 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 
   if ((prQ != null) && (index == 0) && cleanQueues) {
 cleanOverflowStats(cache);
+prQ.clearPREvictionControllerFromDiskInitialization();
 prQ.destroyRegion(null);
 prQ = null;
   }
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANOverflowStatsDistributedTest.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANOverflowStatsDistributedTest.java
new file mode 100644
index 00..3e99d320f9
--- /dev/null
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANOverflowStatsDistributedTest.java
@@ -0,0 +1,367 @@
+/*
+ * 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.parallel;
+
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Test;
+import org.junit.e

[geode] branch develop updated: GEODE-9484: Improve sending message to multy destinations (#7664)

2022-07-01 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 1d25728e09 GEODE-9484: Improve sending message to multy destinations 
(#7664)
1d25728e09 is described below

commit 1d25728e09f788e2ca043cbaf393f01c4df576f9
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Fri Jul 1 17:46:37 2022 +0200

GEODE-9484: Improve sending message to multy destinations (#7664)

* GEODE-9484: New solution to first try only one attempt to create all 
connections

* GEODE-9484: added fix for NPE
---
 java => UpdatePropagationDistributedTest.java} | 107 ---
 ...ava => UpdatePropagationPRDistributedTest.java} |   2 +-
 .../geode/internal/tcp/CloseConnectionTest.java|   2 +-
 .../geode/internal/tcp/TCPConduitDUnitTest.java|   2 +-
 .../distributed/internal/direct/DirectChannel.java |  44 +---
 .../org/apache/geode/internal/tcp/Connection.java  |   6 +-
 .../apache/geode/internal/tcp/ConnectionTable.java |  30 --
 .../org/apache/geode/internal/tcp/TCPConduit.java  | 118 ++---
 .../internal/tcp/ConnectionTransmissionTest.java   |   2 +-
 .../apache/geode/internal/tcp/TCPConduitTest.java  |  97 ++---
 10 files changed, 343 insertions(+), 67 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDistributedTest.java
similarity index 78%
rename from 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
rename to 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDistributedTest.java
index 0b99a144e5..055780782f 100644
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDistributedTest.java
@@ -20,6 +20,7 @@ import static 
org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 import static 
org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
@@ -50,6 +51,8 @@ import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.cache.util.CacheListenerAdapter;
 import org.apache.geode.cache30.CacheSerializableRunnable;
 import org.apache.geode.distributed.internal.ServerLocationAndMemberId;
+import 
org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper;
+import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.NetworkUtils;
@@ -68,53 +71,89 @@ import org.apache.geode.util.internal.GeodeGlossary;
  * the same across servers
  */
 @Category({ClientSubscriptionTest.class})
-public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
+public class UpdatePropagationDistributedTest extends JUnit4CacheTestCase {
 
   private static final String REGION_NAME = 
"UpdatePropagationDUnitTest_region";
 
   private VM server1 = null;
   private VM server2 = null;
+  private VM server3 = null;
   private VM client1 = null;
   private VM client2 = null;
 
   private int PORT1;
   private int PORT2;
+  private int PORT3;
+
+  private final int minNumEntries = 2;
+
+  private String hostnameServer1;
+  private String hostnameServer3;
 
   @Override
   public final void postSetUp() throws Exception {
 disconnectAllFromDS();
 
 final Host host = Host.getHost(0);
-// Server1 VM
+
 server1 = host.getVM(0);
 
-// Server2 VM
 server2 = host.getVM(1);
 
-// Client 1 VM
-client1 = host.getVM(2);
+server3 = host.getVM(2);
 
-// client 2 VM
-client2 = host.getVM(3);
+client1 = host.getVM(3);
 
-PORT1 = server1.invoke(this::createServerCache);
-PORT2 = server2.invoke(this::createServerCache);
+client2 = host.getVM(4);
 
-client1.invoke(
-() -> 
createClientCache(NetworkUtils.getServerHostName(server1.getHost()), PORT1, 
PORT2));
-client2.invoke(
-() -> 
createClientCache(NetworkUtils.getServerHostName(server1.getHost()), PORT1, 
PORT2));
+PORT1 = server1.invoke(() -> createServerCache());
+PORT2 = server2.invoke(() -> createServerCache());
+PORT3 = server3.invoke(() -> createS

[geode] branch develop updated: GEODE-9997: added ParallelQueueSetPossibleDuplicateMessage (#7323)

2022-06-29 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 ef7dc45dd2 GEODE-9997: added ParallelQueueSetPossibleDuplicateMessage 
(#7323)
ef7dc45dd2 is described below

commit ef7dc45dd24a6241fa748917205aca858f5c1c1b
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Jun 29 22:38:28 2022 +0200

GEODE-9997: added ParallelQueueSetPossibleDuplicateMessage (#7323)

* GEODE-9997: added ParallelQueueSetPossibleDuplicateMessage to signal 
duplicate events on secondary buckets
---
 .../codeAnalysis/sanctionedDataSerializables.txt   |   4 +
 .../internal/ParallelAsyncEventQueueImpl.java  |   3 +
 .../internal/SerialAsyncEventQueueImpl.java|   3 +
 .../org/apache/geode/internal/DSFIDFactory.java|   3 +
 .../internal/cache/AbstractBucketRegionQueue.java  |  63 -
 .../apache/geode/internal/cache/BucketAdvisor.java |  13 ++
 .../apache/geode/internal/cache/BucketRegion.java  |  10 +
 .../geode/internal/cache/BucketRegionQueue.java|  38 +++
 .../geode/internal/cache/GemFireCacheImpl.java |  14 +-
 .../geode/internal/cache/PartitionedRegion.java|  10 +
 .../sockets/command/GatewayReceiverCommand.java|   4 +
 .../internal/cache/wan/AbstractGatewaySender.java  |  24 ++
 .../wan/AbstractGatewaySenderEventProcessor.java   | 201 ++--
 .../internal/cache/wan/GatewayReceiverStats.java   |  31 ++-
 .../internal/cache/wan/InternalGatewaySender.java  |   4 +
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   7 +
 .../ParallelQueueSetPossibleDuplicateMessage.java  | 166 ++
 .../xmlcache/ParallelAsyncEventQueueCreation.java  |   3 +
 .../xmlcache/ParallelGatewaySenderCreation.java|   3 +
 .../xmlcache/SerialAsyncEventQueueCreation.java|   3 +
 .../xmlcache/SerialGatewaySenderCreation.java  |   3 +
 .../ParallelGatewaySenderQueueJUnitTest.java   |   6 +
 ...lQueueSetPossibleDuplicateMessageJUnitTest.java | 243 
 .../serialization/DataSerializableFixedID.java |   1 +
 .../geode/internal/cache/wan/WANTestBase.java  |   1 +
 ...tewaySenderCheckPossibleDuplicateDUnitTest.java | 255 +
 .../parallel/ParallelGatewaySenderImpl.java|  11 +
 .../internal/serial/SerialGatewaySenderImpl.java   |   3 +
 28 files changed, 1108 insertions(+), 22 deletions(-)

diff --git 
a/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
 
b/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
index 84309aac4f..c75044e381 100644
--- 
a/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
+++ 
b/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
@@ -1925,6 +1925,10 @@ 
org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessage,2
 fromData,15
 toData,15
 
+org/apache/geode/internal/cache/wan/parallel/ParallelQueueSetPossibleDuplicateMessage,2
+fromData,26
+toData,26
+
 
org/apache/geode/internal/cache/wan/serial/BatchDestroyOperation$DestroyMessage,2
 fromData,46
 toData,41
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/ParallelAsyncEventQueueImpl.java
 
b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/ParallelAsyncEventQueueImpl.java
index 4afb51d872..d5395df9e9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/ParallelAsyncEventQueueImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/ParallelAsyncEventQueueImpl.java
@@ -114,6 +114,9 @@ public class ParallelAsyncEventQueueImpl extends 
AbstractGatewaySender {
 }
   }
 
+  @Override
+  public void prepareForStop() {}
+
   @Override
   public void stop() {
 getLifeCycleLock().writeLock().lock();
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImpl.java
 
b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImpl.java
index 1713feff76..06e6e594e2 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImpl.java
@@ -135,6 +135,9 @@ public class SerialAsyncEventQueueImpl extends 
AbstractGatewaySender {
 return eventProcessor;
   }
 
+  @Override
+  public void prepareForStop() {}
+
   @Override
   public void stop() {
 if (logger.isDebugEnabled()) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java 
b/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
index d11a9435b9..e6e3cb96cf 100644
--- a/geode-core/sr

[geode] branch develop updated: GEODE-10020: For Ping task avoid registering new destination endpoint (#7749)

2022-06-28 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 24613d9f1a GEODE-10020: For Ping task avoid registering new 
destination endpoint (#7749)
24613d9f1a is described below

commit 24613d9f1a759f9c94009a75fd935b1f0f8383e3
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Jun 28 22:58:00 2022 +0200

GEODE-10020: For Ping task avoid registering new destination endpoint 
(#7749)

* GEODE-10020: For Ping task avoid registering new destination endpoint
---
 ...iversWithSamePortAndHostnameForSendersTest.java |  48 +++-
 .../cache/client/internal/ConnectionImpl.java  |  21 +-
 .../cache/client/internal/OpExecutorImpl.java  |  17 +-
 .../geode/distributed/internal/ServerLocation.java |  15 +-
 .../internal/ServerLocationExtension.java  |  35 +++
 .../cache/client/internal/ConnectionImplTest.java  | 253 +
 .../internal/ServerLocationExtensionTest.java  |  86 +++
 .../distributed/internal/ServerLocationTest.java   |  72 ++
 8 files changed, 537 insertions(+), 10 deletions(-)

diff --git 
a/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
index 485d91dc3d..1501247671 100644
--- 
a/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
+++ 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
@@ -46,6 +46,7 @@ import org.apache.geode.cache.PartitionAttributesFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.client.internal.EndpointManager;
 import org.apache.geode.cache.persistence.PartitionOfflineException;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.internal.cache.ForceReattemptException;
@@ -215,7 +216,6 @@ public class 
SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest {
 
   }
 
-
   /**
* The aim of this test is verify that when several gateway receivers in a 
remote site share the
* same port and hostname-for-senders, the pings sent from the gateway 
senders reach the right
@@ -263,6 +263,44 @@ public class 
SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest {
   }
 
 
+  /**
+   * The aim of this test is verify that when several gateway receivers in a 
remote site share the
+   * same port and hostname-for-senders, the pings sent from the gateway 
senders reach the right
+   * gateway receiver and not just any of the receivers. Check that only one 
destination will be
+   * pinged.
+   */
+  @Test
+  public void 
testPingsToReceiversWithSamePortAndHostnameForSendersReachTheRightReceiver()
+  throws InterruptedException {
+String senderId = "ln";
+String regionName = "region-wan";
+final int remoteLocPort = docker.getExternalPortForService("haproxy", 
20334);
+
+int locPort = createLocator(VM.getVM(0), 1, remoteLocPort);
+
+VM vm1 = VM.getVM(1);
+createCache(vm1, locPort);
+
+// We use one dispatcher thread. With just one dispatcher thread, only one
+// connection will be created by the sender towards one of the receivers 
and it will be
+// monitored by the one ping thread for that remote receiver.
+createGatewaySender(vm1, senderId, 2, true, 5,
+1, GatewaySender.DEFAULT_ORDER_POLICY);
+
+createPartitionedRegion(vm1, regionName, senderId, 0, 10);
+
+int NUM_PUTS = 1;
+
+putKeyValues(vm1, NUM_PUTS, regionName);
+
+await().untilAsserted(() -> {
+  assertThat(getQueuedEvents(vm1, senderId)).isEqualTo(0);
+  assertThat(getSenderPoolDisconnects(vm1, senderId)).isEqualTo(0);
+  assertThat(getPoolEndPointSize(vm1, senderId)).isEqualTo(1);
+});
+
+  }
+
   private boolean allDispatchersConnectedToSameReceiver(int server) {
 
 String gfshOutput = runListGatewayReceiversCommandInServer(server);
@@ -396,6 +434,14 @@ public class 
SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest {
 });
   }
 
+  private static int getPoolEndPointSize(VM vm, String senderId) {
+return vm.invoke(() -> {
+  AbstractGatewaySender sender = (AbstractGatewaySender) 
cache.getGatewaySender(senderId);
+  EndpointManager manager = sender.getProxy().getEndpointManager();
+  return manager.getEndpointMap().size();
+});
+  }
+
   private static int getSenderPoolDisconnects(VM vm, String senderId) {
 return vm.invoke(() -> {
   AbstractGatewaySend

[geode] branch develop updated (3df1e76ddb -> 0700975d24)

2022-06-06 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 3df1e76ddb GEODE-8977: change ThreadMonitor to reduce how long it does 
a "stop the world" ThreadDump vm op (#7751)
 add 0700975d24 GEODE-10280: add Status Message to Status Server Command 
(#7662)

No new revisions were added by this update.

Summary of changes:
 .../apache/geode/distributed/AbstractLauncher.java |   5 +-
 .../apache/geode/distributed/ServerLauncher.java   |  29 ++
 ...{LocatorStateTest.java => ServerStateTest.java} | 115 +
 3 files changed, 103 insertions(+), 46 deletions(-)
 copy 
geode-core/src/test/java/org/apache/geode/distributed/{LocatorStateTest.java => 
ServerStateTest.java} (58%)
 mode change 100755 => 100644



[geode] branch develop updated: GEODE-10277: For destroyed region don`t check size (#7653)

2022-05-25 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 0d58250b23 GEODE-10277: For destroyed region don`t check size (#7653)
0d58250b23 is described below

commit 0d58250b2336d547d6751e7f3d27f9a8cd432d51
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Thu May 26 07:09:04 2022 +0200

GEODE-10277: For destroyed region don`t check size (#7653)
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   9 ++
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 102 +
 2 files changed, 111 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index d3361b5207..678286c92b 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -1649,6 +1649,9 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
   public int localSize(boolean includeSecondary) {
 int size = 0;
 for (PartitionedRegion prQ : userRegionNameToShadowPRMap.values()) {
+  if (prQ.isDestroyed()) {
+continue;
+  }
   if (prQ.getDataStore() != null) {
 if (includeSecondary) {
   size += prQ.getDataStore().getSizeOfLocalBuckets();
@@ -1667,6 +1670,9 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
   public int localSizeForProcessor() {
 int size = 0;
 for (PartitionedRegion prQ : userRegionNameToShadowPRMap.values()) {
+  if (prQ.isDestroyed()) {
+continue;
+  }
   if (((PartitionedRegion) prQ.getRegion()).getDataStore() != null) {
 Set primaryBuckets =
 ((PartitionedRegion) 
prQ.getRegion()).getDataStore().getAllLocalPrimaryBucketRegions();
@@ -1689,6 +1695,9 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
   public int size() {
 int size = 0;
 for (PartitionedRegion prQ : userRegionNameToShadowPRMap.values()) {
+  if (prQ.isDestroyed()) {
+continue;
+  }
   if (logger.isDebugEnabled()) {
 logger.debug("The name of the queue region is {} and the size is {}. 
keyset size is {}",
 prQ.getName(), prQ.size(), prQ.keys().size());
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
index fe2a02a542..42a4fd207b 100644
--- 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
@@ -2328,6 +2328,107 @@ public class 
ParallelWANPersistenceEnabledGatewaySenderDUnitTest extends WANTest
 
 
 
+  /**
+   * Enable persistence for GatewaySender. Pause the sender and do some puts 
in local region. Stop
+   * GatewaySender.
+   * Then start GatewaySender with clean-queues option. Check if the remote 
site receives all the
+   * events.
+   */
+  @Test
+  public void 
testpersistentWanGateway_restartSenderWithCleanQueuesDelayed_expectNoException()
+  throws InterruptedException {
+// create locator on local site
+Integer lnPort = vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId(1));
+// create locator on remote site
+Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, 
lnPort));
+
+// create cache in remote site
+createCacheInVMs(nyPort, vm2, vm3);
+
+// create cache in local site
+createCacheInVMs(lnPort, vm4, vm5);
+
+// create senders with disk store
+String diskStore1 = vm4.invoke(() -> 
WANTestBase.createSenderWithDiskStore("ln", 2,
+true, 100, 10, false, true, null, null, true));
+String diskStore2 = vm5.invoke(() -> 
WANTestBase.createSenderWithDiskStore("ln", 2,
+true, 100, 10, false, true, null, null, true));
+
+// create PR on remote site
+vm2.invoke(
+() -> WANTestBase.createPartitionedRegion(getTestMethodName(), null, 
1, 100, isOffHeap()));
+vm3.invoke(
+() -> WANTestBase.createPartitionedRegion(getTestMethodName(), null, 
1, 100, isOffHeap()));
+
+// create PR on local site
+vm4.invoke(createPartitionedRegionRunnable());
+vm5.invoke(createPartitionedRegionRunnable());
+
+// start the senders on local site
+startS

[geode] branch develop updated (9154cfc7ed -> 18f0e9c55c)

2022-05-24 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 9154cfc7ed GEODE-10226: Added monitoring of async writer (#7667)
 add 18f0e9c55c GEODE-10020: For Ping task avoid registering new 
destination endpoint (#7515)

No new revisions were added by this update.

Summary of changes:
 ...iversWithSamePortAndHostnameForSendersTest.java |  48 +-
 .../cache/client/internal/ConnectionImpl.java  |  21 ++-
 .../cache/client/internal/OpExecutorImpl.java  |  17 ++-
 .../geode/distributed/internal/ServerLocation.java |  15 +-
 ...eRunnable.java => ServerLocationExtension.java} |  23 ++-
 .../cache/client/internal/ConnectionImplTest.java  | 165 +
 ...dTest.java => ServerLocationExtensionTest.java} |  74 +++--
 .../distributed/internal/ServerLocationTest.java   |  72 +
 8 files changed, 359 insertions(+), 76 deletions(-)
 copy 
geode-core/src/main/java/org/apache/geode/distributed/internal/{SizeableRunnable.java
 => ServerLocationExtension.java} (62%)
 create mode 100644 
geode-core/src/test/java/org/apache/geode/cache/client/internal/ConnectionImplTest.java
 copy 
geode-core/src/test/java/org/apache/geode/distributed/internal/{ServerLocationAndMemberIdTest.java
 => ServerLocationExtensionTest.java} (53%)
 create mode 100644 
geode-core/src/test/java/org/apache/geode/distributed/internal/ServerLocationTest.java



[geode] branch develop updated: GEODE-10226: Added monitoring of async writer (#7667)

2022-05-24 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 9154cfc7ed GEODE-10226: Added monitoring of async writer (#7667)
9154cfc7ed is described below

commit 9154cfc7ed70f1accd695a7e99714d3886e29ba9
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed May 25 07:32:44 2022 +0200

GEODE-10226: Added monitoring of async writer (#7667)

* GEODE-10226: Added monitoring of async writer
---
 .../apache/geode/internal/cache/DiskStoreImpl.java | 121 -
 .../internal/monitoring/ThreadsMonitoring.java |   4 +-
 .../internal/monitoring/ThreadsMonitoringImpl.java |   4 +
 .../monitoring/executor/AbstractExecutor.java  |   4 +
 ...Executor.java => AsyncWriterExecutorGroup.java} |  28 +
 .../monitoring/executor/SuspendableExecutor.java   |   9 ++
 .../cache/DiskStoreImplValueRecoveryTest.java  |  14 +++
 .../geode/internal/cache/FlusherThreadTest.java|  17 +++
 .../monitoring/ThreadsMonitoringImplJUnitTest.java |   1 +
 .../monitoring/ThreadsMonitoringJUnitTest.java |   6 +-
 .../executor/SuspendableExecutorTest.java  |  11 ++
 11 files changed, 142 insertions(+), 77 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index 9dee1c1c77..0f9865b720 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -19,6 +19,7 @@ import static 
org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FIL
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 import static 
org.apache.geode.internal.cache.entries.DiskEntry.Helper.readRawValue;
+import static 
org.apache.geode.internal.monitoring.ThreadsMonitoring.Mode.AsyncWriterExecutor;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -113,6 +114,8 @@ import 
org.apache.geode.internal.cache.versions.RegionVersionVector;
 import org.apache.geode.internal.cache.versions.VersionSource;
 import org.apache.geode.internal.cache.versions.VersionStamp;
 import org.apache.geode.internal.cache.versions.VersionTag;
+import org.apache.geode.internal.monitoring.ThreadsMonitoring;
+import org.apache.geode.internal.monitoring.executor.AbstractExecutor;
 import org.apache.geode.internal.serialization.KnownVersion;
 import org.apache.geode.internal.util.BlobHelper;
 import org.apache.geode.logging.internal.executors.LoggingExecutors;
@@ -1649,6 +1652,10 @@ public class DiskStoreImpl implements DiskStore {
   this.diskStore = diskStore;
 }
 
+private ThreadsMonitoring getThreadMonitoring() {
+  return 
diskStore.getCache().getInternalDistributedSystem().getDM().getThreadMonitoring();
+}
+
 private boolean waitUntilFlushIsReady() throws InterruptedException {
   if (diskStore.maxAsyncItems > 0) {
 final long time = diskStore.getTimeInterval();
@@ -1716,67 +1723,79 @@ public class DiskStoreImpl implements DiskStore {
 logger.debug("Async writer thread started");
   }
   boolean doingFlush = false;
+  final ThreadsMonitoring threadMonitoring = getThreadMonitoring();
+  final AbstractExecutor threadMonitorExecutor =
+  threadMonitoring.createAbstractExecutor(AsyncWriterExecutor);
+  threadMonitorExecutor.suspendMonitoring();
+  threadMonitoring.register(threadMonitorExecutor);
+
   try {
 while (waitUntilFlushIsReady()) {
-  int drainCount = diskStore.fillDrainList();
-  if (drainCount > 0) {
-Iterator it = diskStore.getDrainList().iterator();
-while (it.hasNext()) {
-  Object o = it.next();
-  if (o instanceof FlushNotifier) {
-flushChild();
-if (LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER) {
-  if (!it.hasNext()) {
-doingFlush = false;
-CacheObserverHolder.getInstance().afterWritingBytes();
+  threadMonitorExecutor.resumeMonitoring();
+  try {
+int drainCount = diskStore.fillDrainList();
+if (drainCount > 0) {
+  Iterator it = diskStore.getDrainList().iterator();
+  while (it.hasNext()) {
+threadMonitorExecutor.reportProgress();
+Object o = it.next();
+if (o instanceof FlushNotifier) {
+  flushChild();
+  if (LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER) {
+if (!it.hasNext()) {
+

[geode] branch develop updated: GEODE-10310: Add disable reatempt on CacheClose (#7690)

2022-05-19 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 4d5f84c27a GEODE-10310: Add disable reatempt on CacheClose (#7690)
4d5f84c27a is described below

commit 4d5f84c27aae4b268731e7afce6aa078f27c4e94
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Thu May 19 22:22:07 2022 +0200

GEODE-10310: Add disable reatempt on CacheClose (#7690)

* GEODE-10310: Add disable reatempt on CacheClose
---
 ...onedRegionCacheCloseNoRetryDistributedTest.java | 288 +
 .../cache/partitioned/PartitionMessage.java|  14 +
 2 files changed, 302 insertions(+)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionCacheCloseNoRetryDistributedTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionCacheCloseNoRetryDistributedTest.java
new file mode 100644
index 00..e5e7f3ae4c
--- /dev/null
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionCacheCloseNoRetryDistributedTest.java
@@ -0,0 +1,288 @@
+/*
+ * 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.partitioned;
+
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static org.apache.geode.cache.RegionShortcut.PARTITION_PERSISTENT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM;
+import static org.apache.geode.test.dunit.VM.getVM;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.Serializable;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.InternalGemFireException;
+import org.apache.geode.cache.PartitionAttributesFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
+import org.apache.geode.cache.execute.Function;
+import org.apache.geode.cache.execute.FunctionContext;
+import org.apache.geode.distributed.internal.DistributionMessageObserver;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.control.InternalResourceManager;
+import org.apache.geode.test.awaitility.GeodeAwaitility;
+import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.rules.CacheRule;
+import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
+import org.apache.geode.util.internal.GeodeGlossary;
+
+public class PartitionedRegionCacheCloseNoRetryDistributedTest implements 
Serializable {
+
+  private String partitionedRegionName;
+
+  private VM vm0;
+  private VM vm1;
+  private VM vm2;
+  private VM vm3;
+
+  private static final long TIMEOUT_MILLIS = 
GeodeAwaitility.getTimeout().toMillis();
+
+  @Rule
+  public CacheRule cacheRule =
+  CacheRule.builder().addConfig(getDistributedSystemProperties()).build();
+
+  @Rule
+  public SerializableTestName testName = new SerializableTestName();
+
+
+  @Before
+  public void setUp() {
+vm0 = getVM(0);
+vm1 = getVM(1);
+vm2 = getVM(2);
+vm3 = getVM(3);
+
+invokeInEveryVM(() -> {
+  System.setProperty(
+  GeodeGlossary.GEMFIRE_PREFIX + 
"PartitionMessage.DISABLE_REATTEMPT_ON_CACHE_CLOSE",
+  "true");
+});
+String uniqueName = getClass().getSimpleName() + "-" + 
testName.getMethodName();
+partitionedRegionName = uniqueName + "-partitionedRegion";
+  }
+
+  @After
+  public void tearDown() {
+invokeInEveryVM(() -> {
+  System.clearProperty(
+  GeodeGlossary.GEMFIRE_PREFIX + 
"PartitionMessage.DISABLE_REATTEMPT_ON_CACHE_CLOSE");
+  InternalResourceManager.setResourceObserver(null);
+  DistributionMessageObserver.setIn

[geode] branch revert-7381-newfeature1/GEODE-9484 created (now 758ef27045)

2022-05-04 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac pushed a change to branch revert-7381-newfeature1/GEODE-9484
in repository https://gitbox.apache.org/repos/asf/geode.git


  at 758ef27045 Revert "GEODE-9484: Improve sending message to multy 
destinations (#7381)"

This branch includes the following new commits:

 new 758ef27045 Revert "GEODE-9484: Improve sending message to multy 
destinations (#7381)"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[geode] 01/01: Revert "GEODE-9484: Improve sending message to multy destinations (#7381)"

2022-05-04 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac pushed a commit to branch revert-7381-newfeature1/GEODE-9484
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 758ef27045019cbe5654aed42b52898cc41ceaa8
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed May 4 21:02:16 2022 +0200

Revert "GEODE-9484: Improve sending message to multy destinations (#7381)"

This reverts commit 62cd12c7f0bbb3d092011555e714e57ce041791a.
---
 ...edTest.java => UpdatePropagationDUnitTest.java} | 109 +++
 ...Test.java => UpdatePropagationPRDUnitTest.java} |   2 +-
 .../geode/internal/tcp/CloseConnectionTest.java|   2 +-
 .../geode/internal/tcp/TCPConduitDUnitTest.java|   2 +-
 .../distributed/internal/direct/DirectChannel.java |  44 +++-
 .../org/apache/geode/internal/tcp/Connection.java  |   6 +-
 .../apache/geode/internal/tcp/ConnectionTable.java |  30 ++
 .../org/apache/geode/internal/tcp/TCPConduit.java  | 117 +++--
 .../internal/tcp/ConnectionTransmissionTest.java   |   2 +-
 .../apache/geode/internal/tcp/TCPConduitTest.java  |  74 +++--
 10 files changed, 68 insertions(+), 320 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDistributedTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
similarity index 78%
rename from 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDistributedTest.java
rename to 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
index 58de5b4762..0b99a144e5 100644
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDistributedTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
@@ -20,7 +20,6 @@ import static 
org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 import static 
org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
@@ -51,8 +50,6 @@ import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.cache.util.CacheListenerAdapter;
 import org.apache.geode.cache30.CacheSerializableRunnable;
 import org.apache.geode.distributed.internal.ServerLocationAndMemberId;
-import 
org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper;
-import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.NetworkUtils;
@@ -71,76 +68,45 @@ import org.apache.geode.util.internal.GeodeGlossary;
  * the same across servers
  */
 @Category({ClientSubscriptionTest.class})
-public class UpdatePropagationDistributedTest extends JUnit4CacheTestCase {
+public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
 
   private static final String REGION_NAME = 
"UpdatePropagationDUnitTest_region";
 
   private VM server1 = null;
   private VM server2 = null;
-  private VM server3 = null;
   private VM client1 = null;
   private VM client2 = null;
 
   private int PORT1;
   private int PORT2;
-  private int PORT3;
-
-  private final int minNumEntries = 2;
-
-  private String hostnameServer1;
-  private String hostnameServer3;
 
   @Override
   public final void postSetUp() throws Exception {
 disconnectAllFromDS();
 
 final Host host = Host.getHost(0);
-
+// Server1 VM
 server1 = host.getVM(0);
 
+// Server2 VM
 server2 = host.getVM(1);
 
-server3 = host.getVM(2);
-
-client1 = host.getVM(3);
-
-client2 = host.getVM(4);
+// Client 1 VM
+client1 = host.getVM(2);
 
-PORT1 = server1.invoke(() -> createServerCache());
-PORT2 = server2.invoke(() -> createServerCache());
-PORT3 = server3.invoke(() -> createServerCache());
+// client 2 VM
+client2 = host.getVM(3);
 
-hostnameServer1 = NetworkUtils.getServerHostName(server1.getHost());
-hostnameServer3 = NetworkUtils.getServerHostName(server3.getHost());
-
-IgnoredException.addIgnoredException("java.net.SocketException");
-IgnoredException.addIgnoredException("Unexpected IOException");
-  }
+PORT1 = server1.invoke(this::createServerCache);
+PORT2 = server2.invoke(this::createServerCache);
 
-
-
-  @Test
-  public void updatesArePropagatedToAllMembersWhenOneKilled() throws Exception 
{
 client1.invoke(
-() -> createClientC

[geode] branch develop updated (50f5d6c468 -> 62cd12c7f0)

2022-05-02 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 50f5d6c468 GEODE-10266: update 
SeveralGatewayReceiversWithSamePortAndHostnameFor… (#7633)
 add 62cd12c7f0 GEODE-9484: Improve sending message to multy destinations 
(#7381)

No new revisions were added by this update.

Summary of changes:
 java => UpdatePropagationDistributedTest.java} | 109 ---
 ...ava => UpdatePropagationPRDistributedTest.java} |   2 +-
 .../geode/internal/tcp/CloseConnectionTest.java|   2 +-
 .../geode/internal/tcp/TCPConduitDUnitTest.java|   2 +-
 .../distributed/internal/direct/DirectChannel.java |  44 +---
 .../org/apache/geode/internal/tcp/Connection.java  |   6 +-
 .../apache/geode/internal/tcp/ConnectionTable.java |  30 --
 .../org/apache/geode/internal/tcp/TCPConduit.java  | 117 ++---
 .../internal/tcp/ConnectionTransmissionTest.java   |   2 +-
 .../apache/geode/internal/tcp/TCPConduitTest.java  |  74 ++---
 10 files changed, 320 insertions(+), 68 deletions(-)
 rename 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/{UpdatePropagationDUnitTest.java
 => UpdatePropagationDistributedTest.java} (78%)
 rename 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/{UpdatePropagationPRDUnitTest.java
 => UpdatePropagationPRDistributedTest.java} (93%)



[geode] branch develop updated: GEODE-10266: update SeveralGatewayReceiversWithSamePortAndHostnameFor… (#7633)

2022-05-02 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 50f5d6c468 GEODE-10266: update 
SeveralGatewayReceiversWithSamePortAndHostnameFor… (#7633)
50f5d6c468 is described below

commit 50f5d6c468d27af7128a6436a19f4ee8a350c97d
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Mon May 2 15:50:39 2022 +0200

GEODE-10266: update SeveralGatewayReceiversWithSamePortAndHostnameFor… 
(#7633)

* GEODE-10266: update 
SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest
---
 .../SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
index 682b132638..485d91dc3d 100644
--- 
a/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
+++ 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
@@ -258,11 +258,11 @@ public class 
SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest {
 
 await().untilAsserted(() -> assertThat(getSenderPoolDisconnects(vm1, 
senderId)).isEqualTo(0));
 
-await().untilAsserted(() -> assertThat(getSenderPoolConnects(vm1, 
senderId)).isEqualTo(4));
+await().untilAsserted(
+() -> assertThat(getSenderPoolConnects(vm1, senderId)).isIn(3, 4));
   }
 
 
-
   private boolean allDispatchersConnectedToSameReceiver(int server) {
 
 String gfshOutput = runListGatewayReceiversCommandInServer(server);



[geode] branch develop updated: GEODE-10020: Introduction of option to gradually activate pinging (#7517)

2022-04-27 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 ae17ba4adc GEODE-10020: Introduction of option to gradually activate 
pinging (#7517)
ae17ba4adc is described below

commit ae17ba4adce09e51f91d8bb3813beeed8cbf5569
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Apr 27 22:02:44 2022 +0200

GEODE-10020: Introduction of option to gradually activate pinging (#7517)

* GEODE-10020: Introduction of option to gradually activate pinging toward 
destination
---
 ...iversWithSamePortAndHostnameForSendersTest.java | 61 -
 .../cache/client/internal/LiveServerPinger.java| 41 +++-
 .../client/internal/LiveServerPingerTest.java  | 78 ++
 3 files changed, 177 insertions(+), 3 deletions(-)

diff --git 
a/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
index 8bad48f570..682b132638 100644
--- 
a/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
+++ 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java
@@ -58,6 +58,7 @@ import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.rules.DistributedRule;
 import org.apache.geode.test.junit.categories.WanTest;
+import org.apache.geode.util.internal.GeodeGlossary;
 
 
 /**
@@ -214,6 +215,54 @@ public class 
SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest {
 
   }
 
+
+  /**
+   * The aim of this test is verify that when several gateway receivers in a 
remote site share the
+   * same port and hostname-for-senders, the pings sent from the gateway 
senders reach the right
+   * gateway receiver and not just any of the receivers. Check that only one 
additional connection
+   * is used.
+   */
+  @Test
+  public void 
testPingsToReceiversWithSamePortAndHostnameForSendersUseOnlyOneMoreConnection()
+  throws InterruptedException {
+String senderId = "ln";
+String regionName = "region-wan";
+final int remoteLocPort = docker.getExternalPortForService("haproxy", 
20334);
+
+int locPort = createLocator(VM.getVM(0), 1, remoteLocPort);
+
+VM vm1 = VM.getVM(1);
+
+vm1.invoke(() -> {
+  System.setProperty(
+  GeodeGlossary.GEMFIRE_PREFIX
+  + "LiveServerPinger.INITIAL_DELAY_MULTIPLIER_IN_MILLISECONDS",
+  "500");
+
+  Properties props = new Properties();
+  props.setProperty(LOCATORS, "localhost[" + locPort + "]");
+  CacheFactory cacheFactory = new CacheFactory(props);
+  cache = cacheFactory.create();
+});
+
+createGatewaySender(vm1, senderId, 2, true, 5,
+2, GatewaySender.DEFAULT_ORDER_POLICY);
+
+createPartitionedRegion(vm1, regionName, senderId, 0, 10);
+
+int NUM_PUTS = 10;
+
+putKeyValues(vm1, NUM_PUTS, regionName);
+
+await().untilAsserted(() -> assertThat(getQueuedEvents(vm1, 
senderId)).isEqualTo(0));
+
+await().untilAsserted(() -> assertThat(getSenderPoolDisconnects(vm1, 
senderId)).isEqualTo(0));
+
+await().untilAsserted(() -> assertThat(getSenderPoolConnects(vm1, 
senderId)).isEqualTo(4));
+  }
+
+
+
   private boolean allDispatchersConnectedToSameReceiver(int server) {
 
 String gfshOutput = runListGatewayReceiversCommandInServer(server);
@@ -351,12 +400,22 @@ public class 
SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest {
 return vm.invoke(() -> {
   AbstractGatewaySender sender =
   (AbstractGatewaySender) 
CacheFactory.getAnyInstance().getGatewaySender(senderId);
-  assertNotNull(sender);
+  assertThat(sender).isNotNull();
   PoolStats poolStats = sender.getProxy().getStats();
   return poolStats.getDisConnects();
 });
   }
 
+  private static int getSenderPoolConnects(VM vm, String senderId) {
+return vm.invoke(() -> {
+  AbstractGatewaySender sender =
+  (AbstractGatewaySender) 
CacheFactory.getAnyInstance().getGatewaySender(senderId);
+  assertThat(sender).isNotNull();
+  PoolStats poolStats = sender.getProxy().getStats();
+  return poolStats.getConnects();
+});
+  }
+
   private static void putKeyValues(VM vm, int numPuts, String region) {
 final HashMap keyValues = new HashMap<>();
 for (int i = 0; i < numPuts; i++) {
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/client/internal/LiveServerPing

[geode] branch develop updated: GEODE-9969: Fix unescaping the region name with underscore (#7320)

2022-03-25 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 e88d57d  GEODE-9969: Fix unescaping the region name with underscore 
(#7320)
e88d57d is described below

commit e88d57da17cc86278754fece3f9d56ba5bb1440d
Author: Mario Kevo <48509719+mk...@users.noreply.github.com>
AuthorDate: Fri Mar 25 07:33:32 2022 +0100

GEODE-9969: Fix unescaping the region name with underscore (#7320)

* GEODE-9969: Fix unescaping the region name with underscore

* changes after review

* add acceptanceTest

* fix test

* fix windows test

* rebase on the latest develop

* empty commit to releaunch CI
---
 ...gDiskStoreAfterServerRestartAcceptanceTest.java | 161 +
 .../internal/cache/PartitionedRegionHelper.java|   2 +
 .../cache/PartitionedRegionHelperJUnitTest.java|  40 +++--
 3 files changed, 187 insertions(+), 16 deletions(-)

diff --git 
a/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/persistence/MissingDiskStoreAfterServerRestartAcceptanceTest.java
 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/persistence/MissingDiskStoreAfterServerRestartAcceptanceTest.java
new file mode 100644
index 000..825c1ad
--- /dev/null
+++ 
b/geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/persistence/MissingDiskStoreAfterServerRestartAcceptanceTest.java
@@ -0,0 +1,161 @@
+/*
+ * 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.cache.persistence;
+
+import static org.apache.geode.cache.Region.SEPARATOR;
+import static 
org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import org.apache.geode.test.assertj.LogFileAssert;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+
+public class MissingDiskStoreAfterServerRestartAcceptanceTest {
+
+  private static final String SERVER_1_NAME = "server1";
+  private static final String SERVER_2_NAME = "server2";
+  private static final String SERVER_3_NAME = "server3";
+  private static final String SERVER_4_NAME = "server4";
+  private static final String SERVER_5_NAME = "server5";
+  private static final String LOCATOR_NAME = "locator";
+  private static final String REGION_NAME_WITH_UNDERSCORE = "_myRegion";
+
+  private Path server4Folder;
+  private Path server5Folder;
+  private TemporaryFolder temporaryFolder;
+
+  private int locatorPort;
+
+  private String startServer1Command;
+  private String startServer2Command;
+  private String startServer3Command;
+  private String startServer4Command;
+  private String startServer5Command;
+
+  private String createRegionWithUnderscoreCommand;
+  private String connectToLocatorCommand;
+  private String queryCommand;
+
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+
+  @Before
+  public void setUp() throws Exception {
+temporaryFolder = gfshRule.getTemporaryFolder();
+server4Folder = 
temporaryFolder.newFolder(SERVER_4_NAME).toPath().toAbsolutePath();
+server5Folder = 
temporaryFolder.newFolder(SERVER_5_NAME).toPath().toAbsolutePath();
+
+int[] ports = getRandomAvailableTCPPorts(6);
+locatorPort = ports[0];
+int server1Port = ports[1];
+int server2Port = ports[2];
+int server3Port = ports[3];
+int server4Port = ports[4];
+int server5Port = ports[5];
+
+String startLocatorCommand = String.join(" ",
+"start locator",
+"--name=" + LOCATOR_NAME,
+"--port=" + locatorPort,
+"--locators=localhost[" + locatorPort

[geode] branch develop updated (8272807 -> d67aba9)

2022-03-18 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 8272807  GEODE-10039: Fix the issue that BucketProfile can be stale in 
rare cases. (#7440)
 add d67aba9  GEODE-10105: when stopping gw sender, for pending events set 
possible… (#7422)

No new revisions were added by this update.

Summary of changes:
 .../geode/internal/cache/BucketRegionQueue.java|   4 +-
 .../wan/AbstractGatewaySenderEventProcessor.java   |  15 +
 .../ConcurrentParallelGatewaySenderQueue.java  |   6 +
 .../wan/parallel/ParallelGatewaySenderQueue.java   |  21 ++
 .../geode/internal/cache/wan/WANTestBase.java  |  12 +
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 327 +
 6 files changed, 267 insertions(+), 118 deletions(-)


[geode] branch develop updated (a2f4756 -> e9a5243)

2022-03-17 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from a2f4756  Revert "roll develop to 1.16.0 now that support/1.15 has been 
created (#7309)" (#7453)
 add e9a5243  GEODE-9642: Wait for colocation completed at partitioned 
region initialization (#6909)

No new revisions were added by this update.

Summary of changes:
 .../internal/cache/PRHARedundancyProvider.java |   3 +-
 .../geode/internal/cache/PartitionedRegion.java|   3 +-
 .../partitioned/CreateMissingBucketsTask.java  |  80 ++
 .../internal/cache/PRHARedundancyProviderTest.java |  20 ++
 .../partitioned/CreateMissingBucketsTaskTest.java  | 277 +
 5 files changed, 380 insertions(+), 3 deletions(-)
 create mode 100644 
geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/CreateMissingBucketsTaskTest.java


[geode] branch develop updated (fb5c9c1 -> 41f9ec5)

2022-03-16 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from fb5c9c1  GEODE-10127: Reverts changes from GEODE-8955. (#7450)
 add 41f9ec5  GEODE-9809: stop monitoring of destroyed regions (#7113)

No new revisions were added by this update.

Summary of changes:
 .../partitioned/PersistentBucketRecoverer.java | 60 ++-
 .../cache/persistence/PersistenceAdvisorImpl.java  | 10 
 .../partitioned/PersistentBucketRecovererTest.java | 70 ++
 .../persistence/PersistenceAdvisorImplTest.java| 30 ++
 4 files changed, 154 insertions(+), 16 deletions(-)


[geode] branch develop updated (be028f2 -> 15d4882)

2022-03-15 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from be028f2  GEODE-10010: Refine per-second Redis stats (#7437)
 add 15d4882  GEODE-10104: allow create gateway sender command with 
dispatch threads for parallel sender (#7421)

No new revisions were added by this update.

Summary of changes:
 .../cli/commands/CreateGatewaySenderCommand.java   |  2 +-
 .../cli/functions/GatewaySenderCreateFunction.java |  4 +-
 .../commands/CreateGatewaySenderCommandTest.java   | 12 ++
 ...CreateDestroyGatewaySenderCommandDUnitTest.java | 47 ++
 4 files changed, 62 insertions(+), 3 deletions(-)


[geode] branch develop updated: GEODE-9853: get all members hosting bucket (#7144)

2022-01-27 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 bbe9a3a  GEODE-9853: get all members hosting bucket (#7144)
bbe9a3a is described below

commit bbe9a3acf2f0812ef733dfe74f07fb9412c886e3
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Thu Jan 27 11:23:29 2022 +0100

GEODE-9853: get all members hosting bucket (#7144)

* GEODE-9853: get all members hosting bucket
---
 .../apache/geode/internal/cache/BucketAdvisor.java |   2 +-
 ...currentParallelGatewaySenderEventProcessor.java |   2 +-
 .../wan/parallel/ParallelGatewaySenderQueue.java   |  74 +
 .../wan/parallel/ParallelQueueRemovalMessage.java  |   8 +-
 .../geode/internal/cache/BucketAdvisorTest.java|  89 
 .../ParallelQueueRemovalMessageJUnitTest.java  |   8 +-
 .../geode/internal/cache/wan/WANTestBase.java  | 114 ++--
 .../ParallelGatewaySenderOperationsDUnitTest.java  | 116 +
 8 files changed, 328 insertions(+), 85 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
index 29287c9..2b70f86 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
@@ -1768,7 +1768,7 @@ public class BucketAdvisor extends 
CacheDistributionAdvisor {
 return redundancyTracker.getCurrentRedundancy();
   }
 
-  Set adviseInitialized() {
+  public Set adviseInitialized() {
 return adviseFilter(profile -> {
   assert profile instanceof BucketProfile;
   BucketProfile bucketProfile = (BucketProfile) profile;
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ConcurrentParallelGatewaySenderEventProcessor.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ConcurrentParallelGatewaySenderEventProcessor.java
index bcd70b7..84205a0 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ConcurrentParallelGatewaySenderEventProcessor.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ConcurrentParallelGatewaySenderEventProcessor.java
@@ -167,7 +167,7 @@ public class ConcurrentParallelGatewaySenderEventProcessor
 ParallelGatewaySenderQueue pgsq = (ParallelGatewaySenderQueue) 
cpgsq.getQueueByBucket(bucketId);
 boolean isPrimary = 
prQ.getRegionAdvisor().getBucketAdvisor(bucketId).isPrimary();
 if (isPrimary) {
-  pgsq.sendQueueRemovalMesssageForDroppedEvent(prQ, bucketId, shadowKey);
+  pgsq.sendQueueRemovalMessageForDroppedEvent(prQ, bucketId, shadowKey);
   sender.getStatistics().incEventsDroppedDueToPrimarySenderNotRunning();
   if (logger.isDebugEnabled()) {
 logger.debug("register dropped event for primary queue. BucketId is " 
+ bucketId
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 235947e..54715b7 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -105,7 +105,8 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
   SEPARATOR + PartitionedRegionHelper.PR_ROOT_REGION_NAME + SEPARATOR;
 
   // >>
-  private final Map regionToDispatchedKeysMap = new ConcurrentHashMap();
+  private final Map>> 
regionToDispatchedKeysMap =
+  new ConcurrentHashMap>>();
 
   protected final StoppableReentrantLock buckToDispatchLock;
   private final StoppableCondition regionToDispatchedKeysMapEmpty;
@@ -1172,9 +1173,10 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
   lock.lock();
   boolean wasEmpty = regionToDispatchedKeysMap.isEmpty();
   try {
-Map bucketIdToDispatchedKeys = (Map) 
regionToDispatchedKeysMap.get(prQ.getFullPath());
+Map> bucketIdToDispatchedKeys =
+regionToDispatchedKeysMap.get(prQ.getFullPath());
 if (bucketIdToDispatchedKeys == null) {
-  bucketIdToDispatchedKeys = new ConcurrentHashMap();
+  bucketIdToDispatchedKeys = new ConcurrentHashMap>();
   regionToDispatchedKeysMap.put(prQ.getFullPath(), 
bucketIdToDispatchedKeys);
 }
 addRemovedEventToMap(bucketIdToDispatchedKeys, bucketId, key);
@@ -1187,23 +1189,26 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 }
   }
 
-  public void sendQueueRemovalMesssage

[geode] branch develop updated: GEODE-9961: GatewayReceiver rethrows CancelException (#7275)

2022-01-19 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 fef9a4f  GEODE-9961: GatewayReceiver rethrows CancelException (#7275)
fef9a4f is described below

commit fef9a4ff58182f50bfd7b009ed31101f62d4
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Jan 19 13:46:23 2022 +0100

GEODE-9961: GatewayReceiver rethrows CancelException (#7275)
---
 .../sockets/command/GatewayReceiverCommand.java|   4 +
 .../command/GatewayReceiverCommandTest.java| 168 +
 2 files changed, 172 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
index 5df0ebb..5ebd08f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
@@ -715,6 +715,10 @@ public class GatewayReceiverCommand extends BaseCommand {
 
   private void handleException(boolean removeOnException, GatewayReceiverStats 
stats, Exception e)
   throws Exception {
+if (e instanceof CancelException) {
+  throw e;
+}
+
 if (shouldThrowException(removeOnException)) {
   throw e;
 } else {
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommandTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommandTest.java
new file mode 100644
index 000..e1272b0
--- /dev/null
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommandTest.java
@@ -0,0 +1,168 @@
+/*
+ * 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.tier.sockets.command;
+
+
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import org.apache.geode.cache.CacheClosedException;
+import org.apache.geode.internal.cache.EventID;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.tier.CachedRegionHelper;
+import org.apache.geode.internal.cache.tier.sockets.Message;
+import org.apache.geode.internal.cache.tier.sockets.Part;
+import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
+import org.apache.geode.internal.cache.wan.GatewayReceiverStats;
+import org.apache.geode.internal.security.SecurityService;
+import org.apache.geode.test.junit.categories.ClientServerTest;
+
+@Category({ClientServerTest.class})
+public class GatewayReceiverCommandTest {
+
+  private static final String REGION_NAME = "region1";
+  private static final String KEY = "key1";
+  private static final Object VALUE = "value1";
+
+  private static final byte[] REMOVE_ON_EXCEPTION_BYTES = new byte[] {0};
+  private static final byte[] POSSIBLE_DUPLICATE_BYTES = new byte[] {1};
+  private static final byte[] CALLBACK_ARG_EXIST_BYTES = new byte[] {0};
+
+  @Mock
+  private EventID eventId;
+
+  @Mock
+  private Message message;
+  @Mock
+  private SecurityService securityService;
+  @Mock
+  private ServerConnection serverConnection;
+  @Mock
+  private CachedRegionHelper cachedRegionHelper;
+  @Mock
+  private GatewayReceiverStats gatewayReceiverStats;
+  @Mock
+  private InternalCache cache;
+
+
+  @Mock
+  private Part numberOfEventsPart;
+  @Mock
+  private Part batchIdPart;
+  @Mock
+  private Part dsidPart;
+  @Mock
+  private Part removeOnExceptionPart;
+  @Mock
+  private Part actionTypePart;
+  @Mock
+  private Part possibleDuplicatePart;
+  @Mock
+  private P

[geode] branch develop updated (5d89d4f -> 09a8faf)

2021-11-29 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 5d89d4f  GEODE-9862: pin Gradle use of jgit (#7152)
 add 09a8faf  GEODE-9768: wait for destroying of region to finish, before 
creating … (#7035)

No new revisions were added by this update.

Summary of changes:
 .../wan/parallel/ParallelGatewaySenderQueue.java   |  17 ++-
 .../ParallelGatewaySenderQueueJUnitTest.java   |  70 -
 .../geode/internal/cache/wan/WANTestBase.java  |  12 ++
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 158 +
 4 files changed, 255 insertions(+), 2 deletions(-)


[geode] branch develop updated (5d1e919 -> 685ad9e)

2021-11-19 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 5d1e919  GEODE-9817: Enable customized source set paths for 
ClassAnalysisRule (#7121)
 add 685ad9e  GEODE-9806: added skip recovery of recovered bucket (#7107)

No new revisions were added by this update.

Summary of changes:
 .../geode/internal/cache/ProxyBucketRegion.java| 13 +
 .../internal/cache/ProxyBucketRegionTest.java  | 62 ++
 2 files changed, 75 insertions(+)


[geode] branch develop updated (9079de9 -> 380151b)

2021-10-21 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 9079de9  Revert "Declare dependencies we use, drop unused dependencies 
(#6973)" (#7020)
 add 380151b  GEODE-9743: updated ClientSideHandshakeImpl and added UT 
(#7008)

No new revisions were added by this update.

Summary of changes:
 .../client/internal/ClientSideHandshakeImpl.java   |   3 +-
 .../internal/ClientSideHandshakeImplTest.java  | 214 +
 2 files changed, 216 insertions(+), 1 deletion(-)
 create mode 100644 
geode-core/src/test/java/org/apache/geode/cache/client/internal/ClientSideHandshakeImplTest.java


[geode] branch develop updated (0f36be8 -> 615f180)

2021-10-13 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 0f36be8  Fix assumeTrue description in AcceptList tests.
 add 615f180  GEODE-9635: wait for bucket initialization, after clean queue 
(#6916)

No new revisions were added by this update.

Summary of changes:
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   6 +-
 .../ParallelGatewaySenderQueueJUnitTest.java   |  70 +
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 110 -
 3 files changed, 177 insertions(+), 9 deletions(-)


[geode] branch develop updated: GEODE-9074: Added update of messageQueueSize at putting message to qu… (#6445)

2021-08-17 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 a10a56f  GEODE-9074: Added update of messageQueueSize at putting 
message to qu… (#6445)
a10a56f is described below

commit a10a56f573e9a4aabf3c5b6e3862539d6dd93b92
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Aug 17 22:12:42 2021 +0200

GEODE-9074: Added update of messageQueueSize at putting message to qu… 
(#6445)

* GEODE-9074: Added update of messageQueueSize at putting message to queue.
Also added new statistics messagesBeingQueuedInProgress and 
messagesBeingQueuedTime.
---
 .../cache/tier/sockets/CacheClientProxyTest.java   | 61 +++
 .../cache/tier/sockets/CacheClientProxyStats.java  | 70 +-
 .../cache/tier/sockets/MessageDispatcher.java  |  7 +++
 geode-docs/reference/statistics_list.html.md.erb   |  1 +
 4 files changed, 138 insertions(+), 1 deletion(-)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxyTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxyTest.java
index 079c54e..ca7acf0 100644
--- 
a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxyTest.java
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxyTest.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.cache.tier.sockets;
 
 import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.Assert.assertNull;
 import static org.mockito.ArgumentMatchers.any;
@@ -28,12 +29,20 @@ import static org.mockito.Mockito.when;
 import java.net.InetAddress;
 import java.net.Socket;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.junit.Rule;
 import org.junit.Test;
 
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.EnumListenerEvent;
+import org.apache.geode.internal.cache.EventID;
 import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.LocalRegion;
+import org.apache.geode.internal.cache.ha.HAContainerMap;
+import org.apache.geode.internal.cache.ha.HAContainerWrapper;
 import org.apache.geode.internal.net.SocketCloser;
 import org.apache.geode.internal.serialization.KnownVersion;
 import org.apache.geode.internal.statistics.StatisticsClock;
@@ -93,4 +102,56 @@ public class CacheClientProxyTest {
   closeSocketShouldBeAtomic();
 }
   }
+
+  @Test
+  public void checkQueueingStats() {
+final CacheServerStats stats = mock(CacheServerStats.class);
+doNothing().when(stats).incCurrentQueueConnections();
+
+final InternalCache cache = serverRule.getCache();
+
+final CacheClientNotifier ccn = mock(CacheClientNotifier.class);
+final SocketCloser sc = mock(SocketCloser.class);
+when(ccn.getCache()).thenReturn(cache);
+when(ccn.getAcceptorStats()).thenReturn(stats);
+when(ccn.getSocketCloser()).thenReturn(sc);
+final HAContainerWrapper haContainer = new HAContainerMap(new 
ConcurrentHashMap<>());
+when(ccn.getHaContainer()).thenReturn(haContainer);
+
+final Socket socket = mock(Socket.class);
+final InetAddress address = mock(InetAddress.class);
+when(socket.getInetAddress()).thenReturn(address);
+when(address.getHostAddress()).thenReturn("localhost");
+doNothing().when(sc).asyncClose(any(), eq("localhost"), 
any(Runnable.class));
+
+final ClientProxyMembershipID proxyID = 
mock(ClientProxyMembershipID.class);
+final DistributedMember member = 
cache.getDistributedSystem().getDistributedMember();
+when(proxyID.getDistributedMember()).thenReturn(member);
+final String regionName = "region/test";
+when(proxyID.getHARegionName()).thenReturn(regionName);
+
+CacheClientProxy proxy = new CacheClientProxy(ccn, socket, proxyID, true,
+Handshake.CONFLATION_DEFAULT, KnownVersion.CURRENT, 1L, true,
+null, null, mock(StatisticsClock.class));
+
+Region dataRegion = createDataRegion();
+proxy.initializeMessageDispatcher();
+ClientUpdateMessage clientUpdateMessageImpl1 =
+new ClientUpdateMessageImpl(EnumListenerEvent.AFTER_UPDATE,
+(LocalRegion) dataRegion, "key", "value".getBytes(), (byte) 0x01, 
null,
+new ClientProxyMembershipID(), new 
EventID(cache.getDistributedSystem()));
+ClientUpdateMessage clientUpdateMessageImpl2 =
+

[geode] branch develop updated (9de676e -> 4abcba9)

2021-05-26 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 9de676e  GEODE-9308: Update "Controlling Socket Use" to reflect new 
default (#6516)
 add 4abcba9  GEODE-9272: postpone marking of event as possible duplicate 
to the mo… (#6474)

No new revisions were added by this update.

Summary of changes:
 .../internal/cache/AbstractBucketRegionQueue.java  | 22 --
 .../geode/internal/cache/BucketRegionQueue.java| 39 +-
 .../internal/cache/BucketRegionQueueJUnitTest.java | 83 ++
 3 files changed, 119 insertions(+), 25 deletions(-)


[geode] branch develop updated: GEODE-8191: update flaky test (#6427)

2021-05-24 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 6c1e3d7  GEODE-8191: update flaky test (#6427)
6c1e3d7 is described below

commit 6c1e3d700e1a075bff08b2f81f88387c8a05e489
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Mon May 24 11:33:04 2021 +0200

GEODE-8191: update flaky test (#6427)

* GEODE-8191: solution for failing test

* GEODE-8191: update after comments
---
 .../org/apache/geode/internal/statistics/ResourceInstance.java | 10 ++
 .../org/apache/geode/internal/statistics/SampleCollector.java  |  4 +++-
 .../apache/geode/internal/statistics/StatArchiveWriter.java|  1 +
 .../org/apache/geode/internal/statistics/ValueMonitor.java |  1 +
 .../apache/geode/internal/statistics/SampleCollectorTest.java  |  2 +-
 5 files changed, 16 insertions(+), 2 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
index c83b051..2eb14db 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/ResourceInstance.java
@@ -33,11 +33,13 @@ public class ResourceInstance {
   private long[] previousStatValues = null;
   private long[] latestStatValues = null;
   private int[] updatedStats = null;
+  private boolean statValuesNotified;
 
   public ResourceInstance(int id, Statistics statistics, ResourceType type) {
 this.id = id;
 this.statistics = statistics;
 this.type = type;
+this.statValuesNotified = false;
   }
 
   public int getId() {
@@ -52,6 +54,14 @@ public class ResourceInstance {
 return this.type;
   }
 
+  public boolean getStatValuesNotified() {
+return this.statValuesNotified;
+  }
+
+  public void setStatValuesNotified(boolean notified) {
+this.statValuesNotified = notified;
+  }
+
   public Number getStatValue(StatisticDescriptor sd) {
 return this.statistics.get(sd);
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
index 3bc6c79..49ecea0 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java
@@ -274,7 +274,9 @@ public class SampleCollector {
 }
 
 for (ResourceInstance ri : updatedResources) {
-  ri.setPreviousStatValues(ri.getLatestStatValues());
+  if (ri.getStatValuesNotified()) {
+ri.setPreviousStatValues(ri.getLatestStatValues());
+  }
 }
   }
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
index eb1dbea..1c65ce0 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java
@@ -508,6 +508,7 @@ public class StatArchiveWriter implements 
StatArchiveFormat, SampleHandler {
   }
   writeTimeStamp(nanosTimeStamp);
   for (ResourceInstance ri : resourceInstances) {
+ri.setStatValuesNotified(true);
 writeSample(ri);
   }
   writeResourceInst(ILLEGAL_RESOURCE_INST_ID);
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/ValueMonitor.java
 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/ValueMonitor.java
index f3b6f89..4ee9c71 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/statistics/ValueMonitor.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/statistics/ValueMonitor.java
@@ -98,6 +98,7 @@ public class ValueMonitor extends StatisticsMonitor {
 if (this.statistics.contains(resource.getStatistics())) {
   ResourceType resourceType = resource.getResourceType();
   StatisticDescriptor[] sds = resourceType.getStatisticDescriptors();
+  resource.setStatValuesNotified(true);
   int[] updatedStats = resource.getUpdatedStats();
   for (int i = 0; i < updatedStats.length; i++) {
 int idx = updatedStats[i];
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/statistics/SampleCollectorTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/statistics/SampleCollectorTest.java
index ebbd8ba..4913cb4 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/statistics/SampleCollectorTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/statistics/SampleCollectorTest.java
@@ -210,7 +210,7 @@ pub

[geode] branch develop updated (e32d547 -> 2abc58a)

2021-03-26 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from e32d547  GEODE-8956: added thread pool to LocatorMembershipListener 
(#6048)
 add 2abc58a  GEODE-8768_1: locator discovery improvement (#6013)

No new revisions were added by this update.

Summary of changes:
 .../admin/remote/DistributionLocatorId.java| 107 -
 .../sanctioned-geode-core-serializables.txt|   2 +-
 .../remote/DistributionLocatorIdJUnitTest.java |  49 --
 .../cache/wan/misc/WanAutoDiscoveryDUnitTest.java  |  24 ++-
 .../wan/misc/WanLocatorDiscoveryDUnitTest.java | 131 +++
 .../client/internal/locator/wan/LocatorHelper.java |  95 ++-
 .../locator/wan/LocatorMembershipListenerImpl.java |   7 +-
 .../locator/wan/WanLocatorDiscovererImpl.java  |  17 +-
 .../internal/locator/wan/LocatorHelperTest.java| 178 +
 .../locator/wan/WanLocatorDiscovererTest.java  |  93 +++
 10 files changed, 675 insertions(+), 28 deletions(-)
 create mode 100644 
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanLocatorDiscoveryDUnitTest.java
 create mode 100644 
geode-wan/src/test/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelperTest.java
 create mode 100644 
geode-wan/src/test/java/org/apache/geode/cache/client/internal/locator/wan/WanLocatorDiscovererTest.java


[geode] branch develop updated (4305808 -> e32d547)

2021-03-26 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 4305808  GEODE-9067: register-interest done during rolling upgrade can 
take longer than needed (#6195)
 add e32d547  GEODE-8956: added thread pool to LocatorMembershipListener 
(#6048)

No new revisions were added by this update.

Summary of changes:
 .../locator/wan/LocatorMembershipListener.java |  4 ++
 .../distributed/internal/InternalLocator.java  |  2 +
 geode-wan/build.gradle |  1 +
 .../locator/wan/LocatorMembershipListenerImpl.java | 77 +++---
 .../locator/wan/LocatorMembershipListenerTest.java | 71 +++-
 geode-wan/src/test/resources/expected-pom.xml  |  5 ++
 6 files changed, 121 insertions(+), 39 deletions(-)


[geode] branch revert-5843-feature/GEODE-8768 created (now 31ed0ef)

2021-02-09 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac pushed a change to branch revert-5843-feature/GEODE-8768
in repository https://gitbox.apache.org/repos/asf/geode.git.


  at 31ed0ef  Revert "Feature/geode 8768 (#5843)"

This branch includes the following new commits:

 new 31ed0ef  Revert "Feature/geode 8768 (#5843)"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[geode] 01/01: Revert "Feature/geode 8768 (#5843)"

2021-02-09 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac pushed a commit to branch revert-5843-feature/GEODE-8768
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 31ed0efe4bf9f6c4a3057a881f5094338f612aa3
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Feb 9 17:59:45 2021 +0100

Revert "Feature/geode 8768 (#5843)"

This reverts commit 48a733a576e7db8d558280cfc4491f079c7eefe3.
---
 .../admin/remote/DistributionLocatorId.java| 104 +---
 .../sanctioned-geode-core-serializables.txt|   2 +-
 .../cache/wan/misc/WanAutoDiscoveryDUnitTest.java  |  24 +---
 .../wan/misc/WanLocatorDiscoveryDUnitTest.java | 131 -
 .../client/internal/locator/wan/LocatorHelper.java |  33 --
 .../locator/wan/LocatorMembershipListenerImpl.java |  12 +-
 .../locator/wan/WanLocatorDiscovererImpl.java  |  24 +---
 7 files changed, 17 insertions(+), 313 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
index b69d6c4..3af2017 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
@@ -20,7 +20,6 @@ import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Objects;
 
 import org.apache.commons.lang3.StringUtils;
 
@@ -34,9 +33,7 @@ import org.apache.geode.internal.net.SocketCreator;
 
 /**
  * Identifies the host, port, and bindAddress a distribution locator is 
listening on.
- * Also identifies member name of the distribution locator. This is used to 
improve
- * locator discovery logic.
- * If member name is set to null, then design base logic will be used.
+ *
  *
  */
 public class DistributionLocatorId implements java.io.Serializable {
@@ -52,14 +49,9 @@ public class DistributionLocatorId implements 
java.io.Serializable {
   private boolean serverLocator = true;
   private String hostnameForClients;
   private String hostname;
-  // added due to improvement for cloud native environment
-  private final String membername;
-
 
   /**
* Constructs a DistributionLocatorId with the given host and port.
-   * This constructor is used for design base behavior.
-   *
*/
   public DistributionLocatorId(InetAddress host, int port, String bindAddress,
   SSLConfig sslConfig) {
@@ -67,24 +59,16 @@ public class DistributionLocatorId implements 
java.io.Serializable {
 this.port = port;
 this.bindAddress = validateBindAddress(bindAddress);
 this.sslConfig = validateSSLConfig(sslConfig);
-this.membername = null;
   }
 
+  /**
+   * Constructs a DistributionLocatorId with the given port. The host will be 
set to the local host.
+   */
   public DistributionLocatorId(int port, String bindAddress) {
 this(port, bindAddress, null);
   }
 
   public DistributionLocatorId(int port, String bindAddress, String 
hostnameForClients) {
-this(port, bindAddress, hostnameForClients, null);
-  }
-
-  /**
-   * Constructs a DistributionLocatorId with the given port and member name.
-   * The host will be set to the local host.
-   *
-   */
-  public DistributionLocatorId(int port, String bindAddress, String 
hostnameForClients,
-  String membername) {
 try {
   this.host = LocalHostUtil.getLocalHost();
 } catch (UnknownHostException ex) {
@@ -95,7 +79,6 @@ public class DistributionLocatorId implements 
java.io.Serializable {
 this.bindAddress = validateBindAddress(bindAddress);
 this.sslConfig = validateSSLConfig(null);
 this.hostnameForClients = hostnameForClients;
-this.membername = membername;
   }
 
   public DistributionLocatorId(InetAddress host, int port, String bindAddress, 
SSLConfig sslConfig,
@@ -105,10 +88,8 @@ public class DistributionLocatorId implements 
java.io.Serializable {
 this.bindAddress = validateBindAddress(bindAddress);
 this.sslConfig = validateSSLConfig(sslConfig);
 this.hostnameForClients = hostnameForClients;
-this.membername = null;
   }
 
-
   /**
* Constructs a DistributionLocatorId with a String of the form: 
hostname[port] or
* hostname:bindaddress[port] or hostname@bindaddress[port]
@@ -123,29 +104,6 @@ public class DistributionLocatorId implements 
java.io.Serializable {
* two.
*/
   public DistributionLocatorId(String marshalled) {
-this(marshalled, null);
-  }
-
-  /**
-   * Constructs a DistributionLocatorId with a String of the form: 
hostname[port] or
-   * hostname:bindaddress[port] or hostname@bindaddress[port]
-   * and membername
-   * 
-   * The :bindaddress portion is optional. hostname[port] is the more common 
form.
-   * 
-   * Example: merry.gemstone.com[7056]
-   *

[geode] branch develop updated (d6ec360 -> 48a733a)

2021-02-03 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from d6ec360  GEODE-8906: capture additional gradle log artifacts (#5992)
 add 48a733a  Feature/geode 8768 (#5843)

No new revisions were added by this update.

Summary of changes:
 .../admin/remote/DistributionLocatorId.java| 104 +++-
 .../sanctioned-geode-core-serializables.txt|   2 +-
 .../cache/wan/misc/WanAutoDiscoveryDUnitTest.java  |  24 +++-
 .../wan/misc/WanLocatorDiscoveryDUnitTest.java | 131 +
 .../client/internal/locator/wan/LocatorHelper.java |  33 ++
 .../locator/wan/LocatorMembershipListenerImpl.java |  12 +-
 .../locator/wan/WanLocatorDiscovererImpl.java  |  24 +++-
 7 files changed, 313 insertions(+), 17 deletions(-)
 create mode 100644 
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanLocatorDiscoveryDUnitTest.java



[geode] branch develop updated: GEODE-8822: Clear statistics when clean queue option is used (#5889)

2021-01-15 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 10374d8  GEODE-8822: Clear statistics when clean queue option is used 
(#5889)
10374d8 is described below

commit 10374d806b1a247474e5c78d170ee996532f8bb6
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Fri Jan 15 09:22:24 2021 +0100

GEODE-8822: Clear statistics when clean queue option is used (#5889)

* GEODE-8822: Clear statistics when clean queue option is used

* GEODE-8822: added test
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   | 14 +
 .../internal/beans/GatewaySenderMBeanBridge.java   |  5 ++
 .../beans/stats/GatewaySenderOverflowMonitor.java  |  7 +++
 ...nderOverflowMBeanAttributesDistributedTest.java | 71 ++
 4 files changed, 97 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index b7e2922..797494f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -487,6 +487,7 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
   prQ = (PartitionedRegion) cache.getRegion(prQName);
 
   if ((prQ != null) && (this.index == 0) && this.cleanQueues) {
+cleanOverflowStats(cache);
 prQ.destroyRegion(null);
 prQ = null;
   }
@@ -623,6 +624,19 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 }
   }
 
+  private void cleanOverflowStats(Cache cache) {
+ManagementService service = ManagementService.getManagementService(cache);
+if (!this.asyncEvent) {
+  GatewaySenderMBean bean =
+  (GatewaySenderMBean) 
service.getLocalGatewaySenderMXBean(this.sender.getId());
+  if (bean != null) {
+bean.getBridge().clearOverflowStatistics();
+  }
+}
+
+  }
+
+
   /**
* This will be case when the sender is started again after stop operation.
*/
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 0d38622..78bdaba 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
@@ -89,6 +89,11 @@ public class GatewaySenderMBeanBridge {
 }
   }
 
+  public void clearOverflowStatistics() {
+overflowMonitor.stopListener();
+overflowMonitor.clearCounters();
+  }
+
   public void stopMonitor() {
 monitor.stopListener();
   }
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/GatewaySenderOverflowMonitor.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/GatewaySenderOverflowMonitor.java
index fb38cd1..4cac084 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/GatewaySenderOverflowMonitor.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/GatewaySenderOverflowMonitor.java
@@ -177,6 +177,13 @@ public class GatewaySenderOverflowMonitor extends 
MBeanStatsMonitor {
   @Override
   public void removeStatisticsFromMonitor(Statistics stats) {}
 
+  public void clearCounters() {
+lruEvictions = 0;
+bytesOverflowedToDisk = 0;
+entriesOverflowedToDisk = 0;
+bytesInUse = 0;
+  }
+
   class GatewaySenderOverflowStatisticsListener implements StatisticsListener {
 Map statsMap = new HashMap<>();
 
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/GatewaySenderOverflowMBeanAttributesDistributedTest.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/GatewaySenderOverflowMBeanAttributesDistributedTest.java
index f645749..0c70736 100644
--- 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/GatewaySenderOverflowMBeanAttributesDistributedTest.java
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/GatewaySenderOverflowMBeanAttributesDistributedTest.java
@@ -154,6 +154,59 @@ public class 
GatewaySenderOverflowMBeanAttributesDistributedTest extends WANTest
 vm4.invoke(() -> compareSerialOverflowStatsToMBeanAttributes(senderId));
   }
 
+  @Test
+  @Parameters({"true", "false"})
+  public void testParallelGatewaySenderOverflowMBeanAttributesClear(boolean 
createSenderFirst)
+  throws Excepti

[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.exe

[geode] branch develop updated (8f8e9d7 -> 57db39c)

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

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


from 8f8e9d7  GEODE-8521: Add tests for CoreLoggingExecutors (#5757)
 add 57db39c  GEODE-8714_1: update test according to comments (#5760)

No new revisions were added by this update.

Summary of changes:
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 48 --
 1 file changed, 17 insertions(+), 31 deletions(-)



[geode] branch develop updated (f3d806f -> 1eb9f34)

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

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


from f3d806f  GEODE-8293: fix activeCQCount has negative value after 
close/stop cq for PR (#5620)
 add 1eb9f34  GEODE-8714: return event to queue at stoping of gw sender 
(#5752)

No new revisions were added by this update.

Summary of changes:
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   9 +-
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 100 +
 2 files changed, 103 insertions(+), 6 deletions(-)



[geode] branch develop updated (f3d806f -> 1eb9f34)

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

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


from f3d806f  GEODE-8293: fix activeCQCount has negative value after 
close/stop cq for PR (#5620)
 add 1eb9f34  GEODE-8714: return event to queue at stoping of gw sender 
(#5752)

No new revisions were added by this update.

Summary of changes:
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   9 +-
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 100 +
 2 files changed, 103 insertions(+), 6 deletions(-)



[geode] branch develop updated (f3d806f -> 1eb9f34)

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

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


from f3d806f  GEODE-8293: fix activeCQCount has negative value after 
close/stop cq for PR (#5620)
 add 1eb9f34  GEODE-8714: return event to queue at stoping of gw sender 
(#5752)

No new revisions were added by this update.

Summary of changes:
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   9 +-
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 100 +
 2 files changed, 103 insertions(+), 6 deletions(-)



[geode] branch develop updated (f3d806f -> 1eb9f34)

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

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


from f3d806f  GEODE-8293: fix activeCQCount has negative value after 
close/stop cq for PR (#5620)
 add 1eb9f34  GEODE-8714: return event to queue at stoping of gw sender 
(#5752)

No new revisions were added by this update.

Summary of changes:
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   9 +-
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 100 +
 2 files changed, 103 insertions(+), 6 deletions(-)



[geode] branch develop updated (f3d806f -> 1eb9f34)

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

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


from f3d806f  GEODE-8293: fix activeCQCount has negative value after 
close/stop cq for PR (#5620)
 add 1eb9f34  GEODE-8714: return event to queue at stoping of gw sender 
(#5752)

No new revisions were added by this update.

Summary of changes:
 .../wan/parallel/ParallelGatewaySenderQueue.java   |   9 +-
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 100 +
 2 files changed, 103 insertions(+), 6 deletions(-)



[geode] branch develop updated: GEODE-8547: Added impacts to show missing disk-stores (#5567)

2020-11-05 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 7cc14ee  GEODE-8547: Added impacts to show missing disk-stores (#5567)
7cc14ee is described below

commit 7cc14eef52e06fe1e8c56bd766df56297b9c9ff8
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Thu Nov 5 11:06:06 2020 +0100

GEODE-8547: Added impacts to show missing disk-stores (#5567)

* GEODE-8547: Added impacts to show missing disk-stores

* GEODE-8547: Added DUnit test

* GEODE-8547: update after comments

* GEODE-8547: remove unused variables

* GEODE-8547: update test
---
 .../ShowMissingDiskStoreCommandDUnitTest.java  | 57 ++
 .../cli/commands/ShowMissingDiskStoreCommand.java  | 16 +++---
 2 files changed, 65 insertions(+), 8 deletions(-)

diff --git 
a/geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommandDUnitTest.java
 
b/geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommandDUnitTest.java
index 254bd3c..160b92d 100644
--- 
a/geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommandDUnitTest.java
+++ 
b/geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommandDUnitTest.java
@@ -28,15 +28,18 @@ import org.junit.rules.TestName;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.model.ResultModel;
 import 
org.apache.geode.management.internal.cli.result.model.TabularResultModel;
 import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
 import org.apache.geode.management.internal.i18n.CliStrings;
+import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.PersistenceTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
+import org.apache.geode.test.junit.rules.LocatorStarterRule;
 
 @Category({PersistenceTest.class})
 public class ShowMissingDiskStoreCommandDUnitTest {
@@ -61,6 +64,7 @@ public class ShowMissingDiskStoreCommandDUnitTest {
 // start a server so that we can execute data commands that requires at 
least a server running
   }
 
+
   @Test
   public void showMissingDiskStoresDoesNotDuplicateDiskStores() {
 MemberVM server1 = lsRule.startServerVM(1, locator.getPort());
@@ -156,6 +160,59 @@ public class ShowMissingDiskStoreCommandDUnitTest {
 assertThat(missingDiskStoreIds).isNull();
   }
 
+
+  @Test
+  public void stopAllMembersAndStart2ndLocator() throws Exception {
+
IgnoredException.addIgnoredException(DistributedSystemDisconnectedException.class);
+
+MemberVM locator1 = lsRule.startLocatorVM(1, locator.getPort());
+
+lsRule.startServerVM(2, locator.getPort(), locator1.getPort());
+lsRule.startServerVM(3, locator.getPort(), locator1.getPort());
+
+final String testRegionName = "regionA";
+
+CommandStringBuilder createRegion = new 
CommandStringBuilder(CliStrings.CREATE_REGION)
+.addOption(CliStrings.CREATE_REGION__REGION, testRegionName)
+.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT,
+RegionShortcut.PARTITION_REDUNDANT.toString());
+await().untilAsserted(() -> 
gfshConnector.executeAndAssertThat(createRegion.getCommandString())
+.statusIsSuccess());
+
+// stop locator1 before locator0
+lsRule.stop(1, false);
+
+lsRule.stop(2, false);
+
+lsRule.stop(0, false);
+
+lsRule.stop(3, false);
+final int locatorPort = locator1.getPort();
+
+// start stale locator
+locator1.invokeAsync("restart locator in vm1", () -> {
+  LocatorStarterRule locatorStarter = new LocatorStarterRule();
+  locatorStarter.withName("locator-1");
+  locatorStarter.withPort(locatorPort);
+  locatorStarter.withAutoStart();
+  locatorStarter.before();
+});
+
+await().untilAsserted(() -> gfshConnector.connectAndVerify(locator1));
+
+// execute show missing-disk-stores
+await().untilAsserted(() -> {
+  CommandStringBuilder csb1 = new 
CommandStringBuilder(CliStrings.SHOW_MISSING_DISK_STORE);
+  @SuppressWarnings("deprecation")
+  CommandResult commandResult = 
gfshConnector.executeCommand(csb1.getCommandString());
+  ResultModel result = commandResu

[geode] branch develop updated: GEODE-8497: added getTotalQueueSizeBytesInUse (#5514)

2020-10-19 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 c362f77  GEODE-8497: added getTotalQueueSizeBytesInUse (#5514)
c362f77 is described below

commit c362f77591fa83e5f87a056fe221d1241de87348
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Mon Oct 19 08:02:55 2020 +0200

GEODE-8497: added getTotalQueueSizeBytesInUse (#5514)

* GEODE-8497: added getTotalQueueSizeBytesInUse

* GEODE-8497: updated UT

* GEODE-8497: fix fail statistics after restart
---
 .../geode/internal/cache/RegionMapFactory.java  |  9 -
 .../geode/management/GatewaySenderMXBean.java   |  5 +
 .../internal/beans/GatewaySenderMBean.java  |  5 +
 .../internal/beans/GatewaySenderMBeanBridge.java|  6 ++
 .../beans/stats/GatewaySenderOverflowMonitor.java   | 21 +
 .../management/internal/beans/stats/StatsKey.java   |  2 ++
 .../stats/GatewaySenderOverflowMonitorTest.java | 18 +-
 7 files changed, 64 insertions(+), 2 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionMapFactory.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionMapFactory.java
index 48e64fe..92c85fe 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionMapFactory.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionMapFactory.java
@@ -15,7 +15,7 @@
 
 package org.apache.geode.internal.cache;
 
-
+import org.apache.geode.internal.cache.eviction.EvictionController;
 
 /**
  * Used to produce instances of RegionMap
@@ -39,6 +39,13 @@ class RegionMapFactory {
// 
eviction tests to fail
   return new ProxyRegionMap(owner, attrs, internalRegionArgs);
 } else if (owner.isEntryEvictionPossible()) {
+  if (owner instanceof PartitionedRegion) {
+PartitionedRegion pr = (PartitionedRegion) owner;
+EvictionController evctrl = 
pr.getPREvictionControllerFromDiskInitialization();
+if (evctrl != null) {
+  return new VMLRURegionMap(owner, attrs, internalRegionArgs, evctrl);
+}
+  }
   return new VMLRURegionMap(owner, attrs, internalRegionArgs);
 } else {
   return new VMRegionMap(owner, attrs, internalRegionArgs);
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/GatewaySenderMXBean.java 
b/geode-core/src/main/java/org/apache/geode/management/GatewaySenderMXBean.java
index 67c1350..a889dd5 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/GatewaySenderMXBean.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/GatewaySenderMXBean.java
@@ -177,6 +177,11 @@ public interface GatewaySenderMXBean {
   int getTotalBatchesRedistributed();
 
   /**
+   * Returns the total number of bytes in heap occupied by the event queue.
+   */
+  long getTotalQueueSizeBytesInUse();
+
+  /**
* Starts this GatewaySender. Once the GatewaySender is running its 
configuration cannot be
* changed.
*
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBean.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBean.java
index a2d1251..1f422ff 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBean.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/GatewaySenderMBean.java
@@ -134,6 +134,11 @@ public class GatewaySenderMBean extends 
NotificationBroadcasterSupport
   }
 
   @Override
+  public long getTotalQueueSizeBytesInUse() {
+return bridge.getTotalQueueSizeBytesInUse();
+  }
+
+  @Override
   public boolean isBatchConflationEnabled() {
 return bridge.isBatchConflationEnabled();
   }
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 42b4bbf..7eda2b4 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
@@ -291,6 +291,12 @@ public class GatewaySenderMBeanBridge {
 .longValue();
   }
 
+  public long getTotalQueueSizeBytesInUse() {
+return overflowMonitor.getStatistic(StatsKey.GATEWAYSENDER_BYTES_IN_MEMORY)
+.longValue();
+  }
+
+
   private Number getStatistic(String statName) {
 if (monitor != null) {
   return monitor.getStatistic(statName);
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/GatewaySenderOverflowMonitor.java
 
b/geod

[geode] branch develop updated: GEODE-8600: Fix for faulty statistics QueueSize (#5616)

2020-10-13 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 1cab75d  GEODE-8600: Fix for faulty statistics QueueSize (#5616)
1cab75d is described below

commit 1cab75df7f95e82d113b4f81596bf2eda1e333fc
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Oct 13 11:25:22 2020 +0200

GEODE-8600: Fix for faulty statistics QueueSize (#5616)
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   |  3 ++
 .../geode/internal/cache/wan/WANTestBase.java  |  9 +
 .../wan/parallel/ParallelWANStatsDUnitTest.java| 43 ++
 3 files changed, 55 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 108eff5..88ef0b1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -278,6 +278,9 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 for (Region userRegion : listOfRegions) {
   if (userRegion instanceof PartitionedRegion) {
 addShadowPartitionedRegionForUserPR((PartitionedRegion) userRegion);
+if (index == 0 && getRegion(userRegion.getFullPath()) != null) {
+  
this.stats.incQueueSize(getRegion(userRegion.getFullPath()).getLocalSize());
+}
   } else {
 // Fix for Bug#51491. Once decided to support this configuration we 
have call
 // addShadowPartitionedRegionForUserRR
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
index 883b313..8446885 100644
--- 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
@@ -1202,6 +1202,15 @@ public class WANTestBase extends DistributedTestCase {
 return statistics.getSecondaryEventQueueSize();
   }
 
+  public static void checkQueueSizeInStats(String senderId, final int 
expectedQueueSize) {
+AbstractGatewaySender sender = (AbstractGatewaySender) 
cache.getGatewaySender(senderId);
+GatewaySenderStats statistics = sender.getStatistics();
+await()
+.untilAsserted(() -> assertEquals("Expected queue size: " + 
expectedQueueSize
++ " but actual size: " + statistics.getEventQueueSize(), 
expectedQueueSize,
+statistics.getEventQueueSize()));
+  }
+
   public static void checkConnectionStats(String senderId) {
 AbstractGatewaySender sender =
 (AbstractGatewaySender) 
CacheFactory.getAnyInstance().getGatewaySender(senderId);
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
index 7155975..7ff1c8d 100644
--- 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
@@ -1054,6 +1054,49 @@ public class ParallelWANStatsDUnitTest extends 
WANTestBase {
 verifyConflationIndexesSize(senderId, 0, vm1);
   }
 
+
+  @Test
+  public void 
testPartitionedRegionParallelPropagation_RestartSenders_NoRedundancy() {
+Integer lnPort = vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId(1));
+Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, 
lnPort));
+
+createCacheInVMs(nyPort, vm2);
+createReceiverInVMs(vm2);
+
+createSenders(lnPort);
+
+createReceiverPR(vm2, 0);
+
+createSenderPRs(0);
+
+startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
+// pause the senders
+vm4.invoke(() -> WANTestBase.pauseSender("ln"));
+vm5.invoke(() -> WANTestBase.pauseSender("ln"));
+vm6.invoke(() -> WANTestBase.pauseSender("ln"));
+vm7.invoke(() -> WANTestBase.pauseSender("ln"));
+
+vm4.invoke(() -> WANTestBase.doPuts(testName, NUM_PUTS));
+
+vm4.invoke(() -> WANTestBase.stopSender("ln"));
+vm5.invoke(() -> WANTestBase.stopSender("ln"));
+vm6.invoke(() -> WANTestBase.stopSender("ln"));
+vm7.invoke(() -> WANTestBase.stopSender("ln"));
+
+startSenderInVMs("ln", vm

[geode] branch develop updated: GEODE-8600: Fix for faulty statistics QueueSize (#5616)

2020-10-13 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 1cab75d  GEODE-8600: Fix for faulty statistics QueueSize (#5616)
1cab75d is described below

commit 1cab75df7f95e82d113b4f81596bf2eda1e333fc
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Oct 13 11:25:22 2020 +0200

GEODE-8600: Fix for faulty statistics QueueSize (#5616)
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   |  3 ++
 .../geode/internal/cache/wan/WANTestBase.java  |  9 +
 .../wan/parallel/ParallelWANStatsDUnitTest.java| 43 ++
 3 files changed, 55 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 108eff5..88ef0b1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -278,6 +278,9 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 for (Region userRegion : listOfRegions) {
   if (userRegion instanceof PartitionedRegion) {
 addShadowPartitionedRegionForUserPR((PartitionedRegion) userRegion);
+if (index == 0 && getRegion(userRegion.getFullPath()) != null) {
+  
this.stats.incQueueSize(getRegion(userRegion.getFullPath()).getLocalSize());
+}
   } else {
 // Fix for Bug#51491. Once decided to support this configuration we 
have call
 // addShadowPartitionedRegionForUserRR
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
index 883b313..8446885 100644
--- 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
@@ -1202,6 +1202,15 @@ public class WANTestBase extends DistributedTestCase {
 return statistics.getSecondaryEventQueueSize();
   }
 
+  public static void checkQueueSizeInStats(String senderId, final int 
expectedQueueSize) {
+AbstractGatewaySender sender = (AbstractGatewaySender) 
cache.getGatewaySender(senderId);
+GatewaySenderStats statistics = sender.getStatistics();
+await()
+.untilAsserted(() -> assertEquals("Expected queue size: " + 
expectedQueueSize
++ " but actual size: " + statistics.getEventQueueSize(), 
expectedQueueSize,
+statistics.getEventQueueSize()));
+  }
+
   public static void checkConnectionStats(String senderId) {
 AbstractGatewaySender sender =
 (AbstractGatewaySender) 
CacheFactory.getAnyInstance().getGatewaySender(senderId);
diff --git 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
index 7155975..7ff1c8d 100644
--- 
a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
+++ 
b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
@@ -1054,6 +1054,49 @@ public class ParallelWANStatsDUnitTest extends 
WANTestBase {
 verifyConflationIndexesSize(senderId, 0, vm1);
   }
 
+
+  @Test
+  public void 
testPartitionedRegionParallelPropagation_RestartSenders_NoRedundancy() {
+Integer lnPort = vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId(1));
+Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, 
lnPort));
+
+createCacheInVMs(nyPort, vm2);
+createReceiverInVMs(vm2);
+
+createSenders(lnPort);
+
+createReceiverPR(vm2, 0);
+
+createSenderPRs(0);
+
+startSenderInVMs("ln", vm4, vm5, vm6, vm7);
+
+// pause the senders
+vm4.invoke(() -> WANTestBase.pauseSender("ln"));
+vm5.invoke(() -> WANTestBase.pauseSender("ln"));
+vm6.invoke(() -> WANTestBase.pauseSender("ln"));
+vm7.invoke(() -> WANTestBase.pauseSender("ln"));
+
+vm4.invoke(() -> WANTestBase.doPuts(testName, NUM_PUTS));
+
+vm4.invoke(() -> WANTestBase.stopSender("ln"));
+vm5.invoke(() -> WANTestBase.stopSender("ln"));
+vm6.invoke(() -> WANTestBase.stopSender("ln"));
+vm7.invoke(() -> WANTestBase.stopSender("ln"));
+
+startSenderInVMs("ln", vm

[geode] branch develop updated (74a850b -> 6c8bc5e)

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

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


from 74a850b  GEODE-8172_2: refactoring of failing testcase (#5599)
 add 6c8bc5e  GEODE-8216: modify test (#5335)

No new revisions were added by this update.

Summary of changes:
 ...alWANPersistenceEnabledGatewaySenderDUnitTest.java | 19 ---
 1 file changed, 4 insertions(+), 15 deletions(-)



[geode] branch develop updated (dbd1803 -> 74a850b)

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

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


from dbd1803  GEODE-8572: Make LogExporter not read dirs (#5595)
 add 74a850b  GEODE-8172_2: refactoring of failing testcase (#5599)

No new revisions were added by this update.

Summary of changes:
 ...arallelWANPersistenceEnabledGatewaySenderDUnitTest.java | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)



[geode] branch develop updated: GEODE-8421: replace clean with destroy region (#5445)

2020-10-06 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 9bc288a  GEODE-8421: replace clean with destroy region (#5445)
9bc288a is described below

commit 9bc288a6c421315e8da4fb00d8461f6312fa0ced
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Oct 6 09:22:38 2020 +0200

GEODE-8421: replace clean with destroy region (#5445)
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   | 28 --
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 300de32..108eff5 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -482,6 +482,12 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 
   final String prQName = sender.getId() + QSTRING + 
convertPathToName(userPR.getFullPath());
   prQ = (PartitionedRegion) cache.getRegion(prQName);
+
+  if ((prQ != null) && (this.index == 0) && this.cleanQueues) {
+prQ.destroyRegion(null);
+prQ = null;
+  }
+
   if (prQ == null) {
 RegionShortcut regionShortcut;
 if (sender.isPersistenceEnabled() && !isAccessor) {
@@ -549,20 +555,14 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
 // Add the overflow statistics to the mbean
 addOverflowStatisticsToMBean(cache, prQ);
 
-// Wait for buckets to be recovered.
-prQ.shadowPRWaitForBucketRecovery();
+if (!this.cleanQueues) {
+  // Wait for buckets to be recovered.
+  prQ.shadowPRWaitForBucketRecovery();
+}
 
 if (logger.isDebugEnabled()) {
   logger.debug("{}: Created queue region: {}", this, prQ);
 }
-if (this.cleanQueues) {
-  // now, clean up the shadowPR's buckets on this node (primary as 
well as
-  // secondary) for a fresh start
-  Set localBucketRegions = 
prQ.getDataStore().getAllLocalBucketRegions();
-  for (BucketRegion bucketRegion : localBucketRegions) {
-bucketRegion.clear();
-  }
-}
 
   } else {
 if (isAccessor)
@@ -629,14 +629,6 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
   logger.debug("{}: No need to create the region as the region has been 
retrieved: {}", this,
   prQ);
 }
-// now, clean up the shadowPR's buckets on this node (primary as well as
-// secondary) for a fresh start
-if (this.cleanQueues) {
-  Set localBucketRegions = 
prQ.getDataStore().getAllLocalBucketRegions();
-  for (BucketRegion bucketRegion : localBucketRegions) {
-bucketRegion.clear();
-  }
-}
   }
 
   protected void afterRegionAdd(PartitionedRegion userPR) {



[geode] branch develop updated (537721f -> 8a47743)

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

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


from 537721f  GEODE-8419: SSL/TLS protocol and cipher suite configuration 
is ignored (#5465)
 add 8a47743  GEODE-8433: added inheritance of off-heap attribute (#5460)

No new revisions were added by this update.

Summary of changes:
 .../apache/geode/cache/RegionFactoryJUnitTest.java | 49 ++
 .../cache/xmlcache/RegionAttributesCreation.java   |  9 
 2 files changed, 58 insertions(+)



[geode] branch develop updated (d19368f -> 21e2609)

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

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


from d19368f  Revert "GEODE-8393: change memberDeparted to disconnect the 
connection (#5431)" (#5441)
 add 21e2609  GEODE-8172_1: additional check added (#5444)

No new revisions were added by this update.

Summary of changes:
 .../ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java | 5 +
 1 file changed, 5 insertions(+)



[geode] branch develop updated (d19368f -> 21e2609)

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

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


from d19368f  Revert "GEODE-8393: change memberDeparted to disconnect the 
connection (#5431)" (#5441)
 add 21e2609  GEODE-8172_1: additional check added (#5444)

No new revisions were added by this update.

Summary of changes:
 .../ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java | 5 +
 1 file changed, 5 insertions(+)



[geode] branch develop updated: GEODE-8292: Added check if key is destroyed in CQResults (#5426)

2020-08-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 2b86f66  GEODE-8292: Added check if key is destroyed in CQResults 
(#5426)
2b86f66 is described below

commit 2b86f66a6e2c741e9a825a4d8185d84d53c9fdee
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Fri Aug 7 12:39:52 2020 +0200

GEODE-8292: Added check if key is destroyed in CQResults (#5426)
---
 .../geode/cache/query/internal/cq/ServerCQ.java|  5 +++
 .../geode/cache/query/cq/CQDistributedTest.java| 41 --
 .../cache/query/cq/internal/CqServiceImpl.java |  3 +-
 .../cache/query/cq/internal/ServerCQImpl.java  |  8 +
 .../query/cq/internal/ServerCQResultsCache.java|  2 ++
 .../cq/internal/ServerCQResultsCacheNoOpImpl.java  |  5 +++
 .../ServerCQResultsCachePartitionRegionImpl.java   |  5 +++
 .../ServerCQResultsCacheReplicateRegionImpl.java   |  5 +++
 8 files changed, 71 insertions(+), 3 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQ.java
 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQ.java
index 08bfba3..1f004f9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQ.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQ.java
@@ -77,6 +77,11 @@ public interface ServerCQ extends InternalCqQuery {
   boolean isOldValueRequiredForQueryProcessing(Object key);
 
   /**
+   * Returns true if key is in destroy token mode.
+   */
+  boolean isKeyDestroyed(Object key);
+
+  /**
* Closes the Query. On Client side, sends the cq close request to server. 
On Server side, takes
* care of repository cleanup.
*
diff --git 
a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/CQDistributedTest.java
 
b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/CQDistributedTest.java
index dd50836..f46b714 100644
--- 
a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/CQDistributedTest.java
+++ 
b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/CQDistributedTest.java
@@ -51,13 +51,14 @@ public class CQDistributedTest implements Serializable {
 
   private MemberVM locator;
   private MemberVM server;
-  private int locator1Port;
+  private MemberVM server2;
 
   private CqAttributes cqa;
   private QueryService qs;
   private TestCqListener testListener;
   private TestCqListener2 testListener2;
 
+  private Region region;
 
   @Rule
   public ClusterStartupRule clusterStartupRule = new ClusterStartupRule();
@@ -69,8 +70,11 @@ public class CQDistributedTest implements Serializable {
 server = clusterStartupRule.startServerVM(3, locator1Port);
 createServerRegion(server, RegionShortcut.PARTITION);
 
+server2 = clusterStartupRule.startServerVM(4, locator1Port);
+createServerRegion(server2, RegionShortcut.PARTITION);
+
 ClientCache clientCache = createClientCache(locator1Port);
-Region region =
+region =
 
clientCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).create("region");
 
 qs = clientCache.getQueryService();
@@ -233,6 +237,39 @@ public class CQDistributedTest implements Serializable {
 await().untilAsserted(() -> 
assertThat(testListener2.onEventUpdateCalls).isEqualTo(0));
   }
 
+  @Test
+  public void cqWithTransaction2Servers() throws Exception {
+
+qs.newCq("Select * from /region r where r.ID = 1", cqa).execute();
+
+final CacheTransactionManager txMgr = 
region.getCache().getCacheTransactionManager();
+
+// CREATE new entry
+for (int i = 0; i < 4; i++) {
+  txMgr.begin();
+  region.put(i, new Portfolio(1));
+  txMgr.commit();
+}
+
+// UPDATE
+for (int i = 0; i < 4; i++) {
+  txMgr.begin();
+  region.put(i, new Portfolio(0));
+  txMgr.commit();
+}
+
+// CREATE
+for (int i = 0; i < 4; i++) {
+  txMgr.begin();
+  region.put(i, new Portfolio(1));
+  txMgr.commit();
+}
+
+await().untilAsserted(() -> 
assertThat(testListener2.onEventCreateCalls).isEqualTo(8));
+await().untilAsserted(() -> 
assertThat(testListener2.onEventUpdateCalls).isEqualTo(0));
+  }
+
+
   private class TestCqListener implements CqListener, Serializable {
 public int onEventCalls = 0;
 
diff --git 
a/geode-cq/src/main/java/org/apache/geode/cache/query/cq/internal/CqServiceImpl.java
 
b/geode-cq/src/main/java/org/apache/geode/cache/query/cq/internal/CqServiceImpl.java
index bf09bd7..554a49c 100644
--- 
a/geode-cq/src/main/java/org/apache/geode/cache/query/cq/internal/CqServiceImpl.java
+++ 
b/geode-cq/src/main/java/org/apache/geode/cache/query/cq/internal/CqServiceImpl.java
@@ -1367,7 +1367,8 @@ pub

[geode] branch develop updated (c79a5bc -> f521117)

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

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


from c79a5bc  Revert "Fix test-container and internal docker image. 
(#5319)" (#5326)
 add f521117  GEODE-8172: flaky test (#5148)

No new revisions were added by this update.

Summary of changes:
 ...PersistenceEnabledGatewaySenderOffHeapDUnitTest.java |  1 +
 ...llelWANPersistenceEnabledGatewaySenderDUnitTest.java | 17 +
 2 files changed, 14 insertions(+), 4 deletions(-)



[geode] branch develop updated (f84e9e8 -> 6bd1d4b)

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

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


from f84e9e8  GEODE-8303: refactor Redis (String)SetExecutor (#5216)
 add 6bd1d4b  GEODE-8247: modified FilterRoutingInfo checks (#5248)

No new revisions were added by this update.

Summary of changes:
 .../apache/geode/internal/cache/FilterProfile.java | 23 +--
 .../internal/cache/TxCallbackEventFactoryImpl.java |  3 +-
 .../geode/cache/query/cq/CQDistributedTest.java| 80 +-
 3 files changed, 96 insertions(+), 10 deletions(-)



[geode] branch develop updated (e159238 -> 86778ec)

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

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


from e159238  GEODE-8268: clean up ExecutionHandlerContext (#5237)
 add 86778ec  GEODE-7591: Fix for hang in ClusterDistributionManager (#5182)

No new revisions were added by this update.

Summary of changes:
 .../ClusterDistributionManagerDUnitTest.java   | 33 ++
 .../internal/ClusterDistributionManager.java   |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)



[geode] branch develop updated (7538de5 -> 19d5f78)

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

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


from 7538de5  GEODE-8167: bump spring security to recommended version 
(#5144)
 add 19d5f78  GEODE-7458: Adding option in gfsh command "start gateway 
sender" to control clearing of existing queues (#4387)

No new revisions were added by this update.

Summary of changes:
 ...elGatewaySenderFlushedCoordinatorJUnitTest.java |   2 +-
 .../internal/ParallelAsyncEventQueueImpl.java  |  12 +-
 .../internal/SerialAsyncEventQueueImpl.java|  19 +-
 .../org/apache/geode/cache/wan/GatewaySender.java  |   6 +
 .../geode/internal/cache/ColocationHelper.java |   3 +-
 .../internal/cache/wan/AbstractGatewaySender.java  |   3 +
 .../wan/AbstractGatewaySenderEventProcessor.java   |  18 +-
 ...currentParallelGatewaySenderEventProcessor.java |  11 +-
 .../ConcurrentParallelGatewaySenderQueue.java  |   6 +
 .../ParallelGatewaySenderEventProcessor.java   |  14 +-
 .../wan/parallel/ParallelGatewaySenderQueue.java   |  98 +--
 ...oncurrentSerialGatewaySenderEventProcessor.java |   9 +-
 .../serial/SerialGatewaySenderEventProcessor.java  |   8 +-
 .../cache/wan/serial/SerialGatewaySenderQueue.java |  23 +-
 .../xmlcache/ParallelAsyncEventQueueCreation.java  |   3 +
 .../xmlcache/ParallelGatewaySenderCreation.java|   3 +
 .../xmlcache/SerialAsyncEventQueueCreation.java|   3 +
 .../xmlcache/SerialGatewaySenderCreation.java  |   3 +
 .../geode/management/GatewaySenderMXBean.java  |   9 +
 .../internal/beans/GatewaySenderMBean.java |   5 +
 .../internal/beans/GatewaySenderMBeanBridge.java   |   5 +
 .../geode/management/internal/i18n/CliStrings.java |   6 +-
 .../internal/ParallelAsyncEventQueueImplTest.java  |  97 +++
 .../internal/SerialAsyncEventQueueImplTest.java|  31 ++-
 ...entParallelGatewaySenderEventProcessorTest.java |   4 +-
 .../ParallelGatewaySenderEventProcessorTest.java   |   5 +-
 .../wan/parallel/ParallelGatewaySenderHelper.java  |   3 +-
 .../ParallelGatewaySenderQueueJUnitTest.java   |   8 +-
 ...SerialGatewaySenderEventProcessorJUnitTest.java |   2 +-
 ...SerialGatewaySenderEventProcessorJUnitTest.java |   2 +-
 .../TestSerialGatewaySenderEventProcessor.java |   6 +-
 .../beans/GatewaySenderMBeanBridgeTest.java|  94 +++
 .../internal/beans/GatewaySenderMBeanTest.java}|  34 ++-
 .../gfsh/command-pages/start.html.md.erb   |  15 +-
 .../cli/commands/StartGatewaySenderCommand.java|  13 +-
 .../java/org/apache/geode/test/fake/Fakes.java |   3 +
 .../geode/internal/cache/wan/WANTestBase.java  |  39 +++
 ...ParallelGatewaySenderOperation_1_DUnitTest.java |   8 +
 ...ParallelGatewaySenderOperation_2_DUnitTest.java |   2 +
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 291 +
 ...rialGatewaySenderOperationsDistributedTest.java |  10 +-
 ...ANPersistenceEnabledGatewaySenderDUnitTest.java | 148 +++
 .../StartGatewaySenderCommandDUnitTest.java|  97 +++
 .../wan/GatewaySenderEventRemoteDispatcher.java|   4 +-
 .../wan/parallel/ParallelGatewaySenderImpl.java|  12 +-
 ...currentParallelGatewaySenderEventProcessor.java |   9 +-
 .../RemoteParallelGatewaySenderEventProcessor.java |   9 +-
 ...oncurrentSerialGatewaySenderEventProcessor.java |   8 +-
 .../RemoteSerialGatewaySenderEventProcessor.java   |   4 +-
 .../cache/wan/serial/SerialGatewaySenderImpl.java  |  34 ++-
 .../parallel/ParallelGatewaySenderImplTest.java|  92 +++
 .../wan/serial/SerialGatewaySenderImplTest.java|  89 ---
 52 files changed, 1272 insertions(+), 170 deletions(-)
 create mode 100644 
geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/ParallelAsyncEventQueueImplTest.java
 create mode 100644 
geode-core/src/test/java/org/apache/geode/management/internal/beans/GatewaySenderMBeanBridgeTest.java
 copy 
geode-core/src/test/java/org/apache/geode/{internal/cache/tier/sockets/CCUStatsTest.java
 => management/internal/beans/GatewaySenderMBeanTest.java} (60%)
 create mode 100644 
geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImplTest.java
 copy 
geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImplTest.java
 => 
geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImplTest.java
 (54%)



[geode] branch develop updated: GEODE-7963: solution for faulty bucket metrics (#5000)

2020-05-10 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 1b4b60c  GEODE-7963: solution for faulty bucket metrics (#5000)
1b4b60c is described below

commit 1b4b60ca66867a995a593eb0727404e0d89ab9c9
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Sun May 10 10:45:42 2020 +0200

GEODE-7963: solution for faulty bucket metrics (#5000)

* GEODE-7963: solution for faulty bucket metrics

* GEODE-7963: added test to reproduce fault

* GEODE-7963: added UT

* GEODE-7963: update after comments

* GEODE-7963: small updates
---
 .../management/MemberMXBeanDistributedTest.java| 129 +
 .../geode/internal/cache/GemFireCacheImpl.java |   3 +-
 .../geode/internal/cache/InternalRegion.java   |   4 +
 .../apache/geode/internal/cache/LocalRegion.java   |  10 ++
 .../internal/cache/PRHARedundancyProvider.java |   5 +
 .../geode/internal/cache/PartitionedRegion.java|  22 +++-
 .../internal/cache/PartitionedRegionTest.java  |  24 
 7 files changed, 195 insertions(+), 2 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/management/MemberMXBeanDistributedTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/management/MemberMXBeanDistributedTest.java
new file mode 100644
index 000..55a82a2
--- /dev/null
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/management/MemberMXBeanDistributedTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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.management;
+
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.junit.Assert.assertEquals;
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.partition.PartitionRegionHelper;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.categories.GfshTest;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
+
+@Category({GfshTest.class})
+public class MemberMXBeanDistributedTest implements
+Serializable {
+
+  private static MemberVM locator;
+  private static MemberVM server1;
+  private static MemberVM server2;
+  private static MemberVM server3;
+  private static MemberVM server4;
+
+  @ClassRule
+  public static ClusterStartupRule lsRule = new ClusterStartupRule();
+
+  @ClassRule
+  public static GfshCommandRule gfsh = new GfshCommandRule();
+
+  @Rule
+  public TestName testName = new SerializableTestName();
+
+  @BeforeClass
+  public static void before() throws Exception {
+locator = lsRule.startLocatorVM(0);
+server1 = lsRule.startServerVM(1, "", locator.getPort());
+server2 = lsRule.startServerVM(2, "", locator.getPort());
+server3 = lsRule.startServerVM(3, "", locator.getPort());
+server4 = lsRule.startServerVM(4, "", locator.getPort());
+
+gfsh.connectAndVerify(locator);
+  }
+
+  @Test
+  public void testBucketCount() {
+String regionName = "testCreateRegion";
+
+gfsh.executeAndAssertThat("create region"
++ " --name=" + regionName
++ " --type=PARTITION_PERSISTENT"
++ " --total-num-buckets=1000").statusIsSuccess();
+
+server1.invoke(() -> createBuckets(regionName));
+server2.invoke(() -> createBuckets(regionName));
+server3.invoke(() -> createBuckets(regionName));
+server4.invoke(() -> createBuckets(regionName));
+
+await().untilAsserted(() -> {
+ 

[geode] branch develop updated: GEODE-7414_2: modify init() method argument (#5040)

2020-05-05 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 5f9800b  GEODE-7414_2: modify init() method argument (#5040)
5f9800b is described below

commit 5f9800b291d3a11140eb5a1a972459207e07b50c
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed May 6 06:28:18 2020 +0200

GEODE-7414_2: modify init() method argument (#5040)
---
 .../geode/net/SSLSocketParameterExtensionIntegrationTest.java | 8 
 .../src/main/java/org/apache/geode/internal/admin/SSLConfig.java  | 2 +-
 .../src/main/java/org/apache/geode/net/SSLParameterExtension.java | 8 
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/net/SSLSocketParameterExtensionIntegrationTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/net/SSLSocketParameterExtensionIntegrationTest.java
index 6f84f51..e8cea3e 100644
--- 
a/geode-core/src/integrationTest/java/org/apache/geode/net/SSLSocketParameterExtensionIntegrationTest.java
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/net/SSLSocketParameterExtensionIntegrationTest.java
@@ -216,17 +216,17 @@ public class SSLSocketParameterExtensionIntegrationTest {
   }
 
   public static class MySSLParameterExtension implements SSLParameterExtension 
{
-DistributionConfig config;
+Properties properties;
 
 @Override
-public void init(DistributionConfig config) {
-  this.config = config;
+public void init(Properties properties) {
+  this.properties = properties;
 }
 
 @Override
 public SSLParameters modifySSLClientSocketParameters(SSLParameters 
parameters) {
   List serverNames = new ArrayList<>(1);
-  SNIHostName serverName = new 
SNIHostName(String.valueOf(config.getDistributedSystemId()));
+  SNIHostName serverName = new 
SNIHostName(properties.getProperty(DISTRIBUTED_SYSTEM_ID));
   serverNames.add(serverName);
   parameters.setServerNames(serverNames);
   return parameters;
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/SSLConfig.java 
b/geode-core/src/main/java/org/apache/geode/internal/admin/SSLConfig.java
index b1e3f07..8dc9a75 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/SSLConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/SSLConfig.java
@@ -338,7 +338,7 @@ public class SSLConfig {
 this.sslParameterExtension = null;
 return this;
   }
-  sslParameterExtension.init(ids.getConfig());
+  sslParameterExtension.init(ids.getConfig().toProperties());
   this.sslParameterExtension = sslParameterExtension;
   return this;
 }
diff --git 
a/geode-core/src/main/java/org/apache/geode/net/SSLParameterExtension.java 
b/geode-core/src/main/java/org/apache/geode/net/SSLParameterExtension.java
index 0ed4465..3fa39b4 100644
--- a/geode-core/src/main/java/org/apache/geode/net/SSLParameterExtension.java
+++ b/geode-core/src/main/java/org/apache/geode/net/SSLParameterExtension.java
@@ -15,9 +15,9 @@
 
 package org.apache.geode.net;
 
-import javax.net.ssl.SSLParameters;
+import java.util.Properties;
 
-import org.apache.geode.distributed.internal.DistributionConfig;
+import javax.net.ssl.SSLParameters;
 
 /**
  * User implementation of a SSLParameter extension logic.
@@ -29,9 +29,9 @@ public interface SSLParameterExtension {
   /**
* Initialize the SSLParameterExtension.
*
-   * @param config the DistributionConfig
+   * @param properties the Properties
*/
-  default void init(DistributionConfig config) {}
+  default void init(Properties properties) {}
 
   default SSLParameters modifySSLClientSocketParameters(SSLParameters 
parameters) {
 return parameters;



[geode] branch develop updated: GEODE-6636: Create multiple buffer pools (#4234)

2020-04-28 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 e7b0186  GEODE-6636: Create multiple buffer pools (#4234)
e7b0186 is described below

commit e7b018623430a959c4edbf856934588dacea7392
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Apr 29 07:22:17 2020 +0200

GEODE-6636: Create multiple buffer pools (#4234)

* GEODE-6636: Create multiple buffer pools

* GEODE-6636: Remove new alerts

* GEODE-6636: Bug fix

* GEODE-6636: Update after review

* GEODE-6636: Added SMALL, MEDIUM constants

* GEODE-6636: Fix non-direct buffer added to direct buffer pool

* GEODE-6636: Update after rebase

* GEODE-6636: Update after rebase
---
 .../org/apache/geode/internal/net/BufferPool.java  | 172 +++--
 .../org/apache/geode/internal/tcp/Connection.java  |   2 +-
 .../apache/geode/internal/net/BufferPoolTest.java  |  48 ++
 .../geode/internal/net/NioPlainEngineTest.java |   4 +-
 .../geode/internal/net/NioSslEngineTest.java   |   4 +-
 5 files changed, 179 insertions(+), 51 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java 
b/geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java
index 0997c6e..c156c2c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java
@@ -20,7 +20,9 @@ import java.util.IdentityHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
 import org.apache.geode.distributed.internal.DMStats;
+import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.tcp.Connection;
 
 public class BufferPool {
   private final DMStats stats;
@@ -41,12 +43,30 @@ public class BufferPool {
   }
 
   /**
-   * A list of soft references to byte buffers.
+   * A list of soft references to small byte buffers.
*/
-  private final ConcurrentLinkedQueue bufferQueue =
+  private final ConcurrentLinkedQueue bufferSmallQueue =
   new ConcurrentLinkedQueue<>();
 
   /**
+   * A list of soft references to middle byte buffers.
+   */
+  private final ConcurrentLinkedQueue bufferMiddleQueue =
+  new ConcurrentLinkedQueue<>();
+
+  /**
+   * A list of soft references to large byte buffers.
+   */
+  private final ConcurrentLinkedQueue bufferLargeQueue =
+  new ConcurrentLinkedQueue<>();
+
+  private final int SMALL_BUFFER_SIZE = Connection.SMALL_BUFFER_SIZE;
+
+
+  private final int MEDIUM_BUFFER_SIZE = 
DistributionConfig.DEFAULT_SOCKET_BUFFER_SIZE;
+
+
+  /**
* use direct ByteBuffers instead of heap ByteBuffers for NIO operations
*/
   public static final boolean useDirectBuffers = 
!Boolean.getBoolean("p2p.nodirectBuffers");
@@ -69,51 +89,18 @@ public class BufferPool {
*/
   private ByteBuffer acquireDirectBuffer(int size, boolean send) {
 ByteBuffer result;
+
 if (useDirectBuffers) {
-  IdentityHashMap alreadySeen = null; // 
keys are used like a
-// 
set
-  BBSoftReference ref = bufferQueue.poll();
-  while (ref != null) {
-ByteBuffer bb = ref.getBB();
-if (bb == null) {
-  // it was garbage collected
-  int refSize = ref.consumeSize();
-  if (refSize > 0) {
-if (ref.getSend()) { // fix bug 46773
-  stats.incSenderBufferSize(-refSize, true);
-} else {
-  stats.incReceiverBufferSize(-refSize, true);
-}
-  }
-} else if (bb.capacity() >= size) {
-  bb.rewind();
-  bb.limit(size);
-  return bb;
-} else {
-  // wasn't big enough so put it back in the queue
-  Assert.assertTrue(bufferQueue.offer(ref));
-  if (alreadySeen == null) {
-alreadySeen = new IdentityHashMap<>();
-  }
-  if (alreadySeen.put(ref, ref) != null) {
-// if it returns non-null then we have already seen this item
-// so we have worked all the way through the queue once.
-// So it is time to give up and allocate a new buffer.
-break;
-  }
-}
-ref = bufferQueue.poll();
+  if (size <= MEDIUM_BUFFER_SIZE) {
+return acquirePredefinedFixedBuffer(send, size);
+  } else {
+return acquireLargeBuffer(send, size);
   }
-  result = ByteBuffer.allocateDirect(size);
 } else {
   // if we are using heap buffers then don't bother with keeping them 
around
   result = ByteBuffer.allocate(size);
 }
-if (send) {
- 

[geode] branch develop updated (c8d1048 -> 7fa738c)

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

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


from c8d1048  GEODE-7985: benchmark develop against 1.12.0 rather than 
1.10.0 (#4957)
 add 7fa738c  GEODE-7980: update rebalance output on colocated region 
(#4955)

No new revisions were added by this update.

Summary of changes:
 .../cache/control/RebalanceResultsImpl.java|  3 +-
 .../commands/RebalanceMembersColocationTest.java   | 98 ++
 2 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 
geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceMembersColocationTest.java



[geode] branch develop updated: GEODE-7917: change thrown exception type for SSL to IOException (#4858)

2020-04-06 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 552cdea  GEODE-7917: change thrown exception type for SSL to 
IOException (#4858)
552cdea is described below

commit 552cdead5664c0b004094a136d9c419983ff38a9
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Mon Apr 6 20:38:28 2020 +0200

GEODE-7917: change thrown exception type for SSL to IOException (#4858)

* GEODE-7917: Change exception type to IOException when caused by 
EOFException

* GEODE-7917: added test

* GEODE-7917: update after comments
---
 .../tcpserver/TCPClientSSLIntegrationTest.java | 49 ++
 .../distributed/internal/tcpserver/TcpClient.java  |  8 
 2 files changed, 57 insertions(+)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java
index ece03ca..8ab0a8e 100644
--- 
a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java
@@ -18,8 +18,10 @@ import static 
org.apache.geode.security.SecurableCommunicationChannels.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.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.when;
 
+import java.io.EOFException;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.security.GeneralSecurityException;
@@ -77,6 +79,25 @@ public class TCPClientSSLIntegrationTest {
 SocketCreatorFactory.close();
   }
 
+  private void startServerWithCertificate()
+  throws GeneralSecurityException, IOException {
+
+CertificateMaterial serverCertificate = new CertificateBuilder()
+.commonName("tcp-server")
+.issuedBy(ca)
+.sanDnsName(InetAddress.getLocalHost().getHostName())
+.generate();
+
+CertStores serverStore = CertStores.locatorStore();
+serverStore.withCertificate("server", serverCertificate);
+serverStore.trust("ca", ca);
+
+Properties serverProperties = serverStore
+.propertiesWith(LOCATOR, true, true);
+
+startTcpServer(serverProperties);
+  }
+
   private void startServerAndClient(CertificateMaterial serverCertificate,
   CertificateMaterial clientCertificate, boolean enableHostNameValidation)
   throws GeneralSecurityException, IOException {
@@ -216,4 +237,32 @@ public class TCPClientSSLIntegrationTest {
 + localhost.getHostName() + " found.");
   }
 
+  @Test
+  public void clientFailsToConnectIfRemotePeerShutdowns() throws Exception, 
SSLHandshakeException {
+
+startServerWithCertificate();
+
+SocketCreator socketCreator = Mockito.mock(SocketCreator.class);
+ClusterSocketCreator ssc = Mockito.mock(ClusterSocketCreator.class);
+
+Exception eofexc = new EOFException("SSL peer shut down incorrectly");
+Exception sslexc = new SSLHandshakeException("Remote host terminated the 
handshake");
+sslexc.initCause(eofexc);
+
+when(socketCreator.forCluster())
+.thenReturn(ssc);
+when(ssc.connect(any(), anyInt(), any(), any()))
+.thenThrow(sslexc);
+
+client = new TcpClient(socketCreator,
+InternalDataSerializer.getDSFIDSerializer().getObjectSerializer(),
+InternalDataSerializer.getDSFIDSerializer().getObjectDeserializer(),
+TcpSocketFactory.DEFAULT);
+
+assertThatExceptionOfType(IOException.class)
+.isThrownBy(() -> client.requestToServer(new 
HostAndPort(localhost.getHostName(), port),
+Boolean.valueOf(false), 5 * 1000))
+.withCauseInstanceOf(SSLHandshakeException.class)
+.withStackTraceContaining("Remote host terminated the handshake");
+  }
 }
diff --git 
a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
 
b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
index 64cbb2f..b5e8d91 100644
--- 
a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
+++ 
b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
@@ -29,6 +29,7 @@ import java.util.function.LongSupplier;
 import java.util.function.Supplier;
 
 import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLHandshakeException;
 
 import org.apache.logging.log4j

[geode] branch develop updated: Feature/geode 6536 2: Added retry in borrowConnection/single hop (#4833)

2020-03-30 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 b021b12  Feature/geode 6536 2: Added retry in borrowConnection/single 
hop (#4833)
b021b12 is described below

commit b021b127867d1e01e09fac26de10d29f896ed7dc
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Mon Mar 30 21:54:35 2020 +0200

Feature/geode 6536 2: Added retry in borrowConnection/single hop (#4833)

* GEODE-6536: Added retry in borrowConnection/single hop

* GEODE-6536: bug fix

* GEODE-6536: update after comments

* GEODE-6536: modify borrowConnection singleHop solution

* GEODE-6536: test update

* GEODE-6536: updated tests, and added parameter to desable timeout

* GEODE-6536: update of cachexml impacts

* GEODE-6536: remove cachexml restriction

* GEODE-6536: update default value and documentation

* GEODE-6536_2: change exception type

* GEODE-6536_2: seize new connection only in case onlyUseExistingCnx=false
---
 .../apache/geode/cache30/CacheXml66DUnitTest.java  |   5 +-
 .../cache/tier/sockets/AcceptorImplDUnitTest.java  |   1 +
 .../cache/ConnectionPoolFactoryJUnitTest.java  |  16 +++
 .../AutoConnectionSourceImplJUnitTest.java |   5 +
 .../internal/ConnectionPoolImplJUnitTest.java  |  24 
 .../client/internal/QueueManagerJUnitTest.java |   5 +
 .../pooling/ConnectionManagerImplTest.java |  45 ---
 .../pooling/ConnectionManagerJUnitTest.java| 129 -
 .../codeAnalysis/sanctionedDataSerializables.txt   |   6 +-
 .../geode/cache/client/ClientCacheFactory.java |  20 
 .../java/org/apache/geode/cache/client/Pool.java   |   7 ++
 .../org/apache/geode/cache/client/PoolFactory.java |  27 +
 .../cache/client/internal/OpExecutorImpl.java  |   7 +-
 .../geode/cache/client/internal/PoolImpl.java  |  22 +++-
 .../client/internal/pooling/ConnectionManager.java |   5 +-
 .../internal/pooling/ConnectionManagerImpl.java|  61 ++
 .../apache/geode/cache/configuration/PoolType.java |  25 
 .../geode/internal/cache/PoolFactoryImpl.java  |  23 +++-
 .../geode/internal/cache/xmlcache/CacheXml.java|   1 +
 .../internal/cache/xmlcache/CacheXmlGenerator.java |   4 +
 .../internal/cache/xmlcache/CacheXmlParser.java|   4 +
 .../geode.apache.org/schema/cache/cache-1.0.xsd|   1 +
 .../schema.pivotal.io/gemfire/cache/cache-8.1.xsd  |   1 +
 .../org/apache/geode/cache/doc-files/cache7_0.dtd  |   1 +
 .../org/apache/geode/cache/doc-files/cache8_0.dtd  |   1 +
 .../sanctioned-geode-core-serializables.txt|   2 +-
 .../client/internal/OpExecutorImplJUnitTest.java   |  25 ++--
 .../cache/client/internal/TXFailoverOpTest.java|   2 +
 geode-docs/reference/topics/cache_xml.html.md.erb  |   7 +-
 .../reference/topics/client-cache.html.md.erb  |   7 +-
 .../cache/tier/sockets/CacheServerTestUtil.java|   1 +
 31 files changed, 423 insertions(+), 67 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
index f6b5d31..489bc36 100644
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
@@ -197,6 +197,7 @@ public abstract class CacheXml66DUnitTest extends 
CacheXmlTestCase {
 assertEquals(0, cp.getServers().size());
 assertEquals(createINSA(ALIAS2, 3777), cp.getLocators().get(0));
 assertEquals(PoolFactory.DEFAULT_FREE_CONNECTION_TIMEOUT, 
cp.getFreeConnectionTimeout());
+assertEquals(PoolFactory.DEFAULT_SERVER_CONNECTION_TIMEOUT, 
cp.getServerConnectionTimeout());
 assertEquals(PoolFactory.DEFAULT_LOAD_CONDITIONING_INTERVAL, 
cp.getLoadConditioningInterval());
 assertEquals(PoolFactory.DEFAULT_SOCKET_BUFFER_SIZE, 
cp.getSocketBufferSize());
 assertEquals(PoolFactory.DEFAULT_THREAD_LOCAL_CONNECTIONS, 
cp.getThreadLocalConnections());
@@ -265,7 +266,8 @@ public abstract class CacheXml66DUnitTest extends 
CacheXmlTestCase {
 CacheCreation cache = new CacheCreation();
 PoolFactory f = cache.createPoolFactory();
 f.addServer(ALIAS2, 3777).addServer(ALIAS1, 3888);
-
f.setFreeConnectionTimeout(12345).setLoadConditioningInterval(12345).setSocketBufferSize(12345)
+f.setFreeConnectionTimeout(12345).setServerConnectionTimeout(111)
+.setLoadConditioningInterval(12345).setSocketBufferSize(12345)
 
.setThreadLocalConnections(true).setPRSingleHopEnabled(true).setReadTimeout(12345)
 
.setMinConnections(12346).setMaxConnections(12347).setRetryAttempts(12348)
 
.setIdleTimeout

[geode] branch develop updated (791017c -> 86defd4)

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

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


from 791017c  Geode prefers not to use merge-commits, so do not test 
against them. (#4790)
 add 86defd4  Feature/geode 6536 1: modify borrowConnection singleHop 
solution (#4753)

No new revisions were added by this update.

Summary of changes:
 .../apache/geode/cache30/CacheXml66DUnitTest.java  |   5 +-
 .../cache/tier/sockets/AcceptorImplDUnitTest.java  |   1 +
 .../cache/ConnectionPoolFactoryJUnitTest.java  |  16 +++
 .../AutoConnectionSourceImplJUnitTest.java |   5 +
 .../internal/ConnectionPoolImplJUnitTest.java  |   1 +
 .../client/internal/QueueManagerJUnitTest.java |   5 +
 .../pooling/ConnectionManagerImplTest.java |  45 ---
 .../pooling/ConnectionManagerJUnitTest.java| 131 -
 .../codeAnalysis/sanctionedDataSerializables.txt   |   6 +-
 .../geode/cache/client/ClientCacheFactory.java |  20 
 .../java/org/apache/geode/cache/client/Pool.java   |   7 ++
 .../org/apache/geode/cache/client/PoolFactory.java |  27 +
 .../cache/client/internal/OpExecutorImpl.java  |   7 +-
 .../geode/cache/client/internal/PoolImpl.java  |  22 +++-
 .../client/internal/pooling/ConnectionManager.java |   5 +-
 .../internal/pooling/ConnectionManagerImpl.java|  79 +
 .../apache/geode/cache/configuration/PoolType.java |  25 
 .../geode/internal/cache/PoolFactoryImpl.java  |  23 +++-
 .../geode/internal/cache/xmlcache/CacheXml.java|   1 +
 .../internal/cache/xmlcache/CacheXmlGenerator.java |   4 +
 .../internal/cache/xmlcache/CacheXmlParser.java|   4 +
 .../geode.apache.org/schema/cache/cache-1.0.xsd|   1 +
 .../schema.pivotal.io/gemfire/cache/cache-8.1.xsd  |   1 +
 .../org/apache/geode/cache/doc-files/cache7_0.dtd  |   1 +
 .../org/apache/geode/cache/doc-files/cache8_0.dtd  |   1 +
 .../sanctioned-geode-core-serializables.txt|   2 +-
 .../client/internal/OpExecutorImplJUnitTest.java   |  25 ++--
 .../cache/client/internal/TXFailoverOpTest.java|   2 +
 geode-docs/reference/topics/cache_xml.html.md.erb  |   7 +-
 .../reference/topics/client-cache.html.md.erb  |   7 +-
 .../cache/tier/sockets/CacheServerTestUtil.java|   1 +
 31 files changed, 420 insertions(+), 67 deletions(-)



[geode] branch develop updated: GEODE-7727: modify sender thread to detect relese of connection (#4751)

2020-03-09 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 c841359  GEODE-7727: modify sender thread to detect relese of 
connection (#4751)
c841359 is described below

commit c8413592e5573f675c538c63ef9ee9f97a349e73
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Mar 10 06:47:09 2020 +0100

GEODE-7727: modify sender thread to detect relese of connection (#4751)

* GEODE-7727: modify sender thread to detect relese of connection

* GEODE-7727: Update solution only for shared connections

* GEODE-7727: added test

* GEODE-7727: update ater comments

* GEODE-7727: update test

* GEODE-7727: fix for async write hanging

* GEODE-7727: Test of region operations in the face of closed connections

Adding a test for what happens to region operations when a connection is 
closed
out from under the system. This test hangs without the changes to let the
reader thread keep running.

Fix to test

* GEODE-7727: Preventing a double release of the input buffer

The releaseInputBuffer method was not thread safe. If it is called
concurrently, it will end up being released twice, which will add the 
buffer to
to the buffer pool twice. Later, this could result in two threads using the
same buffer, resulting in corruption of the buffer.

With the changes for GEODE-7727, we made it likely that releaseInputBuffer
would be called concurrently. If a member departs, one thread will call
Connection.close. Connection.close will close the socket and call
releaseInputBuffer. However, closing the socket will wake up the reader 
thread,
which will also call releaseInputBuffer concurrently.

Making releaseInputBuffer thread safe by introducing a lock.

* GEODE-7727: update after merge

* GEODE-7727: update test name

Co-authored-by: Dan Smith 
---
 .../geode/internal/tcp/CloseConnectionTest.java| 76 ++
 .../geode/internal/tcp/TCPConduitDUnitTest.java|  5 +-
 ...erStartupWhenAsyncDistributionTimeoutIsSet.java | 71 
 ...butedSystemMXBeanWithAlertsDistributedTest.java |  1 +
 .../distributed/internal/DistributionImpl.java |  4 ++
 .../org/apache/geode/internal/tcp/Connection.java  | 38 ---
 .../apache/geode/internal/tcp/ConnectionTable.java | 14 +++-
 .../org/apache/geode/internal/tcp/TCPConduit.java  |  2 +-
 8 files changed, 199 insertions(+), 12 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/tcp/CloseConnectionTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/tcp/CloseConnectionTest.java
new file mode 100644
index 000..154e908
--- /dev/null
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/tcp/CloseConnectionTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.tcp;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.distributed.internal.ClusterDistributionManager;
+import org.apache.geode.distributed.internal.DistributionImpl;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.cache.CacheTestCase;
+
+public class CloseConnectionTest extends CacheTestCase {
+
+  @Test(timeout = 60_000)
+  public void sharedSenderShouldRecoverFromClosedSocket() {
+VM vm0 = VM.getVM(0);
+VM vm1 = VM.getVM(1);
+
+// Create a region in each member. VM0 has a proxy region, so state must 
be in VM1
+vm0.invoke(() -> {
+  
getCache().createRegionFactory(RegionShortcut.REPLICATE_PROXY).create("region");
+});
+vm1.invoke(() -> {
+  
getCache().createRegionFactory(RegionShortcut.REPLICATE).create("region");
+});
+
+
+// Force VM1 to close it's connections.
+  

[geode] branch develop updated: Feature/geode 6807 1 (#4711)

2020-02-28 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 bf0012d  Feature/geode 6807 1 (#4711)
bf0012d is described below

commit bf0012d6b01b6a4094fca1b2dc7a21f78603a26a
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Sat Feb 29 06:22:19 2020 +0100

Feature/geode 6807 1 (#4711)

* GEODE-6807: cache adviseUpdate and adviseAllEventsOrCached

* GEODE-6807: update with comments

* GEODE-6807: update adviseAllEventsOrCached method

* GEODE-6807: update of solution with checking of version

* GEODE-6807: remove assert from new code

* GEODE-6807: Added UT and inRecovery update check

* GEODE-6807: Added Concurrent Test

* GEODE-6807: Added missing @Test and rebase

* GEODE-6807: fix for race conditions
---
 .../CacheDistributionAdvisorConcurrentTest.java| 103 
 .../distributed/internal/DistributionAdvisor.java  |  12 +-
 .../internal/cache/CacheDistributionAdvisor.java   |  98 +---
 .../internal/cache/DistributedCacheOperation.java  |   2 +-
 .../geode/internal/cache/DistributedRegion.java|   7 +-
 .../cache/CacheDistributionAdvisorTest.java| 176 +
 6 files changed, 372 insertions(+), 26 deletions(-)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
new file mode 100644
index 000..d2367a1
--- /dev/null
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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 static org.apache.geode.test.concurrency.Utilities.availableProcessors;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.apache.geode.CancelCriterion;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.distributed.internal.DistributionAdvisor;
+import org.apache.geode.distributed.internal.DistributionManager;
+import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.cache.CacheDistributionAdvisor.CacheProfile;
+import org.apache.geode.test.concurrency.ConcurrentTestRunner;
+import org.apache.geode.test.concurrency.ParallelExecutor;
+
+
+@RunWith(ConcurrentTestRunner.class)
+public class CacheDistributionAdvisorConcurrentTest {
+  private final int count = availableProcessors() * 2;
+
+  @Test
+  public void getAdviseAllEventsOrCachedForConcurrentUpdateShouldSucceed(
+  ParallelExecutor executor) throws Exception {
+
+DistributionAdvisor advisor = createCacheDistributionAdvisor();
+CacheProfile profile = createCacheProfile();
+advisor.putProfile(profile, true);
+
+executor.inParallel(() -> {
+  ((CacheDistributionAdvisor) advisor).adviseAllEventsOrCached();
+}, count);
+executor.execute();
+
+assertTrue(((CacheDistributionAdvisor) advisor).adviseAllEventsOrCached()
+.contains(profile.getDistributedMember()));
+assertEquals(((CacheDistributionAdvisor) 
advisor).adviseAllEventsOrCached().size(), 1);
+
+  }
+
+  @Test
+  public void getAdviseUpdateForConcurrentUpdateShouldSucceed(
+  ParallelExecutor executor) throws Exception {
+
+EntryEventImpl event = new EntryEventImpl();
+event.setNewValue(null);
+event.setOperation(Operation.CREATE);
+
+DistributionAdvisor advisor = createCacheDistributionAdvisor();
+CacheProfile profile = createCacheProfile();
+advisor.putProfile(profile, true);
+
+executor.inParallel(() -> {
+  ((CacheDistributi

[geode] branch develop updated (088e682 -> 51a0c65)

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

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


from 088e682  GEODE-7823: eliminate org.junit unavailable compile error in 
IntelliJ (#4742)
 add 51a0c65  GEODE-7771: change getting cache in getLuceneIndex (#4702)

No new revisions were added by this update.

Summary of changes:
 .../cache/lucene/internal/distributed/LuceneQueryFunction.java   | 9 +
 .../internal/distributed/LuceneQueryFunctionJUnitTest.java   | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)



[geode] branch develop updated: GEODE-6536: Added retry in borrowConnection/single hop (#4719)

2020-02-26 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 9da2cd4  GEODE-6536: Added retry in borrowConnection/single hop (#4719)
9da2cd4 is described below

commit 9da2cd49e2e04564b446eaad579b51e986bc2179
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Thu Feb 27 07:38:31 2020 +0100

GEODE-6536: Added retry in borrowConnection/single hop (#4719)

* GEODE-6536: Added retry in borrowConnection/single hop

* GEODE-6536: bug fix

* GEODE-6536: update after comments
---
 .../pooling/ConnectionManagerImplTest.java | 32 +++
 .../pooling/ConnectionManagerJUnitTest.java|  6 +--
 .../cache/client/internal/OpExecutorImpl.java  |  2 +-
 .../geode/cache/client/internal/PoolImpl.java  |  8 +++-
 .../client/internal/pooling/ConnectionManager.java |  5 ++-
 .../internal/pooling/ConnectionManagerImpl.java| 48 +++---
 .../client/internal/OpExecutorImplJUnitTest.java   |  2 +-
 7 files changed, 64 insertions(+), 39 deletions(-)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImplTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImplTest.java
index 542a8fe..748f37b 100644
--- 
a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImplTest.java
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImplTest.java
@@ -94,7 +94,7 @@ public class ConnectionManagerImplTest {
 ServerLocation serverLocation = mock(ServerLocation.class);
 
 connectionManager = createDefaultConnectionManager();
-assertThatThrownBy(() -> 
connectionManager.borrowConnection(serverLocation, true))
+assertThatThrownBy(() -> 
connectionManager.borrowConnection(serverLocation, timeout, true))
 .isInstanceOf(AllConnectionsInUseException.class);
 
 connectionManager.close(false);
@@ -110,7 +110,7 @@ public class ConnectionManagerImplTest {
 connectionManager = createDefaultConnectionManager();
 connectionManager.start(backgroundProcessor);
 
-assertThat(connectionManager.borrowConnection(serverLocation, false))
+assertThat(connectionManager.borrowConnection(serverLocation, timeout, 
false))
 .isInstanceOf(PooledConnection.class);
 assertThat(connectionManager.getConnectionCount()).isEqualTo(1);
 
@@ -266,9 +266,9 @@ public class ConnectionManagerImplTest {
 cancelCriterion, poolStats);
 connectionManager.start(backgroundProcessor);
 
-connectionManager.borrowConnection(serverLocation1, false);
-connectionManager.borrowConnection(serverLocation2, false);
-connectionManager.borrowConnection(serverLocation3, false);
+connectionManager.borrowConnection(serverLocation1, timeout, false);
+connectionManager.borrowConnection(serverLocation2, timeout, false);
+connectionManager.borrowConnection(serverLocation3, timeout, false);
 
 
assertThat(connectionManager.getConnectionCount()).isGreaterThan(maxConnections);
 
@@ -295,9 +295,9 @@ public class ConnectionManagerImplTest {
 connectionManager = createDefaultConnectionManager();
 connectionManager.start(backgroundProcessor);
 Connection heldConnection1 =
-connectionManager.borrowConnection(serverLocation1, false);
+connectionManager.borrowConnection(serverLocation1, timeout, false);
 Connection heldConnection2 =
-connectionManager.borrowConnection(serverLocation2, false);
+connectionManager.borrowConnection(serverLocation2, timeout, false);
 assertThat(connectionManager.getConnectionCount()).isEqualTo(2);
 
 connectionManager.returnConnection(heldConnection1, true);
@@ -352,11 +352,11 @@ public class ConnectionManagerImplTest {
 connectionManager.start(backgroundProcessor);
 
 Connection heldConnection1 =
-connectionManager.borrowConnection(serverLocation1, false);
+connectionManager.borrowConnection(serverLocation1, timeout, false);
 Connection heldConnection2 =
-connectionManager.borrowConnection(serverLocation2, false);
+connectionManager.borrowConnection(serverLocation2, timeout, false);
 Connection heldConnection3 =
-connectionManager.borrowConnection(serverLocation3, false);
+connectionManager.borrowConnection(serverLocation3, timeout, false);
 
 
assertThat(connectionManager.getConnectionCount()).isGreaterThan(maxConnections);
 
@@ -391,7 +391,7 @@ public class ConnectionManagerImplTest {
 connectionManager = createDefaultConnectionManager();
 connectionManager.start(backgroundProcessor);
 
-Connection heldConnection = 
connectionManager.borr

[geode] branch develop updated (2dae396 -> b3d4458)

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

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


from 2dae396  GEODE-7798: Ignore PubSubTest until the flakiness can be 
removed (#4721)
 add b3d4458  GEODE-7774: Remove addAll in ReflectionLuceneSerializer 
(#4718)

No new revisions were added by this update.

Summary of changes:
 .../internal/repository/serializer/ReflectionLuceneSerializer.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



[geode] branch develop updated (e2905f4 -> d6c1497)

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

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


from e2905f4  GEODE-7770: remove unused cache reference (#4700)
 add d6c1497  GEODE-7769: use parseFloat instead of valueOf (#4699)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/geode/modules/session/bootstrap/AbstractCache.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[geode] branch develop updated (d6c1497 -> bf3e280)

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

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


from d6c1497  GEODE-7769: use parseFloat instead of valueOf (#4699)
 add bf3e280  GEODE-7768: remove redundant null checks (#4701)

No new revisions were added by this update.

Summary of changes:
 .../java/org/apache/geode/modules/util/BootstrappingFunction.java | 3 +--
 .../org/apache/geode/internal/admin/remote/RemoteApplicationVM.java   | 2 +-
 .../geode/internal/admin/statalerts/DummyStatisticInfoImpl.java   | 2 +-
 .../org/apache/geode/internal/admin/statalerts/StatisticInfoImpl.java | 2 +-
 .../src/main/java/org/apache/geode/internal/cache/FilterProfile.java  | 2 +-
 .../java/org/apache/geode/internal/cache/PartitionedRegionHelper.java | 2 +-
 .../main/java/org/apache/geode/internal/cache/TXCommitMessage.java| 2 +-
 .../src/main/java/org/apache/geode/internal/cache/TXEntryState.java   | 2 +-
 geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java | 2 +-
 .../org/apache/geode/internal/cache/tier/sockets/HAEventWrapper.java  | 2 +-
 .../org/apache/geode/internal/cache/versions/RegionVersionHolder.java | 2 +-
 geode-core/src/main/java/org/apache/geode/pdx/internal/PdxField.java  | 2 +-
 geode-core/src/main/java/org/apache/geode/pdx/internal/PdxType.java   | 2 +-
 .../java/org/apache/geode/test/dunit/rules/ClusterStartupRule.java| 4 ++--
 .../geode/management/internal/cli/commands/DescribeMemberCommand.java | 2 +-
 geode-junit/src/main/java/org/apache/geode/DeltaTestImpl.java | 2 +-
 .../main/java/org/apache/geode/cache/query/data/PortfolioData.java| 2 +-
 .../geode/distributed/internal/membership/gms/GMSMemberData.java  | 2 +-
 18 files changed, 19 insertions(+), 20 deletions(-)



[geode] branch develop updated (9ad6417 -> e2905f4)

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

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


from 9ad6417  GEODE-7773: remove redundant addAll command (#4703)
 add e2905f4  GEODE-7770: remove unused cache reference (#4700)

No new revisions were added by this update.

Summary of changes:
 .../apache/geode/cache/lucene/internal/LuceneRegionListener.java| 6 +-
 .../org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java   | 2 +-
 .../geode/cache/lucene/internal/LuceneRegionListenerJUnitTest.java  | 2 +-
 3 files changed, 3 insertions(+), 7 deletions(-)



[geode] branch develop updated (1befce1 -> 9ad6417)

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

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


from 1befce1  GEODE-7798: Fix flaky PubSub test (#4714)
 add 9ad6417  GEODE-7773: remove redundant addAll command (#4703)

No new revisions were added by this update.

Summary of changes:
 .../apache/geode/cache/lucene/internal/cli/LuceneListIndexCommand.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



[geode] branch develop updated (5c6529a -> 1a0d976)

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

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


from 5c6529a  Geode 4263 (#4691)
 add 1a0d976  GEODE-7727: modify sender thread to detect release of 
connection (#4629)

No new revisions were added by this update.

Summary of changes:
 .../geode/internal/tcp/TCPConduitDUnitTest.java| 42 ++
 ...butedSystemMXBeanWithAlertsDistributedTest.java |  1 +
 .../org/apache/geode/internal/tcp/Connection.java  | 18 +++---
 .../apache/geode/internal/tcp/ConnectionTable.java | 12 +++
 4 files changed, 68 insertions(+), 5 deletions(-)



[geode] branch develop updated: GEODE-7772: Simplify hasNext in PageableLuceneQueryResultsImpl (#4678)

2020-02-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 93aa3c4  GEODE-7772: Simplify hasNext in 
PageableLuceneQueryResultsImpl (#4678)
93aa3c4 is described below

commit 93aa3c4668f888e62d7951c1712c179955b6d01b
Author: mkevo <48509719+mk...@users.noreply.github.com>
AuthorDate: Fri Feb 7 11:27:30 2020 +0100

GEODE-7772: Simplify hasNext in PageableLuceneQueryResultsImpl (#4678)
---
 .../geode/cache/lucene/internal/PageableLuceneQueryResultsImpl.java | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/PageableLuceneQueryResultsImpl.java
 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/PageableLuceneQueryResultsImpl.java
index 2c2e621..4fc4f8c 100644
--- 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/PageableLuceneQueryResultsImpl.java
+++ 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/PageableLuceneQueryResultsImpl.java
@@ -144,12 +144,8 @@ public class PageableLuceneQueryResultsImpl 
implements PageableLuceneQuery
 
   @Override
   public boolean hasNext() {
-
 advancePage();
-if (currentPage.isEmpty()) {
-  return false;
-}
-return true;
+return !currentPage.isEmpty();
   }
 
   @Override



[geode] branch develop updated (e011913 -> 8072595)

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

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


from e011913  GEODE-7600: Disabling a test until the underlying code is 
implemented. (#4659)
 add 8072595  GEODE-7582: Update initlocator list (#4488)

No new revisions were added by this update.

Summary of changes:
 .../AutoConnectionSourceImplJUnitTest.java |  35 ---
 .../client/internal/AutoConnectionSourceImpl.java  |  45 ++---
 geode-tcp-server/build.gradle  |   5 +-
 .../internal/tcpserver/LocatorAddress.java |  87 +++-
 .../internal/tcpserver/LocatorAddressTest.java | 109 +
 5 files changed, 153 insertions(+), 128 deletions(-)
 create mode 100644 
geode-tcp-server/src/test/java/org/apache/geode/distributed/internal/tcpserver/LocatorAddressTest.java



[geode] branch develop updated (5a8b992 -> c87965d)

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

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


from 5a8b992  GEODE-7698: Extracting a superclass of 
InternalDistributedMember
 add c87965d  GEODE-7709: fix typo in some properties name (#4599)

No new revisions were added by this update.

Summary of changes:
 geode-docs/managing/statistics/setting_up_statistics.html.md.erb | 2 +-
 geode-docs/reference/topics/gemfire_properties.html.md.erb   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



[geode] branch develop updated: GEODE-7414_1: Define interface (#4505)

2020-01-14 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 dddfce0  GEODE-7414_1: Define interface (#4505)
dddfce0 is described below

commit dddfce0a273a542744b6baab1d3ea535d11894c7
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Tue Jan 14 16:14:59 2020 +0100

GEODE-7414_1: Define interface (#4505)

* GEODE-7414_1: Introduction of SSL Parameter Extension

- Define interface
- added config parameter
- added SSLParameterExtension implementation
---
 .../integrationTest/resources/assembly_content.txt |   4 +
 ...SSLSocketParameterExtensionIntegrationTest.java | 242 +
 .../geode/distributed/ConfigurationProperties.java |  16 ++
 .../internal/AbstractDistributionConfig.java   |   3 +
 .../distributed/internal/DistributionConfig.java   |  30 +++
 .../internal/DistributionConfigImpl.java   |  20 +-
 .../org/apache/geode/internal/admin/SSLConfig.java |  42 +++-
 .../internal/net/SSLConfigurationFactory.java  |   2 +
 .../apache/geode/internal/net/SocketCreator.java   |  16 ++
 .../apache/geode/net/SSLParameterExtension.java|  44 
 .../internal/DistributionConfigJUnitTest.java  |   4 +-
 .../topics/gemfire_properties.html.md.erb  |   7 +
 12 files changed, 424 insertions(+), 6 deletions(-)

diff --git a/geode-assembly/src/integrationTest/resources/assembly_content.txt 
b/geode-assembly/src/integrationTest/resources/assembly_content.txt
index 7fca5a5..1ea16d7 100644
--- a/geode-assembly/src/integrationTest/resources/assembly_content.txt
+++ b/geode-assembly/src/integrationTest/resources/assembly_content.txt
@@ -887,6 +887,10 @@ 
javadoc/org/apache/geode/modules/util/TouchReplicatedRegionEntriesFunction.html
 javadoc/org/apache/geode/modules/util/package-frame.html
 javadoc/org/apache/geode/modules/util/package-summary.html
 javadoc/org/apache/geode/modules/util/package-tree.html
+javadoc/org/apache/geode/net/SSLParameterExtension.html
+javadoc/org/apache/geode/net/package-frame.html
+javadoc/org/apache/geode/net/package-summary.html
+javadoc/org/apache/geode/net/package-tree.html
 javadoc/org/apache/geode/package-frame.html
 javadoc/org/apache/geode/package-summary.html
 javadoc/org/apache/geode/package-tree.html
diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/net/SSLSocketParameterExtensionIntegrationTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/net/SSLSocketParameterExtensionIntegrationTest.java
new file mode 100644
index 000..18c67d4
--- /dev/null
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/net/SSLSocketParameterExtensionIntegrationTest.java
@@ -0,0 +1,242 @@
+/*
+ * 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.net;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_CIPHERS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_ENABLED;
+import static 
org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_PROTOCOLS;
+import static 
org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_REQUIRE_AUTHENTICATION;
+import static 
org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SSL_PARAMETER_EXTENSION;
+import static 
org.apache.geode.internal.security.SecurableCommunicationChannel.CLUSTER;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertNull;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.atomic.

[geode] branch develop updated (dac5b1c -> 8d399ab)

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

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


from dac5b1c  GEODE-7583: rule improvement for ssl support (#4499)
 add 8d399ab  GEODE-7561: GW sender allow single dispatcher thread (#4441)

No new revisions were added by this update.

Summary of changes:
 .../cli/functions/GatewaySenderCreateFunction.java |  4 ++-
 .../commands/CreateGatewaySenderCommandTest.java   | 34 +++
 ...CreateDestroyGatewaySenderCommandDUnitTest.java | 38 +-
 3 files changed, 74 insertions(+), 2 deletions(-)



[geode] branch develop updated (c852309 -> 418d929)

2019-11-01 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from c852309  GEODE-7177:  Adjusted ArchUnit tests to allow geode-logging 
package s… (#4264)
 add 418d929  GEODE-6661: Fixed use of Direct and Non-Direct buffers (#4267)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/geode/internal/net/BufferPool.java  |  59 +--
 .../apache/geode/internal/net/NioPlainEngine.java  |   4 +-
 .../apache/geode/internal/net/NioSslEngine.java| 174 ++---
 .../org/apache/geode/internal/tcp/Connection.java  |   6 +-
 .../org/apache/geode/internal/tcp/MsgStreamer.java |   2 +-
 .../geode/internal/net/NioPlainEngineTest.java |   2 +-
 .../geode/internal/net/NioSslEngineTest.java   |  33 
 7 files changed, 139 insertions(+), 141 deletions(-)



[geode] branch develop updated (85b16aa -> 80efe5c)

2019-10-23 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 85b16aa  Increase memory of UpgradeTest heavy-lifter from 160 -> 210
 add 80efe5c  Revert "Revert "GEODE-6807: cache adviseUpdate and 
adviseAllEventsOrCached" (#4189)" (#4212)

No new revisions were added by this update.

Summary of changes:
 .../CacheDistributionAdvisorConcurrentTest.java| 105 
 .../distributed/internal/DistributionAdvisor.java  |  16 +-
 .../internal/cache/CacheDistributionAdvisor.java   |  98 +---
 .../internal/cache/DistributedCacheOperation.java  |   2 +-
 .../geode/internal/cache/DistributedRegion.java|   7 +-
 .../cache/CacheDistributionAdvisorTest.java| 176 +
 6 files changed, 374 insertions(+), 30 deletions(-)
 create mode 100644 
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
 create mode 100644 
geode-core/src/test/java/org/apache/geode/internal/cache/CacheDistributionAdvisorTest.java



[geode] branch revert-4189-revert-4086-feature/GEODE-6807 created (now c083ad5)

2019-10-23 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac pushed a change to branch revert-4189-revert-4086-feature/GEODE-6807
in repository https://gitbox.apache.org/repos/asf/geode.git.


  at c083ad5  Revert "Revert "GEODE-6807: cache adviseUpdate and 
adviseAllEventsOrCached" (#4189)"

This branch includes the following new commits:

 new c083ad5  Revert "Revert "GEODE-6807: cache adviseUpdate and 
adviseAllEventsOrCached" (#4189)"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[geode] 01/01: Revert "Revert "GEODE-6807: cache adviseUpdate and adviseAllEventsOrCached" (#4189)"

2019-10-23 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

mivanac pushed a commit to branch revert-4189-revert-4086-feature/GEODE-6807
in repository https://gitbox.apache.org/repos/asf/geode.git

commit c083ad58b880d782a5f6b9e84936cdaa7d97504e
Author: Mario Ivanac <48509724+miva...@users.noreply.github.com>
AuthorDate: Wed Oct 23 20:22:27 2019 +0200

Revert "Revert "GEODE-6807: cache adviseUpdate and adviseAllEventsOrCached" 
(#4189)"

This reverts commit e225ffcd5dc8f15ae59b46dc24baefcc253801f2.
---
 .../CacheDistributionAdvisorConcurrentTest.java| 105 
 .../distributed/internal/DistributionAdvisor.java  |  16 +-
 .../internal/cache/CacheDistributionAdvisor.java   |  98 +---
 .../internal/cache/DistributedCacheOperation.java  |   2 +-
 .../geode/internal/cache/DistributedRegion.java|   7 +-
 .../cache/CacheDistributionAdvisorTest.java| 176 +
 6 files changed, 374 insertions(+), 30 deletions(-)

diff --git 
a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
new file mode 100644
index 000..9afbc52
--- /dev/null
+++ 
b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
@@ -0,0 +1,105 @@
+/*
+ * 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 static org.apache.geode.test.concurrency.Utilities.availableProcessors;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.apache.geode.CancelCriterion;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.distributed.internal.DistributionAdvisor;
+import org.apache.geode.distributed.internal.DistributionManager;
+import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.distributed.internal.membership.MemberAttributes;
+import org.apache.geode.internal.cache.CacheDistributionAdvisor.CacheProfile;
+import org.apache.geode.test.concurrency.ConcurrentTestRunner;
+import org.apache.geode.test.concurrency.ParallelExecutor;
+
+
+@RunWith(ConcurrentTestRunner.class)
+public class CacheDistributionAdvisorConcurrentTest {
+  private final int count = availableProcessors() * 2;
+
+  @Test
+  public void getAdviseAllEventsOrCachedForConcurrentUpdateShouldSucceed(
+  ParallelExecutor executor) throws Exception {
+
+DistributionAdvisor advisor = createCacheDistributionAdvisor();
+CacheProfile profile = createCacheProfile();
+advisor.putProfile(profile, true);
+
+executor.inParallel(() -> {
+  ((CacheDistributionAdvisor) advisor).adviseAllEventsOrCached();
+}, count);
+executor.execute();
+
+assertTrue(((CacheDistributionAdvisor) advisor).adviseAllEventsOrCached()
+.contains(profile.getDistributedMember()));
+assertEquals(((CacheDistributionAdvisor) 
advisor).adviseAllEventsOrCached().size(), 1);
+
+  }
+
+  @Test
+  public void getAdviseUpdateForConcurrentUpdateShouldSucceed(
+  ParallelExecutor executor) throws Exception {
+
+EntryEventImpl event = new EntryEventImpl();
+event.setNewValue(null);
+event.setOperation(Operation.CREATE);
+
+DistributionAdvisor advisor = createCacheDistributionAdvisor();
+CacheProfile profile = createCacheProfile();
+advisor.putProfile(profile, true);
+
+executor.inParallel(() -> {
+  ((CacheDistributionAdvisor) advisor).adviseUpdate(event);
+}, count);
+executor.execute();
+
+assertTrue(((CacheDistributionAdvisor) advisor).adviseAllEventsOrCached()
+.contains(profile.getDistributedMember()));
+assertEquals(((CacheDistributionAdvisor) 
advisor).adviseAllEventsOrCached().size(), 1);
+
+  }
+
+  private DistributionAdvisor createCacheDistributionAdvi

[geode] branch develop updated: GEODE-7319: Solution for flaky test

2019-10-23 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 bbd09ef  GEODE-7319: Solution for flaky test
 new c4df938  Merge pull request #4188 from Nordix/feature/GEODE-7319
bbd09ef is described below

commit bbd09ef40b1f677634b918cb218f7faae43ad65c
Author: mivanac 
AuthorDate: Sat Oct 19 17:01:26 2019 +0200

GEODE-7319: Solution for flaky test
---
 .../geode/internal/cache/tier/sockets/CacheClientNotifier.java  | 5 +
 .../test/java/org/apache/geode/internal/cache/BucketRegionTest.java | 6 ++
 2 files changed, 11 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
index 7395ea7..40abfa2 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
@@ -162,6 +162,11 @@ public class CacheClientNotifier {
 return ccnSingleton;
   }
 
+  @VisibleForTesting
+  public static void resetInstance() {
+ccnSingleton = null;
+  }
+
   /**
* Registers a new client updater that wants to receive updates with this 
server.
*
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/BucketRegionTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/BucketRegionTest.java
index 2042557..4293c3e 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/BucketRegionTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/BucketRegionTest.java
@@ -456,6 +456,8 @@ public class BucketRegionTest {
 doReturn(false).when(partitionedRegion).isInitialized();
 doReturn(true).when(partitionedRegion).shouldDispatchListenerEvent();
 
+CacheClientNotifier.resetInstance();
+
 bucketRegion.invokeDestroyCallbacks(EnumListenerEvent.AFTER_DESTROY, 
event, false, false);
 
 verify(partitionedRegion, 
never()).invokeDestroyCallbacks(EnumListenerEvent.AFTER_DESTROY,
@@ -503,6 +505,8 @@ public class BucketRegionTest {
 doReturn(false).when(partitionedRegion).isInitialized();
 doReturn(true).when(partitionedRegion).shouldDispatchListenerEvent();
 
+CacheClientNotifier.resetInstance();
+
 bucketRegion.invokeInvalidateCallbacks(EnumListenerEvent.AFTER_INVALIDATE, 
event, false);
 
 verify(partitionedRegion, 
never()).invokeInvalidateCallbacks(EnumListenerEvent.AFTER_INVALIDATE,
@@ -550,6 +554,8 @@ public class BucketRegionTest {
 doReturn(false).when(partitionedRegion).isInitialized();
 doReturn(true).when(partitionedRegion).shouldDispatchListenerEvent();
 
+CacheClientNotifier.resetInstance();
+
 bucketRegion.invokePutCallbacks(EnumListenerEvent.AFTER_CREATE, event, 
false, false);
 
 verify(partitionedRegion, 
never()).invokePutCallbacks(EnumListenerEvent.AFTER_CREATE, event,



[geode] branch develop updated (27f9b70 -> 5046c70)

2019-10-19 Thread mivanac
This is an automated email from the ASF dual-hosted git repository.

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


from 27f9b70  Merge pull request #4180 from 
apache/revert-4178-feature/GEODE-7319
 new 0f8248a  GEODE-6807: cache adviseUpdate and adviseAllEventsOrCached
 new 097de3d  GEODE-6807: update with comments
 new 0ab8b6b  GEODE-6807: update adviseAllEventsOrCached method
 new ac689a8  GEODE-6807: update of solution with checking of version
 new 07b18a0  GEODE-6807: remove assert from new code
 new 928e6cd  GEODE-6807: Added UT and inRecovery update check
 new e0bfae6  GEODE-6807: Added Concurrent Test
 new 794edda  GEODE-6807: Added missing @Test and rebase
 new 5046c70  Merge pull request #4086 from Nordix/feature/GEODE-6807

The 8546 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../CacheDistributionAdvisorConcurrentTest.java| 105 
 .../distributed/internal/DistributionAdvisor.java  |  16 +-
 .../internal/cache/CacheDistributionAdvisor.java   |  98 +---
 .../internal/cache/DistributedCacheOperation.java  |   2 +-
 .../geode/internal/cache/DistributedRegion.java|   7 +-
 .../cache/CacheDistributionAdvisorTest.java| 176 +
 6 files changed, 374 insertions(+), 30 deletions(-)
 create mode 100644 
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/CacheDistributionAdvisorConcurrentTest.java
 create mode 100644 
geode-core/src/test/java/org/apache/geode/internal/cache/CacheDistributionAdvisorTest.java



  1   2   >