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-6096 Fixed races on partition evict - Fixes #2463.
Date Thu, 17 Aug 2017 15:29:25 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 136075ae0 -> b3ae58ecc


IGNITE-6096 Fixed races on partition evict - Fixes #2463.

Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>


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

Branch: refs/heads/master
Commit: b3ae58eccb35369041342e4a5d9bb5f661417d41
Parents: 136075a
Author: Ilya Lantukh <ilantukh@gridgain.com>
Authored: Thu Aug 17 18:18:05 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Aug 17 18:29:04 2017 +0300

----------------------------------------------------------------------
 .../dht/GridDhtPartitionTopologyImpl.java           | 16 ++++++++++++++++
 .../persistence/GridCacheDatabaseSharedManager.java | 11 +++++++----
 .../cache/persistence/pagemem/PageMemoryImpl.java   |  9 ++++++++-
 3 files changed, 31 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b3ae58ec/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index d7a224c..0eff7fa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -660,6 +660,15 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
         GridDhtLocalPartition loc = locParts.get(p);
 
         if (loc == null || loc.state() == EVICTED) {
+            if (loc != null) {
+                try {
+                    loc.rent(false).get();
+                }
+                catch (IgniteCheckedException e) {
+                    throw new IgniteException(e);
+                }
+            }
+
             locParts.set(p, loc = new GridDhtLocalPartition(ctx, grp, p));
 
             T2<Long, Long> cntr = cntrMap.get(p);
@@ -741,6 +750,13 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
             boolean belongs = partitionLocalNode(p, topVer);
 
             if (loc != null && state == EVICTED) {
+                try {
+                    loc.rent(false).get();
+                }
+                catch (IgniteCheckedException ex) {
+                    throw new IgniteException(ex);
+                }
+
                 locParts.set(p, loc = null);
 
                 if (!belongs)

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3ae58ec/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 19af87b..3ef9e61 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
@@ -1549,6 +1549,13 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                     if (storeMgr.pages(grpId, i) <= 1)
                         continue;
 
+                    GridDhtLocalPartition part = grp.topology().forceCreatePartition(i);
+
+                    assert part != null;
+
+                    // TODO: https://issues.apache.org/jira/browse/IGNITE-6097
+                    grp.offheap().onPartitionInitialCounterUpdated(i, 0);
+
                     long partMetaId = pageMem.partitionMetaPageId(grpId, i);
                     long partMetaPage = pageMem.acquirePage(grpId, partMetaId);
                     try {
@@ -1561,10 +1568,6 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
                             T2<Integer, Long> fromWal = partStates.get(new T2<>(grpId,
i));
 
-                            GridDhtLocalPartition part = grp.topology().forceCreatePartition(i);
-
-                            assert part != null;
-
                             if (fromWal != null) {
                                 int stateId = fromWal.get1();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3ae58ec/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
index b6e5f46..dbb64f8 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
@@ -640,13 +640,14 @@ public class PageMemoryImpl implements PageMemoryEx {
 
         GridUnsafe.setMemory(absPtr + PAGE_OVERHEAD, pageSize(), (byte)0);
 
+        PageHeader.dirty(absPtr, false);
+
         long tmpBufPtr = PageHeader.tempBufferPointer(absPtr);
 
         if (tmpBufPtr != INVALID_REL_PTR) {
             GridUnsafe.setMemory(checkpointPool.absolute(tmpBufPtr) + PAGE_OVERHEAD, pageSize(),
(byte)0);
 
             PageHeader.tempBufferPointer(absPtr, INVALID_REL_PTR);
-            PageHeader.dirty(absPtr, false);
 
             // We pinned the page when allocated the temp buffer, release it now.
             PageHeader.releasePage(absPtr);
@@ -657,6 +658,12 @@ public class PageMemoryImpl implements PageMemoryEx {
         if (rmv)
             seg.loadedPages.remove(cacheId, PageIdUtils.effectivePageId(pageId), tag);
 
+        if (seg.segCheckpointPages != null)
+            seg.segCheckpointPages.remove(new FullPageId(pageId, cacheId));
+
+        if (seg.dirtyPages != null)
+            seg.dirtyPages.remove(new FullPageId(pageId, cacheId));
+
         return relPtr;
     }
 


Mime
View raw message