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

[09/17] ignite git commit: ignite-db-x - wip2

ignite-db-x - wip2


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

Branch: refs/heads/ignite-4652
Commit: 94174121522f318b2df0564729b9a81cbd1a3a42
Parents: 4f1088f
Author: Sergi Vladykin <se...@gmail.com>
Authored: Tue Feb 14 15:59:18 2017 +0300
Committer: Sergi Vladykin <se...@gmail.com>
Committed: Tue Feb 14 15:59:18 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/database/tree/BPlusTree.java         | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/94174121/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
index 51d2c83..c21032f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
@@ -358,7 +358,15 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
                 // Inner replace state must be consistent by the end of the operation.
                 assert p.needReplaceInner == FALSE || p.needReplaceInner == DONE : p.needReplaceInner;
 
-                p.finish();
+                // Need to replace inner key if now we are replacing the rightmost row and have a forward page.
+                if (canGetRowFromInner && idx + 1 == cnt && p.fwdId != 0L && p.needReplaceInner == FALSE) {
+                    // Can happen only for invoke, otherwise inner key must be replaced on the way down.
+                    assert p.invoke;
+
+                    p.needReplaceInner = TRUE;
+                }
+                else
+                    p.finish();
             }
 
             io.store(pageAddr, idx, newRow, null);