fix incorrect check checkpoint pages
@@ -2209,7 +2209,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
curr.cpBeginFut.onDone();
- if (!F.isEmpty(cpPagesTuple.get1())) {
+ if (hasPageForWrite(cpPagesTuple.get1())) {
assert cpPtr != null;
// Sync log outside the checkpoint write lock.
@@ -2259,6 +2259,24 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
}
}
+ /**
+ * Check that at least one collection is not empty.
+ *
+ * @param cpPagesCollWrapper Collection of {@link GridMultiCollectionWrapper} checkpoint pages.
+ */
+ private boolean hasPageForWrite(Collection<GridMultiCollectionWrapper<FullPageId>> cpPagesCollWrapper) {
+ boolean hasPages = false;
+
+ for (Collection c : cpPagesCollWrapper)
+ if (!c.isEmpty()) {
+ hasPages = true;
+
+ break;
+ }
+
+ return hasPages;
+ }
+
/**
* @return tuple with collections of FullPageIds obtained from each PageMemory and overall number of dirty pages.
*/
@@ -2334,7 +2352,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
* @param cpPagesTuple Checkpoint pages tuple.
*/
private GridMultiCollectionWrapper<FullPageId> splitAndSortCpPagesIfNeeded(
- IgniteBiTuple<Collection<GridMultiCollectionWrapper<FullPageId>>, Integer> cpPagesTuple) {
+ IgniteBiTuple<Collection<GridMultiCollectionWrapper<FullPageId>>, Integer> cpPagesTuple
+ ) {
List<FullPageId> cpPagesList = new ArrayList<>(cpPagesTuple.get2());
for (GridMultiCollectionWrapper<FullPageId> col : cpPagesTuple.get1()) {
