geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zho...@apache.org
Subject geode git commit: fix 2 primary
Date Fri, 21 Jul 2017 06:44:37 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEM-1483 40fb5fdf9 -> 8018a7511


fix 2 primary


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/8018a751
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/8018a751
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/8018a751

Branch: refs/heads/feature/GEM-1483
Commit: 8018a751191c5461785a61ecec771ac0741d7b78
Parents: 40fb5fd
Author: zhouxh <gzhou@pivotal.io>
Authored: Thu Jul 20 23:43:42 2017 -0700
Committer: zhouxh <gzhou@pivotal.io>
Committed: Thu Jul 20 23:43:42 2017 -0700

----------------------------------------------------------------------
 .../internal/cache/PRHARedundancyProvider.java  | 28 +++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/8018a751/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
index f8e2108..2c1905f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
@@ -1798,10 +1798,30 @@ public class PRHARedundancyProvider {
   public void scheduleCreateMissingBuckets() {
     if (this.prRegion.getColocatedWith() != null
         && ColocationHelper.isColocationComplete(this.prRegion)) {
-      Runnable task = new CreateMissingBucketsTask(this);
-      final InternalResourceManager resourceManager =
-          this.prRegion.getGemFireCache().getInternalResourceManager();
-      resourceManager.getExecutor().execute(task);
+      Runnable waitThread = new Runnable() {
+        @Override
+        public void run() {
+          boolean interrupted = false;
+          while (!PRHARedundancyProvider.this.isPersistentRecoveryComplete()) {
+            try {
+              prRegion.getLogger().info("GGG7:waiting for recovery:" + prRegion.getFullPath());
+              prRegion.getCancelCriterion().checkCancelInProgress(null);
+              Thread.sleep(100);
+            } catch (InterruptedException e) {
+              interrupted = true;
+            }
+          }
+
+          if (!interrupted) {
+            prRegion.getLogger().info("GGG7:waited for recovery:" + prRegion.getFullPath());
+            Runnable task = new CreateMissingBucketsTask(PRHARedundancyProvider.this);
+            final InternalResourceManager resourceManager =
+                prRegion.getGemFireCache().getInternalResourceManager();
+            resourceManager.getExecutor().execute(task);
+          }
+        }
+      };
+      waitThread.run();
     }
   }
 


Mime
View raw message