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-5816 - Fixed assertion on segment close
Date Fri, 28 Jul 2017 11:38:31 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5816 bd9205086 -> ed140ada0


IGNITE-5816 - Fixed assertion on segment close


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

Branch: refs/heads/ignite-5816
Commit: ed140ada06337068d4874f9c0cc5de9133fba405
Parents: bd92050
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Fri Jul 28 14:38:21 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Fri Jul 28 14:38:21 2017 +0300

----------------------------------------------------------------------
 .../persistence/wal/FileWriteAheadLogManager.java   | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ed140ada/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 b83aafb..85eb480 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
@@ -2074,14 +2074,24 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter
impl
 
                         buf.rewind();
 
-                        fileIO.write(buf, written);
+                        int rem = buf.remaining();
 
+                        while (rem > 0) {
+                            int written0 = fileIO.write(buf, written);
+
+                            written += written0;
+
+                            rem -= written0;
+                        }
                     }
 
-                    // Instead of two fsyncs.
-                    if (mode == WALMode.DEFAULT)
+                    // Do the final fsync.
+                    if (mode == WALMode.DEFAULT) {
                         fileIO.force();
 
+                        lastFsyncPos = written;
+                    }
+
                     fileIO.close();
                 }
                 catch (IOException e) {


Mime
View raw message