ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [20/26] ignite git commit: IGNITE-5816 - Fixed race in WAL segment close leading to ClosedChannelException
Date Mon, 31 Jul 2017 08:57:06 GMT
IGNITE-5816 - Fixed race in WAL segment close leading to ClosedChannelException


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

Branch: refs/heads/ignite-5757
Commit: 6cff4811636209ce39b1e2097b5a14233ee08413
Parents: 97813a8
Author: Ivan Rakov <ivan.glukos@gmail.com>
Authored: Fri Jul 28 19:54:07 2017 +0300
Committer: Ivan Rakov <ivan.glukos@gmail.com>
Committed: Fri Jul 28 19:54:25 2017 +0300

----------------------------------------------------------------------
 .../cache/persistence/wal/FileWriteAheadLogManager.java         | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6cff4811/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
index 85eb480..17db8f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
@@ -1881,7 +1881,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter
impl
             if (expHead.previous() == null) {
                 FakeRecord frHead = (FakeRecord)expHead;
 
-                if (stop == frHead.stop)
+                if (!stop || frHead.stop) // Protects from CASing terminal FakeRecord(true)
to FakeRecord(false)
                     return false;
             }
 
@@ -1891,6 +1891,9 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter
impl
             if (!head.compareAndSet(expHead, new FakeRecord(new FileWALPointer(idx, (int)nextPosition(expHead),
0), stop)))
                 return false;
 
+            if (expHead.chainSize() == 0)
+                return false;
+
             // At this point we grabbed the piece of WAL chain.
             // Any failure in this code must invalidate the environment.
             try {


Mime
View raw message