You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/08/16 15:41:44 UTC

[21/25] ignite git commit: IGNITE-6074 Fixed test fail IgniteWalRecoveryTest#testWalBigObjectNodeCancel (reset position and limit after expand buffer) - Fixes #2452.

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

Signed-off-by: Alexey Goncharuk <al...@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/ignite-5901
Commit: 2506ae591abf5926d42a396f4bf4d3a1d4dcc2ad
Parents: 59facfc
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Wed Aug 16 14:06:58 2017 +0300
Committer: Alexey Goncharuk <al...@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;