Added missing "setCandidatePageCount" in "GridCacheOffheapManager.addPartitions" - Fixes
@@ -890,9 +890,23 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
try {
long metaPageAddr = pageMem.writeLock(grpId, metaPageId, metaPage);
+ if (metaPageAddr == 0L) {
+ U.warn(log, "Failed to acquire write lock for index meta page [grpId=" + grpId +
+ ", metaPageId=" + metaPageId + ']');
+
+ return;
+ }
+
+ boolean changed = false;
+
try {
PageMetaIO metaIo = PageMetaIO.getPageIO(metaPageAddr);
+ int pageCnt = this.ctx.pageStore().pages(grpId, PageIdAllocator.INDEX_PARTITION);
+
+ changed = metaIo.setCandidatePageCount(metaPageAddr, pageCnt);
+
+ // Following method doesn't modify page data, it only reads last allocated page count from it.
addPartition(
null,
ctx.partitionStatMap(),
@@ -900,11 +914,11 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
metaIo,
grpId,
PageIdAllocator.INDEX_PARTITION,
- this.ctx.pageStore().pages(grpId, PageIdAllocator.INDEX_PARTITION),
+ pageCnt,
-1);
}
finally {
- pageMem.writeUnlock(grpId, metaPageId, metaPage, null, true);
+ pageMem.writeUnlock(grpId, metaPageId, metaPage, null, changed);
}
}
finally {
