ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/5] ignite git commit: ignite-3477 Do not read lock meta page on each BPlusTree access (store needed info in field).
Date Wed, 18 Jan 2017 14:20:43 GMT
ignite-3477 Do not read lock meta page on each BPlusTree access (store needed info in field).


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

Branch: refs/heads/ignite-gg-11810-2
Commit: b8d435b6f1a5798a3525d54c56cc1ffba237a505
Parents: f8c7753
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Jan 18 16:49:47 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Jan 18 16:49:47 2017 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheOffheapManagerImpl.java    |   6 +-
 .../cache/database/MetadataStorage.java         |   3 +-
 .../cache/database/tree/BPlusTree.java          | 222 +++++++++++--------
 .../cache/database/tree/io/BPlusMetaIO.java     |   2 +-
 .../cluster/GridClusterStateProcessor.java      |   9 +-
 .../processors/database/BPlusTreeSelfTest.java  |   2 +-
 .../processors/query/h2/database/H2Tree.java    |   3 +-
 7 files changed, 143 insertions(+), 104 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b8d435b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index f4a789a..63a5072 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -1222,8 +1222,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
             this.rowStore = rowStore;
             this.cctx = cctx;
 
-            if (initNew)
-                initNew();
+            initTree(initNew);
         }
 
         /** {@inheritDoc} */
@@ -1596,8 +1595,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
 
             this.cctx = cctx;
 
-            if (initNew)
-                initNew();
+            initTree(initNew);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b8d435b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
index cf6decb..34bd280 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/MetadataStorage.java
@@ -182,8 +182,7 @@ public class MetadataStorage implements MetaStore {
             this.allocPartId = allocPartId;
             this.allocSpace = allocSpace;
 
-            if (initNew)
-                initNew();
+            initTree(initNew);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b8d435b6/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 e91dda9..e4afc13 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
@@ -54,7 +54,9 @@ import org.apache.ignite.internal.processors.cache.database.tree.io.PageIO;
 import org.apache.ignite.internal.processors.cache.database.tree.reuse.ReuseBag;
 import org.apache.ignite.internal.processors.cache.database.tree.reuse.ReuseList;
 import org.apache.ignite.internal.processors.cache.database.tree.util.PageHandler;
-import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.GridArrays;
+import org.apache.ignite.internal.util.GridLongList;
+import org.apache.ignite.internal.util.IgniteTree;
 import org.apache.ignite.internal.util.lang.GridCursor;
 import org.apache.ignite.internal.util.lang.GridTreePrinter;
 import org.apache.ignite.internal.util.typedef.F;
@@ -116,6 +118,9 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
     private final AtomicLong globalRmvId;
 
     /** */
+    private volatile TreeMetaData treeMeta;
+
+    /** */
     private final GridTreePrinter<Long> treePrinter = new GridTreePrinter<Long>()
{
         /** */
         private boolean keys = true;
@@ -248,7 +253,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
                     return NOT_FOUND;
             }
 
-            assert !io.isLeaf();
+            assert !io.isLeaf() : io;
 
             // If idx == cnt then we go right down, else left down: getLeft(cnt) == getRight(cnt
- 1).
             g.pageId = inner(io).getLeft(pageAddr, idx);
@@ -531,6 +536,12 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
             if (needWalDeltaRecord(meta))
                 wal.log(new MetaPageCutRootRecord(cacheId, meta.id()));
 
+            int newLvl = lvl - 1;
+
+            assert io.getRootLevel(pageAddr) == newLvl;
+
+            treeMeta = new TreeMetaData(newLvl, io.getFirstPageId(pageAddr, newLvl));
+
             return TRUE;
         }
     };
@@ -551,6 +562,11 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
             if (needWalDeltaRecord(meta))
                 wal.log(new MetaPageAddRootRecord(cacheId, meta.id(), rootPageId));
 
+            assert io.getRootLevel(pageAddr) == lvl;
+            assert io.getFirstPageId(pageAddr, lvl) == rootPageId;
+
+            treeMeta = new TreeMetaData(lvl, rootPageId);
+
             return TRUE;
         }
     };
@@ -569,6 +585,11 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
             if (needWalDeltaRecord(meta))
                 wal.log(new MetaPageInitRootRecord(cacheId, meta.id(), rootId));
 
+            assert io.getRootLevel(pageAddr) == 0;
+            assert io.getFirstPageId(pageAddr, 0) == rootId;
+
+            treeMeta = new TreeMetaData(0, rootId);
+
             return TRUE;
         }
     };
@@ -633,39 +654,73 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
     }
 
     /**
-     * Initialize new index.
+     * Initialize new tree.
      *
+     * @param initNew {@code True} if new tree should be created.
      * @throws IgniteCheckedException If failed.
      */
