Fixed assertion error - page eviction should be before locking entry
@@ -1765,6 +1765,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
ctx.shared().database().checkpointReadLock();
try {
+ ctx.shared().database().ensureFreeSpace(ctx.memoryPolicy());
+
// If batch store update is enabled, we need to lock all entries.
// First, need to acquire locks on cache entries, then check filter.
List<GridDhtCacheEntry> locked = lockEntries(req, req.topologyVersion());;
@@ -1788,8 +1790,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
// Do not check topology version if topology was locked on near node by
// external transaction or explicit lock.
if (req.topologyLocked() || !needRemap(req.topologyVersion(), top.topologyVersion())) {
- ctx.shared().database().ensureFreeSpace(ctx.memoryPolicy());
-
boolean hasNear = ctx.discovery().cacheNearNode(node, name());
// Assign next version for update inside entries lock.
