modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/tree/BplusTree.java [1434:1477]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            long nextPage = acquirePage(nextPageId);

                            try {
                                long nextPageAddr = readLock(nextPageId, nextPage);

                                // In the current implementation the next page can't change when the current page is locked.
                                assert nextPageAddr != 0 : nextPageAddr;

                                try {
                                    long pa = curPageAddr;
                                    curPageAddr = 0; // Set to zero to avoid double unlocking in finalizer.

                                    readUnlock(curPageId, curPage, pa);

                                    long p = curPage;
                                    curPage = 0; // Set to zero to avoid double release in finalizer.

                                    releasePage(curPageId, p);

                                    curPageId = nextPageId;
                                    curPage = nextPage;
                                    curPageAddr = nextPageAddr;

                                    nextPage = 0;
                                    nextPageAddr = 0;
                                } finally {
                                    if (nextPageAddr != 0) {
                                        readUnlock(nextPageId, nextPage, nextPageAddr);
                                    }
                                }
                            } finally {
                                if (nextPage != 0) {
                                    releasePage(nextPageId, nextPage);
                                }
                            }
                        }
                    } finally {
                        if (curPageAddr != 0) {
                            readUnlock(curPageId, curPage, curPageAddr);
                        }
                    }
                } finally {
                    if (curPage != 0) {
                        releasePage(curPageId, curPage);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/tree/BplusTree.java [2528:2571]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        long nextPage = acquirePage(nextPageId);

                        try {
                            long nextPageAddr = readLock(nextPageId, nextPage);

                            // In the current implementation the next page can't change when the current page is locked.
                            assert nextPageAddr != 0 : nextPageAddr;

                            try {
                                long pa = curPageAddr;
                                curPageAddr = 0; // Set to zero to avoid double unlocking in finalizer.

                                readUnlock(curPageId, curPage, pa);

                                long p = curPage;
                                curPage = 0; // Set to zero to avoid double release in finalizer.

                                releasePage(curPageId, p);

                                curPageId = nextPageId;
                                curPage = nextPage;
                                curPageAddr = nextPageAddr;

                                nextPage = 0;
                                nextPageAddr = 0;
                            } finally {
                                if (nextPageAddr != 0) {
                                    readUnlock(nextPageId, nextPage, nextPageAddr);
                                }
                            }
                        } finally {
                            if (nextPage != 0) {
                                releasePage(nextPageId, nextPage);
                            }
                        }
                    }
                } finally {
                    if (curPageAddr != 0) {
                        readUnlock(curPageId, curPage, curPageAddr);
                    }
                }
            } finally {
                if (curPage != 0) {
                    releasePage(curPageId, curPage);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