-    protected final void initNew() throws IgniteCheckedException {
-        // Allocate the first leaf page, it will be our root.
-        long rootId = allocatePage(null);
+    protected final void initTree(boolean initNew) throws IgniteCheckedException {
+        if (initNew) {
+            // Allocate the first leaf page, it will be our root.
+            long rootId = allocatePage(null);
+
+            try (Page root = page(rootId)) {
+                initPage(pageMem, root, this, latestLeafIO(), wal);
+            }
+
+            // Initialize meta page with new root page.
+            try (Page meta = page(metaPageId)) {
+                Bool res = writePage(pageMem, meta, this, initRoot, BPlusMetaIO.VERSIONS.latest(),
wal, rootId, 0, FALSE);
 
-        try (Page root = page(rootId)) {
-            initPage(pageMem, root, this, latestLeafIO(), wal);
+                assert res == TRUE: res;
+            }
+
+            assert treeMeta != null;
         }
+    }
+
+    /**
+     * @return Tree meta data.
+     * @throws IgniteCheckedException If failed.
+     */
+    private TreeMetaData treeMeta() throws IgniteCheckedException {
+        TreeMetaData meta0 = treeMeta;
+
+        if (meta0 != null)
+            return meta0;
 
-        // Initialize meta page with new root page.
         try (Page meta = page(metaPageId)) {
-            Bool res = writePage(pageMem, meta, this, initRoot, BPlusMetaIO.VERSIONS.latest(),
wal, rootId, 0, FALSE);
+            long pageAddr = readLock(meta); // Meta can't be removed.
+
+            assert pageAddr != 0 : "Failed to read lock meta page [page=" + meta + ", metaPageId="
+
+                U.hexLong(metaPageId) + ']';
+
+            try {
+                BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(pageAddr);
 
-            assert res == TRUE: res;
+                int rootLvl = io.getRootLevel(pageAddr);
+                long rootId = io.getFirstPageId(pageAddr, rootLvl);
+
+                treeMeta = meta0 = new TreeMetaData(rootLvl, rootId);
+            }
+            finally {
+                readUnlock(meta, pageAddr);
+            }
         }
+
+        return meta0;
     }
 
     /**
-     * @param meta Meta page.
      * @return Root level.
+     * @throws IgniteCheckedException If failed.
      */
-    private int getRootLevel(Page meta) {
-        long pageAddr = readLock(meta); // Meta can't be removed.
+    private int getRootLevel() throws IgniteCheckedException {
+        TreeMetaData meta0 = treeMeta();
 
-        try {
-            return BPlusMetaIO.VERSIONS.forPage(pageAddr).getRootLevel(pageAddr);
-        }
-        finally {
-            readUnlock(meta, pageAddr);
-        }
+        assert meta0 != null;
+
+        return meta0.rootLvl;
     }
 
     /**
@@ -790,25 +845,20 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
      * @throws IgniteCheckedException If failed.
      */
     private void doFind(Get g) throws IgniteCheckedException {
-        try {
-            for (;;) { // Go down with retries.
-                g.init();
+        for (;;) { // Go down with retries.
+            g.init();
 
-                switch (findDown(g, g.rootId, 0L, g.rootLvl)) {
-                    case RETRY:
-                    case RETRY_ROOT:
-                        checkInterrupted();
+            switch (findDown(g, g.rootId, 0L, g.rootLvl)) {
+                case RETRY:
+                case RETRY_ROOT:
+                    checkInterrupted();
 
-                        continue;
+                    continue;
 
-                    default:
-                        return;
-                }
+                default:
+                    return;
             }
         }
-        finally {
-            g.releaseMeta();
-        }
     }
 
     /**
@@ -904,7 +954,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
         int rootLvl;
 
         try (Page meta = page(metaPageId)) {
-            rootLvl = getRootLevel(meta);
+            rootLvl = getRootLevel();
 
             if (rootLvl < 0)
                 fail("Root level: " + rootLvl);
@@ -913,7 +963,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
 
             rootPageId = getFirstPageId(meta, rootLvl);
 
-            validateDownPages(meta, rootPageId, 0L, rootLvl);
+            validateDownPages(rootPageId, 0L, rootLvl);
 
             validateDownKeys(rootPageId, null);
         }
@@ -1064,13 +1114,12 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
     }
 
     /**
-     * @param meta Meta page.
      * @param pageId Page ID.
      * @param fwdId Forward ID.
      * @param lvl Level.
      * @throws IgniteCheckedException If failed.
      */
-    private void validateDownPages(Page meta, long pageId, long fwdId, final int lvl) throws
IgniteCheckedException {
+    private void validateDownPages(long pageId, long fwdId, final int lvl) throws IgniteCheckedException
{
         try (Page page = page(pageId)) {
             long pageAddr = readLock(page); // No correctness guaranties.
 
@@ -1096,13 +1145,13 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
                     fail("Negative count: " + cnt);
 
                 if (io.isLeaf()) {
-                    if (cnt == 0 && getRootLevel(meta) != 0)
+                    if (cnt == 0 && getRootLevel() != 0)
                         fail("Empty leaf page.");
                 }
                 else {
                     // Recursively go down if we are on inner level.
                     for (int i = 0; i < cnt; i++)
-                        validateDownPages(meta, inner(io).getLeft(pageAddr, i), inner(io).getRight(pageAddr,
i), lvl - 1);
+                        validateDownPages(inner(io).getLeft(pageAddr, i), inner(io).getRight(pageAddr,
i), lvl - 1);
 
                     if (fwdId != 0) {
                         // For the rightmost child ask neighbor.
@@ -1123,7 +1172,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
 
                     pageId = inner(io).getLeft(pageAddr, cnt); // The same as io.getRight(cnt
- 1) but works for routing pages.
 
-                    validateDownPages(meta, pageId, fwdId, lvl - 1);
+                    validateDownPages(pageId, fwdId, lvl - 1);
                 }
             }
             finally {
@@ -1290,7 +1339,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
 
                             // If not found, then the tree grew beyond our call stack ->
retry from the actual root.
                             if (res == RETRY || res == NOT_FOUND) {
-                                int root = getRootLevel(r.meta);
+                                int root = getRootLevel();
 
                                 boolean checkRes = r.checkTailLevel(root);
 
@@ -1321,7 +1370,6 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
         }
         finally {
             r.releaseTail();
-            r.releaseMeta();
 
             r.reuseFreePages();
         }
@@ -1466,9 +1514,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
     public final int rootLevel() throws IgniteCheckedException {
         checkDestroyed();
 
-        try (Page meta = page(metaPageId)) {
-            return getRootLevel(meta);
-        }
+        return getRootLevel();
     }
 
     /**
@@ -1551,7 +1597,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
                             // It must be impossible to have an insert higher than the current
root,
                             // because we are making decision about creating new root while
keeping
                             // write lock on current root, so it can't concurrently change.
-                            assert p.btmLvl <= getRootLevel(p.meta);
+                            assert p.btmLvl <= getRootLevel();
 
                             checkInterrupted();
 
@@ -1574,9 +1620,6 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
         catch (AssertionError e) {
             throw new AssertionError("Assertion error on row: " + row, e);
         }
-        finally {
-            p.releaseMeta();
-        }
     }
 
     /**
@@ -1898,9 +1941,6 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
         /** Starting point root ID. May be outdated. Must be modified only in {@link Get#init()}.
*/
         protected long rootId;
 
-        /** Meta page. Initialized by {@link Get#init()}, released by {@link Get#releaseMeta()}.
*/
-        protected Page meta;
-
         /** */
         protected L row;
 
@@ -1928,33 +1968,14 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
         /**
          * Initialize operation.
          *
-         * !!! Symmetrically with this method must be called {@link Get#releaseMeta()} in
{@code finally} block.
-         *
          * @throws IgniteCheckedException If failed.
          */
         final void init() throws IgniteCheckedException {
-            if (meta == null)
-                meta = page(metaPageId);
+            TreeMetaData meta0 = treeMeta();
 
-            int rootLvl;
-            long rootId;
+            assert meta0 != null;
 
-            long pageAddr = readLock(meta); // Meta can't be removed.
-
-            assert pageAddr != 0 : "Failed to read lock meta page [page=" + meta + ", metaPageId="
+
-                U.hexLong(metaPageId) + ']';
-
-            try {
-                BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(pageAddr);
-
-                rootLvl = io.getRootLevel(pageAddr);
-                rootId = io.getFirstPageId(pageAddr, rootLvl);
-            }
-            finally {
-                readUnlock(meta, pageAddr);
-            }
-
-            restartFromRoot(rootId, rootLvl, globalRmvId.get());
+            restartFromRoot(meta0.rootId, meta0.rootLvl, globalRmvId.get());
         }
 
         /**
@@ -1997,16 +2018,6 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
         }
 
         /**
-         * Release meta page.
-         */
-        final void releaseMeta() {
-            if (meta != null) {
-                meta.close();
-                meta = null;
-            }
-        }
-
-        /**
          * @param page Page.
          * @param lvl Level.
          * @return {@code true} If we can release the given page.
@@ -2269,7 +2280,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
                             wal.log(new FixCountRecord(cacheId, page.id(), cnt - 1));
                     }
 
-                    if (!hadFwd && lvl == getRootLevel(meta)) { // We are splitting
root.
+                    if (!hadFwd && lvl == getRootLevel()) { // We are splitting root.
                         long newRootId = allocatePage(bag);
 
                         try (Page newRoot = page(newRootId)) {
@@ -2303,9 +2314,11 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
                             }
                         }
 
-                        Bool res = writePage(pageMem, meta, BPlusTree.this, addRoot, newRootId,
lvl + 1, FALSE);
+                        try (Page meta = page(metaPageId)) {
+                            Bool res = writePage(pageMem, meta, BPlusTree.this, addRoot,
newRootId, lvl + 1, FALSE);
 
-                        assert res == TRUE: res;
+                            assert res == TRUE : res;
+                        }
 
                         return null; // We've just moved link up to root, nothing to return
here.
                     }
@@ -2624,7 +2637,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
 
                     assert needReplaceInner != TRUE;
 
-                    if (tail.getCount() == 0 && tail.lvl != 0 && getRootLevel(meta)
== tail.lvl) {
+                    if (tail.getCount() == 0 && tail.lvl != 0 && getRootLevel()
== tail.lvl) {
                         // Free root if it became empty after merge.
                         cutRoot(tail.lvl);
                         freePage(tail.page, tail.buf, false);
@@ -2995,9 +3008,11 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
          * @throws IgniteCheckedException If failed.
          */
         private void cutRoot(int lvl) throws IgniteCheckedException {
-            Bool res = writePage(pageMem, meta, BPlusTree.this, cutRoot, null, lvl, FALSE);
+            try (Page meta = page(metaPageId)) {
+                Bool res = writePage(pageMem, meta, BPlusTree.this, cutRoot, null, lvl, FALSE);
 
-            assert res == TRUE: res;
+                assert res == TRUE : res;
+            }
         }
 
         /**
@@ -3781,6 +3796,31 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
implements
     }
 
     /**
+     *
+     */
+    private static class TreeMetaData {
+        /** */
+        final int rootLvl;
+
+        /** */
+        final long rootId;
+
+        /**
+         * @param rootLvl Root level.
+         * @param rootId Root page ID.
+         */
+        TreeMetaData(int rootLvl, long rootId) {
+            this.rootLvl = rootLvl;
+            this.rootId = rootId;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(TreeMetaData.class, this);
+        }
+    }
+
+    /**
      * Operation result.
      */
     enum Result {

http://git-wip-us.apache.org/repos/asf/ignite/blob/b8d435b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusMetaIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusMetaIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusMetaIO.java
index 5925547..8850863 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusMetaIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusMetaIO.java
@@ -104,7 +104,7 @@ public class BPlusMetaIO extends PageIO {
      * @param pageId Page ID.
      */
     private void setFirstPageId(long pageAddr, int lvl, long pageId) {
-        assert lvl >= 0 && lvl < getLevelsCount(pageAddr);
+        assert lvl >= 0 && lvl < getLevelsCount(pageAddr) : lvl;
 
         PageUtils.putLong(pageAddr, offset(lvl), pageId);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b8d435b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
index fa6910d..f3952ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
@@ -391,7 +391,8 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
                     if (sharedCtx.pageStore() != null)
                         sharedCtx.pageStore().onDeActivate(ctx);
 
-                    sharedCtx.wal().onDeActivate(ctx);
+                    if (sharedCtx.wal() != null)
+                        sharedCtx.wal().onDeActivate(ctx);
                 }
             }
             catch (Exception e) {
@@ -443,7 +444,8 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
                 if (sharedCtx.pageStore() != null)
                     sharedCtx.pageStore().onActivate(ctx);
 
-                sharedCtx.wal().onActivate(ctx);
+                if (sharedCtx.wal() != null)
+                    sharedCtx.wal().onActivate(ctx);
 
                 sharedCtx.database().initDataBase();
 
@@ -576,7 +578,8 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
                 if (sharedCtx.pageStore() != null)
                     sharedCtx.pageStore().onDeActivate(ctx);
 
-                sharedCtx.wal().onDeActivate(ctx);
+                if (sharedCtx.wal() != null)
+                    sharedCtx.wal().onDeActivate(ctx);
 
                 sharedCtx.affinity().removeAllCacheInfo();
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/b8d435b6/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
index 928c86d..a2f1bdf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
@@ -1229,7 +1229,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
 
             PageIO.registerTest(latestInnerIO(), latestLeafIO());
 
-            initNew();
+            initTree(true);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b8d435b6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
index 5c60b16..19e05ed 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
@@ -63,8 +63,7 @@ public abstract class H2Tree extends BPlusTree<SearchRow, GridH2Row>
{
 
         this.rowStore = rowStore;
 
-        if (initNew)
-            initNew();
+        initTree(initNew);
     }
 
     /**


Mime
View raw message