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-6074 Fixed test fail IgniteWalRecoveryTest#testWalBigObjectNodeCancel (reset position and limit after expand buffer) - Fixes #2452.
Date Wed, 16 Aug 2017 11:18:00 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 59facfca3 -> 2506ae591


IGNITE-6074 Fixed test fail IgniteWalRecoveryTest#testWalBigObjectNodeCancel (reset position
and limit after expand buffer) - Fixes #2452.

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/2506ae59
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2506ae59
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2506ae59

Branch: refs/heads/master
Commit: 2506ae591abf5926d42a396f4bf4d3a1d4dcc2ad
Parents: 59facfc
Author: Dmitriy Govorukhin <dmitriy.govorukhin@gmail.com>
Authored: Wed Aug 16 14:06:58 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Aug 16 14:06:58 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/persistence/wal/ByteBufferExpander.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2506ae59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/ByteBufferExpander.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/ByteBufferExpander.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/ByteBufferExpander.java
index cf1db84..e7130a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/ByteBufferExpander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/ByteBufferExpander.java
@@ -54,9 +54,16 @@ public class ByteBufferExpander implements AutoCloseable {
      * @return ByteBuffer with requested size.
      */
     public ByteBuffer expand(int size) {
+        assert buf.capacity() < size;
+
+        int pos = buf.position();
+        int lim = buf.limit();
+
         ByteBuffer newBuf = GridUnsafe.reallocateBuffer(buf, size);
 
         newBuf.order(buf.order());
+        newBuf.position(pos);
+        newBuf.limit(lim);
 
         buf = newBuf;
 


Mime
View raw message