geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [geode] branch develop updated: GEODE-2542: Push DH keys when locator becomes coordinator
Date Tue, 17 Oct 2017 17:57:24 GMT
This is an automated email from the ASF dual-hosted git repository.

udo 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 e9f8563  GEODE-2542: Push DH keys when locator becomes coordinator
e9f8563 is described below

commit e9f856357565e72e8fe7dff7235404a74fdb5af9
Author: Brian Rowe <browe@pivotal.io>
AuthorDate: Tue Oct 10 15:17:06 2017 -0700

    GEODE-2542: Push DH keys when locator becomes coordinator
    
    This solves a race condition where a second locator (started at
    the same time) would fail to get a join response due to the join
     request being processed prior to becoming coordinator.
    
    Signed-off-by: Hitesh Khamesra <hiteshk25@yahoo.com>
---
 .../membership/gms/membership/GMSJoinLeave.java       | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index 00e55f5..ec04e39 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -729,7 +729,25 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
       logger.warn("unable to record a membership view request due to this exception", t);
       throw t;
     }
+  }
+
+  private void sendDHKeys() {
+    if (isCoordinator
+        && !services.getConfig().getDistributionConfig().getSecurityUDPDHAlgo().isEmpty())
{
+      synchronized (viewRequests) {
+        for (DistributionMessage request : viewRequests) {
+          if (request instanceof JoinRequestMessage) {
 
+            services.getMessenger().initClusterKey();
+            JoinRequestMessage jreq = (JoinRequestMessage) request;
+            // this will inform about cluster-secret key, as we have authenticated at this
point
+            JoinResponseMessage response = new JoinResponseMessage(jreq.getSender(),
+                services.getMessenger().getClusterSecretKey(), jreq.getRequestId());
+            services.getMessenger().send(response);
+          }
+        }
+      }
+    }
   }
 
   // for testing purposes, returns a copy of the view requests for verification
@@ -783,6 +801,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
     if (locator != null) {
       locator.setIsCoordinator(true);
     }
+    sendDHKeys();
     if (currentView == null) {
       // create the initial membership view
       NetView newView = new NetView(this.localAddress);

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message