You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/02/18 18:34:59 UTC

[GitHub] [geode] pivotal-eshu opened a new pull request #7382: GEODE-10063: Correctly set primary queue connection.

pivotal-eshu opened a new pull request #7382:
URL: https://github.com/apache/geode/pull/7382


     *  When adding QueueConnection to connectionList, also checks if the connection
        has been destroyed by another thread to prevent a bad connection is being
        added to the list.
     *  Schedule RedundancySatisfierTask after remove connection so that bad connection
        can be detected.
     *  During recoveryPrimary in RedundancySatisfierTask, need to check if primary
        connection is destroyed. If so, connection from backups will be promoted to
        primary.
   
   <!-- Thank you for submitting a contribution to Apache Geode. -->
   
   <!-- In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken: 
   -->
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   <!-- Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] boglesby commented on a change in pull request #7382: GEODE-10063: Correctly set primary queue connection.

Posted by GitBox <gi...@apache.org>.
boglesby commented on a change in pull request #7382:
URL: https://github.com/apache/geode/pull/7382#discussion_r810328021



##########
File path: geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
##########
@@ -724,7 +724,7 @@ private void recoverRedundancy(Set<ServerLocation> excludedServers, boolean reco
     }
   }
 
-  private QueueConnectionImpl promoteBackupToPrimary(List<Connection> backups) {
+  QueueConnectionImpl promoteBackupToPrimary(List<Connection> backups) {

Review comment:
       Do you need to add VisibleForTesting to this method?

##########
File path: geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
##########
@@ -355,7 +355,7 @@ void connectionCrashed(Connection con) {
     endpointCrashed(con.getEndpoint());
   }
 
-  private void endpointCrashed(Endpoint endpoint) {
+  void endpointCrashed(Endpoint endpoint) {

Review comment:
       Do you need to add VisibleForTesting to this method?

##########
File path: geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
##########
@@ -844,12 +844,12 @@ private QueueConnectionImpl createNewPrimary(Set<ServerLocation> excludedServers
    * First we try to make a backup server the primary, but if run out of backup servers we will try
    * to find a new server.
    */
-  private void recoverPrimary(Set<ServerLocation> excludedServers) {
+  void recoverPrimary(Set<ServerLocation> excludedServers) {

Review comment:
       Do you need to add VisibleForTesting to this method?

##########
File path: geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
##########
@@ -980,7 +980,7 @@ private QueueConnectionImpl initializeQueueConnection(Connection connection, boo
   // connection but CCU may died as endpoint closed....
   // so before putting connection need to see if something(crash) happen we should be able to
   // recover from it
-  private boolean addToConnectionList(QueueConnectionImpl connection, boolean isPrimary) {
+  boolean addToConnectionList(QueueConnectionImpl connection, boolean isPrimary) {

Review comment:
       Do you need to add VisibleForTesting to this method?

##########
File path: geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java
##########
@@ -373,8 +373,8 @@ private void endpointCrashed(Endpoint endpoint) {
                   ? (deadConnection.getUpdater().isPrimary() ? "Primary" : "Redundant")
                   : "Queue",
                   endpoint});
-      scheduleRedundancySatisfierIfNeeded(0);
       deadConnection.internalDestroy();
+      scheduleRedundancySatisfierIfNeeded(0);

Review comment:
       I'm glad you did this. I wanted to reverse these two method calls for GEODE-10009.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] pivotal-eshu merged pull request #7382: GEODE-10063: Correctly set primary queue connection.

Posted by GitBox <gi...@apache.org>.
pivotal-eshu merged pull request #7382:
URL: https://github.com/apache/geode/pull/7382


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org