ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject ignite git commit: IGNITE-7471 fix npe
Date Fri, 19 Jan 2018 12:00:28 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2.4 b54c0c878 -> 2f5997788


IGNITE-7471 fix npe


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2f599778
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2f599778
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2f599778

Branch: refs/heads/ignite-2.4
Commit: 2f5997788ccff265a088921210f561985f640517
Parents: b54c0c8
Author: Dmitriy Govorukhin <dmitriy.govorukhin@gmail.com>
Authored: Fri Jan 19 14:46:38 2018 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Fri Jan 19 15:00:17 2018 +0300

----------------------------------------------------------------------
 .../GridCacheDatabaseSharedManager.java         | 24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2f599778/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index e56b352..580fb3a 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -1537,13 +1537,18 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
     ) {
         final Map<Integer, Map<Integer, CheckpointEntry>> res = new HashMap<>();
 
+        if (F.isEmpty(part4reserve))
+            return res;
+
         for (Long cpTs : checkpointHist.checkpoints()) {
+            CheckpointEntry chpEntry = null;
+
             try {
-                final CheckpointEntry chpEntry = checkpointHist.entry(cpTs);
+                chpEntry = checkpointHist.entry(cpTs);
 
                 Map<Integer, CheckpointEntry.GroupState> grpsState = chpEntry.groupState(cctx);
 
-                if (grpsState.isEmpty()){
+                if (F.isEmpty(grpsState)) {
                     res.clear();
 
                     continue;
@@ -1579,7 +1584,12 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                     }
                 }
             }
-            catch (IgniteCheckedException ignore) {
+            catch (IgniteCheckedException ex) {
+                String msg = chpEntry != null ?
+                    ", chpId=" + chpEntry.cpId + " ptr=" + chpEntry.cpMark + " ts=" + chpEntry.cpTs
: "";
+
+                U.error(log, "Failed to read checkpoint entry" + msg, ex);
+
                 // Treat exception the same way as a gap.
                 res.clear();
             }
@@ -3849,10 +3859,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                 AtomicIntegerFieldUpdater.newUpdater(GroupStateLazyStore.class, "initGuard");
 
             /** Cache states. Initialized lazily. */
-            private Map<Integer, GroupState> grpStates;
+            private volatile Map<Integer, GroupState> grpStates;
 
             /** */
-            private volatile CountDownLatch latch;
+            private final CountDownLatch latch;
 
             /** */
             @SuppressWarnings("unused")
@@ -3920,7 +3930,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
             private Long partitionCounter(int grpId, int part) {
                 assert initGuard != 0 : initGuard;
 
-                if (initEx != null)
+                if (initEx != null || grpStates == null)
                     return null;
 
                 GroupState state = grpStates.get(grpId);
@@ -3963,6 +3973,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                     }
                     catch (IgniteCheckedException e) {
                         initEx = e;
+
+                        throw e;
                     }
                     finally {
                         latch.countDown();


Mime
View raw message