This is an automated email from the ASF dual-hosted git repository.
av pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new a688b1d415b IGNITE-20465 *.mvccEnabled() removal (#10945)
a688b1d415b is described below
commit a688b1d415bde8b45ad82793ec3ed9bb7d142411
Author: Anton Vinogradov <[email protected]>
AuthorDate: Mon Sep 25 13:58:58 2023 +0300
IGNITE-20465 *.mvccEnabled() removal (#10945)
---
.../jdbc/thin/JdbcThinConnectionSelfTest.java | 45 ----
.../query/index/sorted/inline/InlineIndexTree.java | 2 +-
.../processors/cache/CacheGroupContext.java | 7 -
.../cache/IgniteCacheOffheapManager.java | 23 --
.../cache/IgniteCacheOffheapManagerImpl.java | 232 ++-------------------
.../dht/preloader/GridDhtPartitionDemander.java | 9 +-
.../dht/preloader/GridDhtPartitionSupplier.java | 41 +---
.../preloader/GridDhtPartitionsExchangeFuture.java | 9 +-
.../dht/preloader/GridDhtPreloader.java | 4 -
.../dht/topology/GridDhtPartitionTopologyImpl.java | 4 +-
.../topology/GridDhtPartitionsStateValidator.java | 7 +-
.../processors/cache/mvcc/MvccProcessor.java | 6 -
.../processors/cache/mvcc/MvccProcessorImpl.java | 31 +--
.../internal/processors/cache/mvcc/MvccUtils.java | 8 -
.../cache/persistence/GridCacheOffheapManager.java | 17 +-
.../cache/transactions/IgniteTxHandler.java | 2 +-
.../IgniteTxImplicitSingleStateImpl.java | 5 -
.../cache/transactions/IgniteTxManager.java | 56 -----
.../transactions/IgniteTxRemoteStateAdapter.java | 5 -
.../cache/transactions/IgniteTxStateImpl.java | 5 -
.../processors/cache/tree/CacheDataTree.java | 46 +---
.../internal/processors/cache/tree/PendingRow.java | 3 +-
.../processors/odbc/jdbc/JdbcRequestHandler.java | 24 +--
.../processors/odbc/odbc/OdbcRequestHandler.java | 25 +--
.../distributed/GridExchangeFreeSwitchTest.java | 17 +-
.../wal/memtracker/PageMemoryTracker.java | 21 --
.../processors/query/h2/CommandProcessor.java | 110 ----------
.../processors/query/h2/GridCacheTwoStepQuery.java | 7 -
.../processors/query/h2/IgniteH2Indexing.java | 43 +---
.../processors/query/h2/QueryParserResultDml.java | 7 -
.../query/h2/QueryParserResultSelect.java | 7 -
.../query/h2/twostep/GridReduceQueryExecutor.java | 14 --
.../index/SqlTransactionCommandsSelfTest.java | 70 -------
.../IgniteBinaryCacheQueryTestSuite3.java | 3 -
34 files changed, 46 insertions(+), 869 deletions(-)
diff --git
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
index 917ac650e28..17c871b0970 100644
---
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
+++
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
@@ -74,7 +74,6 @@ import static java.sql.Statement.NO_GENERATED_KEYS;
import static java.sql.Statement.RETURN_GENERATED_KEYS;
import static org.apache.ignite.cache.query.SqlFieldsQuery.DFLT_LAZY;
import static
org.apache.ignite.configuration.ClientConnectorConfiguration.DFLT_PORT;
-import static
org.apache.ignite.internal.processors.odbc.SqlStateCode.TRANSACTION_STATE_EXCEPTION;
import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
import static
org.apache.ignite.testframework.GridTestUtils.assertThrowsAnyCause;
import static org.apache.ignite.testframework.GridTestUtils.getFieldValue;
@@ -1290,50 +1289,6 @@ public class JdbcThinConnectionSelfTest extends
JdbcThinAbstractSelfTest {
}
}
- /**
- * @throws Exception if failed.
- */
- @Test
- public void testBeginFails() throws Exception {
- try (Connection conn =
DriverManager.getConnection(urlWithPartitionAwarenessProp)) {
- conn.createStatement().execute("BEGIN");
-
- fail("Exception is expected");
- }
- catch (SQLException e) {
- assertEquals(TRANSACTION_STATE_EXCEPTION, e.getSQLState());
- }
- }
-
- /**
- * @throws Exception if failed.
- */
- @Test
- public void testCommitIgnored() throws Exception {
- try (Connection conn =
DriverManager.getConnection(urlWithPartitionAwarenessProp)) {
- conn.setAutoCommit(false);
- conn.createStatement().execute("COMMIT");
-
- conn.commit();
- }
- // assert no exception
- }
-
- /**
- * @throws Exception if failed.
- */
- @Test
- public void testRollbackIgnored() throws Exception {
- try (Connection conn =
DriverManager.getConnection(urlWithPartitionAwarenessProp)) {
- conn.setAutoCommit(false);
-
- conn.createStatement().execute("ROLLBACK");
-
- conn.rollback();
- }
- // assert no exception
- }
-
/**
* @throws Exception If failed.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/inline/InlineIndexTree.java
b/modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/inline/InlineIndexTree.java
index 928284a174c..79e863c9dd4 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/inline/InlineIndexTree.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/inline/InlineIndexTree.java
@@ -154,7 +154,7 @@ public class InlineIndexTree extends BPlusTree<IndexRow,
IndexRow> {
this.idxRowCache = idxRowCache;
- mvccEnabled = grpCtx.mvccEnabled();
+ mvccEnabled = false;
if (!initNew) {
// Init from metastore.
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
index 64f5d9bbdd6..99bed931a28 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
@@ -287,13 +287,6 @@ public class CacheGroupContext {
topValidators =
Collections.unmodifiableCollection(topologyValidators(ccfg,
ctx.kernalContext().plugins()));
}
- /**
- * @return Mvcc flag.
- */
- public boolean mvccEnabled() {
- return mvccEnabled;
- }
-
/**
* @return {@code True} if this is cache group for one of system caches.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
index d88788bdccd..81a9787f9e8 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
@@ -51,7 +51,6 @@ import org.apache.ignite.internal.util.lang.GridCursor;
import org.apache.ignite.internal.util.lang.GridIterator;
import org.apache.ignite.internal.util.lang.IgniteInClosure2X;
import org.apache.ignite.internal.util.lang.IgnitePredicateX;
-import org.apache.ignite.lang.IgniteBiTuple;
import org.jetbrains.annotations.Nullable;
/**
@@ -198,17 +197,6 @@ public interface IgniteCacheOffheapManager {
@Nullable public CacheDataRow mvccRead(GridCacheContext cctx,
KeyCacheObject key, MvccSnapshot mvccSnapshot)
throws IgniteCheckedException;
- /**
- * For testing only.
- *
- * @param cctx Cache context.
- * @param key Key.
- * @return All stored versions for given key.
- * @throws IgniteCheckedException If failed.
- */
- public List<IgniteBiTuple<Object, MvccVersion>>
mvccAllVersions(GridCacheContext cctx, KeyCacheObject key)
- throws IgniteCheckedException;
-
/**
* Returns iterator over the all row versions for the given key.
*
@@ -983,17 +971,6 @@ public interface IgniteCacheOffheapManager {
public CacheDataRow mvccFind(GridCacheContext cctx, KeyCacheObject
key, MvccSnapshot snapshot)
throws IgniteCheckedException;
- /**
- * For testing only.
- *
- * @param cctx Cache context.
- * @param key Key.
- * @return All stored versions for given key.
- * @throws IgniteCheckedException If failed.
- */
- List<IgniteBiTuple<Object, MvccVersion>>
mvccFindAllVersions(GridCacheContext cctx, KeyCacheObject key)
- throws IgniteCheckedException;
-
/**
* @return Data cursor.
* @throws IgniteCheckedException If failed.
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 e785cf50c90..1100e06ab09 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
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -46,7 +45,6 @@ import org.apache.ignite.internal.metric.IoStatisticsHolder;
import org.apache.ignite.internal.pagemem.FullPageId;
import org.apache.ignite.internal.pagemem.PageMemory;
import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
-import
org.apache.ignite.internal.pagemem.wal.record.delta.DataPageMvccMarkUpdatedRecord;
import
org.apache.ignite.internal.pagemem.wal.record.delta.DataPageMvccUpdateNewTxStateHintRecord;
import
org.apache.ignite.internal.pagemem.wal.record.delta.DataPageMvccUpdateTxStateHintRecord;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
@@ -89,7 +87,6 @@ import
org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccUpdateData
import
org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccUpdateResult;
import org.apache.ignite.internal.processors.cache.tree.mvcc.data.ResultType;
import
org.apache.ignite.internal.processors.cache.tree.mvcc.search.MvccDataPageClosure;
-import
org.apache.ignite.internal.processors.cache.tree.mvcc.search.MvccFirstRowTreeClosure;
import
org.apache.ignite.internal.processors.cache.tree.mvcc.search.MvccLinkAwareSearchRow;
import
org.apache.ignite.internal.processors.cache.tree.mvcc.search.MvccMaxSearchRow;
import
org.apache.ignite.internal.processors.cache.tree.mvcc.search.MvccMinSearchRow;
@@ -118,24 +115,18 @@ import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteBiTuple;
import org.apache.ignite.lang.IgnitePredicate;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+
import static java.lang.Boolean.TRUE;
import static org.apache.ignite.internal.pagemem.PageIdAllocator.FLAG_IDX;
import static
org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
import static
org.apache.ignite.internal.processors.cache.GridCacheUtils.TTL_ETERNAL;
import static
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.OWNING;
import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.INITIAL_VERSION;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_COUNTER_NA;
import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_CRD_COUNTER_NA;
import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_HINTS_BIT_OFF;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_KEY_ABSENT_BEFORE_OFF;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_OP_COUNTER_MASK;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_OP_COUNTER_NA;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.compare;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.compareNewVersion;
import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.isVisible;
import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.mvccVersionIsValid;
import static org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.state;
@@ -643,15 +634,6 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
return row;
}
- /** {@inheritDoc} */
- @Override public List<IgniteBiTuple<Object, MvccVersion>>
mvccAllVersions(GridCacheContext cctx, KeyCacheObject key)
- throws IgniteCheckedException {
- CacheDataStore dataStore = dataStore(cctx, key);
-
- return dataStore != null ? dataStore.mvccFindAllVersions(cctx, key) :
- Collections.emptyList();
- }
-
/** {@inheritDoc} */
@Override public GridCursor<CacheDataRow>
mvccAllVersionsCursor(GridCacheContext cctx,
KeyCacheObject key, Object x) throws IgniteCheckedException {
@@ -1467,9 +1449,9 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
this.busyLock = busyLock;
this.log = log;
- PartitionUpdateCounter delegate = grp.mvccEnabled() ? new
PartitionUpdateCounterMvccImpl(grp) :
- !grp.persistenceEnabled() || grp.hasAtomicCaches() ? new
PartitionUpdateCounterVolatileImpl(grp) :
- new PartitionUpdateCounterTrackingImpl(grp);
+ PartitionUpdateCounter delegate = !grp.persistenceEnabled() ||
grp.hasAtomicCaches() ?
+ new PartitionUpdateCounterVolatileImpl(grp) :
+ new PartitionUpdateCounterTrackingImpl(grp);
pCntr =
grp.shared().logger(PartitionUpdateCounterDebugWrapper.class).isDebugEnabled() ?
new PartitionUpdateCounterDebugWrapper(partId, delegate) : new
PartitionUpdateCounterErrorWrapper(partId, delegate);
@@ -1547,18 +1529,7 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
* @return {@code True} if there are no items in the store.
*/
@Override public boolean isEmpty() {
- try {
- /*
- * TODO https://issues.apache.org/jira/browse/IGNITE-10082
- * Using of counters is cheaper than tree operations. Return
size checking after the ticked is resolved.
- */
- return grp.mvccEnabled() ? dataTree.isEmpty() :
storageSize.sum() == 0;
- }
- catch (IgniteCheckedException e) {
-
U.error(grp.shared().logger(IgniteCacheOffheapManagerImpl.class), "Failed to
perform operation.", e);
-
- return false;
- }
+ return storageSize.sum() == 0;
}
/** {@inheritDoc} */
@@ -1662,7 +1633,7 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
*/
private boolean canUpdateOldRow(GridCacheContext cctx, @Nullable
CacheDataRow oldRow, DataRow dataRow)
throws IgniteCheckedException {
- if (oldRow == null || cctx.queries().enabled() ||
grp.mvccEnabled())
+ if (oldRow == null || cctx.queries().enabled())
return false;
if (oldRow.expireTime() != dataRow.expireTime())
@@ -2468,14 +2439,7 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
/** {@inheritDoc} */
@Override public void updateTxState(GridCacheContext cctx,
CacheSearchRow row)
throws IgniteCheckedException {
- assert grp.mvccEnabled();
- assert mvccVersionIsValid(row.mvccCoordinatorVersion(),
row.mvccCounter(), row.mvccOperationCounter()) : row;
-
- // Need an extra lookup because the row may be already cleaned by
another thread.
- CacheDataRow row0 = dataTree.findOne(row,
CacheDataRowAdapter.RowData.LINK_ONLY);
-
- if (row0 != null)
- rowStore.updateDataRow(row0.link(), mvccUpdateTxStateHint,
null, grp.statisticsHolderData());
+ assert false; // ex mvcc code.
}
/** {@inheritDoc} */
@@ -2755,67 +2719,13 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
int cacheId = grp.sharedGroup() ? cctx.cacheId() :
CU.UNDEFINED_CACHE_ID;
- CacheDataRow row;
-
- if (grp.mvccEnabled()) {
- MvccFirstRowTreeClosure clo = new
MvccFirstRowTreeClosure(cctx);
-
- dataTree.iterate(
- new MvccMaxSearchRow(cacheId, key),
- new MvccMinSearchRow(cacheId, key),
- clo
- );
-
- row = clo.row();
- }
- else
- row = dataTree.findOne(new SearchRow(cacheId, key),
CacheDataRowAdapter.RowData.NO_KEY);
+ CacheDataRow row = dataTree.findOne(new SearchRow(cacheId, key),
CacheDataRowAdapter.RowData.NO_KEY);
afterRowFound(row, key);
return row;
}
- /** {@inheritDoc} */
- @Override public List<IgniteBiTuple<Object, MvccVersion>>
mvccFindAllVersions(
- GridCacheContext cctx,
- KeyCacheObject key
- ) throws IgniteCheckedException {
- assert grp.mvccEnabled();
-
- // Note: this method is intended for testing only.
-
- key.valueBytes(cctx.cacheObjectContext());
-
- int cacheId = grp.sharedGroup() ? cctx.cacheId() :
CU.UNDEFINED_CACHE_ID;
-
- GridCursor<CacheDataRow> cur = dataTree.find(
- new MvccMaxSearchRow(cacheId, key),
- new MvccMinSearchRow(cacheId, key)
- );
-
- List<IgniteBiTuple<Object, MvccVersion>> res = new ArrayList<>();
-
- long crd = MVCC_CRD_COUNTER_NA;
- long cntr = MVCC_COUNTER_NA;
- int opCntr = MVCC_OP_COUNTER_NA;
-
- while (cur.next()) {
- CacheDataRow row = cur.get();
-
- if (compareNewVersion(row, crd, cntr, opCntr) != 0) // deleted
row
- res.add(F.t(null, row.newMvccVersion()));
-
- res.add(F.t(row.value(), row.mvccVersion()));
-
- crd = row.mvccCoordinatorVersion();
- cntr = row.mvccCounter();
- opCntr = row.mvccOperationCounter();
- }
-
- return res;
- }
-
/** {@inheritDoc} */
@Override public GridCursor<CacheDataRow> mvccAllVersionsCursor(
GridCacheContext cctx, KeyCacheObject key, Object x
@@ -2880,17 +2790,7 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
@Override public GridCursor<? extends CacheDataRow>
cursor(MvccSnapshot mvccSnapshot)
throws IgniteCheckedException {
- GridCursor<? extends CacheDataRow> cursor;
- if (mvccSnapshot != null) {
- assert grp.mvccEnabled();
-
- cursor = dataTree.find(null, null,
- new
MvccFirstVisibleRowTreeClosure(grp.singleCacheContext(), mvccSnapshot), null);
- }
- else
- cursor = dataTree.find(null, null);
-
- return cursor;
+ return dataTree.find(null, null);
}
/** {@inheritDoc} */
@@ -2933,19 +2833,7 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
upperRow = upper != null ? new
SearchRow(CU.UNDEFINED_CACHE_ID, upper) : null;
}
- GridCursor<? extends CacheDataRow> cursor;
-
- if (snapshot != null) {
- assert grp.mvccEnabled();
-
- GridCacheContext cctx = grp.sharedGroup() ?
grp.shared().cacheContext(cacheId) : grp.singleCacheContext();
-
- cursor = dataTree.find(lowerRow, upperRow, new
MvccFirstVisibleRowTreeClosure(cctx, snapshot), x);
- }
- else
- cursor = dataTree.find(lowerRow, upperRow, x);
-
- return cursor;
+ return dataTree.find(lowerRow, upperRow, x);
}
/** {@inheritDoc} */
@@ -3266,43 +3154,16 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
* Mvcc remove handler.
*/
private static final class MvccMarkUpdatedHandler extends
PageHandler<MvccUpdateDataRow, Boolean> {
- /** */
- private final CacheGroupContext grp;
-
/** */
private MvccMarkUpdatedHandler(CacheGroupContext grp) {
- this.grp = grp;
}
/** {@inheritDoc} */
@Override public Boolean run(int cacheId, long pageId, long page, long
pageAddr, PageIO io, Boolean walPlc,
MvccUpdateDataRow updateDataRow, int itemId, IoStatisticsHolder
statHolder) throws IgniteCheckedException {
- assert grp.mvccEnabled();
-
- PageMemory pageMem = grp.dataRegion().pageMemory();
- IgniteWriteAheadLogManager wal = grp.shared().wal();
-
- DataPageIO iox = (DataPageIO)io;
-
- int off = iox.getPayloadOffset(pageAddr, itemId,
- pageMem.realPageSize(grp.groupId()), MVCC_INFO_SIZE);
+ assert false; // ex mvcc code.
- long newCrd = iox.newMvccCoordinator(pageAddr, off);
- long newCntr = iox.newMvccCounter(pageAddr, off);
- int newOpCntr = iox.rawNewMvccOperationCounter(pageAddr, off);
-
- assert newCrd == MVCC_CRD_COUNTER_NA || state(grp, newCrd,
newCntr, newOpCntr) == TxState.ABORTED;
-
- int keyAbsentBeforeFlag = updateDataRow.isKeyAbsentBefore() ? (1
<< MVCC_KEY_ABSENT_BEFORE_OFF) : 0;
-
- iox.updateNewVersion(pageAddr, off,
updateDataRow.mvccCoordinatorVersion(), updateDataRow.mvccCounter(),
- updateDataRow.mvccOperationCounter() | keyAbsentBeforeFlag,
TxState.NA);
-
- if (isWalDeltaRecordNeeded(pageMem, cacheId, pageId, page, wal,
walPlc))
- wal.log(new DataPageMvccMarkUpdatedRecord(cacheId, pageId,
itemId,
- updateDataRow.mvccCoordinatorVersion(),
updateDataRow.mvccCounter(), updateDataRow.mvccOperationCounter()));
-
- return TRUE;
+ return false;
}
}
@@ -3374,81 +3235,16 @@ public class IgniteCacheOffheapManagerImpl implements
IgniteCacheOffheapManager
* Applies changes to the row.
*/
private static final class MvccApplyChangesHandler extends
PageHandler<MvccDataRow, Boolean> {
- /** */
- private final CacheGroupContext grp;
-
/** */
private MvccApplyChangesHandler(CacheGroupContext grp) {
- this.grp = grp;
}
/** {@inheritDoc} */
@Override public Boolean run(int cacheId, long pageId, long page, long
pageAddr, PageIO io, Boolean walPlc,
MvccDataRow newRow, int itemId, IoStatisticsHolder statHolder)
throws IgniteCheckedException {
- assert grp.mvccEnabled();
+ assert false; // ex mvcc code.
- DataPageIO iox = (DataPageIO)io;
-
- PageMemory pageMem = grp.dataRegion().pageMemory();
- IgniteWriteAheadLogManager wal = grp.shared().wal();
-
- int off = iox.getPayloadOffset(pageAddr, itemId,
- pageMem.realPageSize(grp.groupId()), MVCC_INFO_SIZE);
-
- long crd = iox.mvccCoordinator(pageAddr, off);
- long cntr = iox.mvccCounter(pageAddr, off);
- int opCntrAndHint = iox.rawMvccOperationCounter(pageAddr, off);
- int opCntr = opCntrAndHint & MVCC_OP_COUNTER_MASK;
- byte txState = (byte)(opCntrAndHint >>> MVCC_HINTS_BIT_OFF);
-
- long newCrd = iox.newMvccCoordinator(pageAddr, off);
- long newCntr = iox.newMvccCounter(pageAddr, off);
- int newOpCntrAndHint = iox.rawNewMvccOperationCounter(pageAddr,
off);
- int newOpCntr = newOpCntrAndHint & MVCC_OP_COUNTER_MASK;
- byte newTxState = (byte)(newOpCntrAndHint >>> MVCC_HINTS_BIT_OFF);
-
- assert crd == newRow.mvccCoordinatorVersion();
- assert cntr == newRow.mvccCounter();
- assert opCntr == newRow.mvccOperationCounter();
-
- assert newRow.mvccTxState() != TxState.NA : newRow.mvccTxState();
-
- if (txState != newRow.mvccTxState() && newRow.mvccTxState() !=
TxState.NA) {
- assert txState == TxState.NA : txState;
-
- iox.rawMvccOperationCounter(pageAddr, off, opCntr |
(newRow.mvccTxState() << MVCC_HINTS_BIT_OFF));
-
- if (isWalDeltaRecordNeeded(pageMem, cacheId, pageId, page,
wal, walPlc))
- wal.log(new DataPageMvccUpdateTxStateHintRecord(cacheId,
pageId, itemId, newRow.mvccTxState()));
- }
-
- if (compare(newCrd,
- newCntr,
- newOpCntr,
- newRow.newMvccCoordinatorVersion(),
- newRow.newMvccCounter(),
- newRow.newMvccOperationCounter()) != 0) {
-
- assert newRow.newMvccTxState() == TxState.NA ||
newRow.newMvccCoordinatorVersion() != MVCC_CRD_COUNTER_NA;
-
- iox.updateNewVersion(pageAddr, off,
newRow.newMvccCoordinatorVersion(), newRow.newMvccCounter(),
- newRow.newMvccOperationCounter(), newRow.newMvccTxState());
-
- if (isWalDeltaRecordNeeded(pageMem, cacheId, pageId, page,
wal, walPlc))
- wal.log(new DataPageMvccMarkUpdatedRecord(cacheId, pageId,
itemId,
- newRow.newMvccCoordinatorVersion(),
newRow.newMvccCounter(),
- newRow.newMvccOperationCounter() |
(newRow.newMvccTxState() << MVCC_HINTS_BIT_OFF)));
- }
- else if (newTxState != newRow.newMvccTxState() &&
newRow.newMvccTxState() != TxState.NA) {
- assert newTxState == TxState.NA : newTxState;
-
- iox.rawNewMvccOperationCounter(pageAddr, off, newOpCntr |
(newRow.newMvccTxState() << MVCC_HINTS_BIT_OFF));
-
- if (isWalDeltaRecordNeeded(pageMem, cacheId, pageId, page,
wal, walPlc))
- wal.log(new
DataPageMvccUpdateNewTxStateHintRecord(cacheId, pageId, itemId,
newRow.newMvccTxState()));
- }
-
- return TRUE;
+ return false;
}
}
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index 4b807222185..fd68fec7f81 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -637,13 +637,9 @@ public class GridDhtPartitionDemander {
);
try {
- if (grp.mvccEnabled())
- mvccPreloadEntries(topVer, node, p,
infosWrap);
- else {
- preloadEntries(topVer, part,
infosWrap);
+ preloadEntries(topVer, part, infosWrap);
- rebalanceFut.onReceivedKeys(p,
e.getValue().infos().size(), node);
- }
+ rebalanceFut.onReceivedKeys(p,
e.getValue().infos().size(), node);
}
catch (GridDhtInvalidPartitionException
ignored) {
if (log.isDebugEnabled())
@@ -896,7 +892,6 @@ public class GridDhtPartitionDemander {
* @throws IgniteInterruptedCheckedException If interrupted.
*/
private boolean preloadEntry(CacheDataRow row, AffinityTopologyVersion
topVer) throws IgniteCheckedException {
- assert !grp.mvccEnabled();
assert ctx.database().checkpointLockIsHeldByThread();
GridCacheContext<?, ?> cctx = grp.sharedGroup() ?
ctx.cacheContext(row.cacheId()) : grp.singleCacheContext();
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
index 0cdcb8a61f7..9c21b3b1096 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
@@ -38,15 +38,10 @@ import
org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
-import org.apache.ignite.internal.processors.cache.GridCacheMvccEntryInfo;
import org.apache.ignite.internal.processors.cache.IgniteRebalanceIterator;
import
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtLocalPartition;
import
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState;
import
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopology;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccUpdateVersionAware;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccUtils;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccVersionAware;
-import org.apache.ignite.internal.processors.cache.mvcc.txlog.TxState;
import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.F;
@@ -324,17 +319,8 @@ public class GridDhtPartitionSupplier {
long batchesCnt = 0;
- CacheDataRow prevRow = null;
-
while (iter.hasNext()) {
- CacheDataRow row = iter.peek();
-
- // Prevent mvcc entry history splitting into separate batches.
- boolean canFlushHistory = !grp.mvccEnabled() ||
- prevRow != null && ((grp.sharedGroup() && row.cacheId() !=
prevRow.cacheId()) ||
- !row.key().equals(prevRow.key()));
-
- if (canFlushHistory && supplyMsg.messageSize() >= msgMaxSize) {
+ if (supplyMsg.messageSize() >= msgMaxSize) {
if (++batchesCnt >= maxBatchesCnt) {
saveSupplyContext(contextId,
iter,
@@ -357,9 +343,7 @@ public class GridDhtPartitionSupplier {
}
}
- row = iter.next();
-
- prevRow = row;
+ CacheDataRow row = iter.next();
int part = row.partition();
@@ -542,29 +526,10 @@ public class GridDhtPartitionSupplier {
* @return Entry info.
*/
private GridCacheEntryInfo extractEntryInfo(CacheDataRow row) {
- GridCacheEntryInfo info = grp.mvccEnabled() ?
- new GridCacheMvccEntryInfo() : new GridCacheEntryInfo();
+ GridCacheEntryInfo info = new GridCacheEntryInfo();
info.key(row.key());
info.cacheId(row.cacheId());
-
- if (grp.mvccEnabled()) {
- assert row.mvccCoordinatorVersion() !=
MvccUtils.MVCC_CRD_COUNTER_NA;
-
- // Rows from rebalance iterator have actual states already.
- if (row.mvccTxState() != TxState.COMMITTED)
- return null;
-
- ((MvccVersionAware)info).mvccVersion(row);
- ((GridCacheMvccEntryInfo)info).mvccTxState(TxState.COMMITTED);
-
- if (row.newMvccCoordinatorVersion() !=
MvccUtils.MVCC_CRD_COUNTER_NA &&
- row.newMvccTxState() == TxState.COMMITTED) {
- ((MvccUpdateVersionAware)info).newMvccVersion(row);
-
((GridCacheMvccEntryInfo)info).newMvccTxState(TxState.COMMITTED);
- }
- }
-
info.value(row.value());
info.version(row.version());
info.expireTime(row.expireTime());
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index eaf90a36127..81687c24150 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1643,13 +1643,8 @@ public class GridDhtPartitionsExchangeFuture extends
GridDhtTopologyFutureAdapte
boolean skipWaitOnLocalJoin = localJoinExchange()
&& cctx.exchange().latch().canSkipJoiningNodes(initialVersion());
- if (context().exchangeFreeSwitch() && isBaselineNodeFailed()) {
- // Currently MVCC does not support operations on partially
switched cluster.
- if (cctx.kernalContext().coordinators().mvccEnabled())
- waitPartitionRelease(EXCHANGE_FREE_LATCH_ID, true, false);
- else
- waitPartitionRelease(null, false, false);
- }
+ if (context().exchangeFreeSwitch() && isBaselineNodeFailed())
+ waitPartitionRelease(null, false, false);
else if (!skipWaitOnLocalJoin) { // Skip partition release if node has
locally joined (it doesn't have any updates to be finished).
boolean distributed = true;
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 9823d03885a..a22f7a764d3 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -446,10 +446,6 @@ public class GridDhtPreloader extends
GridCachePreloaderAdapter {
/** {@inheritDoc} */
@Override public boolean needForceKeys() {
- // Do not use force key request with enabled MVCC.
- if (grp.mvccEnabled())
- return false;
-
if (grp.rebalanceEnabled()) {
IgniteInternalFuture<Boolean> rebalanceFut = rebalanceFuture();
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
index 818cf7eef0e..a39212117ae 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
@@ -2894,9 +2894,7 @@ public class GridDhtPartitionTopologyImpl implements
GridDhtPartitionTopology {
long gapStart = gaps.get(j * 2);
long gapStop = gaps.get(j * 2 + 1);
- if (part.group().persistenceEnabled() &&
- part.group().walEnabled() &&
- !part.group().mvccEnabled()) {
+ if (part.group().persistenceEnabled() &&
part.group().walEnabled()) {
// Rollback record tracks applied
out-of-order updates while finalizeUpdateCounters
// return gaps (missing updates). The code
below transforms gaps to updates.
RollbackRecord rec = new
RollbackRecord(part.group().groupId(), part.id(),
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
index d1dd063aa26..8dafc6d67d5 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionsStateValidator.java
@@ -26,7 +26,6 @@ import java.util.NavigableMap;
import java.util.Set;
import java.util.TreeMap;
import java.util.UUID;
-
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.events.DiscoveryEvent;
@@ -99,10 +98,8 @@ public class GridDhtPartitionsStateValidator {
ignoringNodes.add(id);
}
- if (!cctx.cache().cacheGroup(top.groupId()).mvccEnabled()) { // TODO:
Remove "if" clause in IGNITE-9451.
- // Validate cache sizes.
- resSize = validatePartitionsSizes(top, messages, ignoringNodes);
- }
+ // Validate cache sizes.
+ resSize = validatePartitionsSizes(top, messages, ignoringNodes);
AffinityTopologyVersion topVer =
fut.context().events().topologyVersion();
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessor.java
index f41d61579e0..010d86b7adb 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessor.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessor.java
@@ -194,12 +194,6 @@ public interface MvccProcessor extends GridProcessor {
*/
void ackTxRollback(MvccVersion updateVer);
- /**
- * @return {@code True} if at least one cache with
- * {@code CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT} mode is registered.
- */
- boolean mvccEnabled();
-
/**
* Pre-processes cache configuration before start.
*
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessorImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessorImpl.java
index b192559d215..6ebcca49ed2 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessorImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccProcessorImpl.java
@@ -57,7 +57,6 @@ import
org.apache.ignite.internal.managers.discovery.DiscoCache;
import org.apache.ignite.internal.managers.eventstorage.DiscoveryEventListener;
import org.apache.ignite.internal.processors.GridProcessorAdapter;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
import org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
@@ -267,11 +266,6 @@ public class MvccProcessorImpl extends
GridProcessorAdapter implements MvccProce
ctx.discovery().setCustomEventListener(DynamicCacheChangeBatch.class,
customLsnr);
}
- /** {@inheritDoc} */
- @Override public boolean mvccEnabled() {
- return mvccEnabled;
- }
-
/** {@inheritDoc} */
@Override public void preProcessCacheConfiguration(CacheConfiguration
ccfg) {
if (ccfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT) {
@@ -1183,12 +1177,8 @@ public class MvccProcessorImpl extends
GridProcessorAdapter implements MvccProce
cleanupQueue = null;
}
- if (workers == null) {
- if (log.isDebugEnabled() && mvccEnabled())
- log.debug("Attempting to stop inactive vacuum.");
-
+ if (workers == null)
return;
- }
assert queue != null;
@@ -1289,25 +1279,6 @@ public class MvccProcessorImpl extends
GridProcessorAdapter implements MvccProce
}
};
- for (CacheGroupContext grp :
ctx.cache().cacheGroups()) {
- if (grp.mvccEnabled()) {
- grp.topology().readLock();
-
- try {
- for (GridDhtLocalPartition part :
grp.topology().localPartitions()) {
- VacuumTask task = new
VacuumTask(snapshot, part);
-
- cleanupQueue.offer(task);
-
- res0.add(task);
- }
- }
- finally {
- grp.topology().readUnlock();
- }
- }
- }
-
res0.markInitialized();
res0.listen(() -> {
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java
index 29ca654c5d2..c9e75da2654 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java
@@ -742,14 +742,6 @@ public class MvccUtils {
return tx;
}
- /**
- * @param ctx Grid kernal context.
- * @return Whether MVCC is enabled or not.
- */
- public static boolean mvccEnabled(GridKernalContext ctx) {
- return ctx.coordinators().mvccEnabled();
- }
-
/**
* Initialises MVCC filter and returns MVCC query tracker if needed.
* @param cctx Cache context.
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
index 43d69a62dbe..af8f92fb8a8 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
@@ -20,7 +20,6 @@ package
org.apache.ignite.internal.processors.cache.persistence;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -1058,9 +1057,6 @@ public class GridCacheOffheapManager extends
IgniteCacheOffheapManagerImpl imple
if (partCntrs == null || partCntrs.isEmpty())
return null;
- if (grp.mvccEnabled()) // TODO IGNITE-7384
- return super.historicalIterator(partCntrs, missing);
-
GridCacheDatabaseSharedManager database =
(GridCacheDatabaseSharedManager)grp.shared().database();
Map<Integer, Long> partsCounters = new HashMap<>();
@@ -1215,7 +1211,7 @@ public class GridCacheOffheapManager extends
IgniteCacheOffheapManagerImpl imple
grp.dataRegion().pageMemory(),
globalRemoveId(),
reuseListForIndex(name),
- grp.mvccEnabled()
+ false
);
indexStorage.dropIndex(name);
@@ -2714,17 +2710,6 @@ public class GridCacheOffheapManager extends
IgniteCacheOffheapManagerImpl imple
return null;
}
- /** {@inheritDoc} */
- @Override public List<IgniteBiTuple<Object, MvccVersion>>
mvccFindAllVersions(GridCacheContext cctx, KeyCacheObject key)
- throws IgniteCheckedException {
- CacheDataStore delegate = init0(true);
-
- if (delegate != null)
- return delegate.mvccFindAllVersions(cctx, key);
-
- return Collections.emptyList();
- }
-
/** {@inheritDoc} */
@Override public GridCursor<CacheDataRow>
mvccAllVersionsCursor(GridCacheContext cctx,
KeyCacheObject key, Object x) throws IgniteCheckedException {
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index e60dc5dcc37..f644c72e04a 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -2288,7 +2288,7 @@ public class IgniteTxHandler {
if (updated && rollback) {
CacheGroupContext grpCtx =
part.group();
- if (grpCtx.persistenceEnabled() &&
grpCtx.walEnabled() && !grpCtx.mvccEnabled()) {
+ if (grpCtx.persistenceEnabled() &&
grpCtx.walEnabled()) {
RollbackRecord rec =
new
RollbackRecord(grpCtx.groupId(), part.id(), start, delta);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
index 113f582c24c..63f2c6bca14 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxImplicitSingleStateImpl.java
@@ -316,11 +316,6 @@ public class IgniteTxImplicitSingleStateImpl extends
IgniteTxLocalStateAdapter {
return entry != null ? entry.get(0) : null;
}
- /** MVCC Enabled */
- public boolean mvccEnabled() {
- return false;
- }
-
/** {@inheritDoc} */
@Override public boolean useMvccCaching(int cacheId) {
assert cacheCtx == null || cacheCtx.cacheId() == cacheId;
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index cd1483f93d9..324e47525a5 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -90,7 +90,6 @@ import
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLock
import
org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture;
import
org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
import org.apache.ignite.internal.processors.cache.mvcc.MvccCoordinator;
-import
org.apache.ignite.internal.processors.cache.mvcc.msg.MvccRecoveryFinishedMessage;
import org.apache.ignite.internal.processors.cache.mvcc.txlog.TxState;
import org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer;
import
org.apache.ignite.internal.processors.cache.transactions.TxDeadlockDetection.TxDeadlockFuture;
@@ -137,7 +136,6 @@ import static
org.apache.ignite.events.EventType.EVT_NODE_FAILED;
import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.events.EventType.EVT_TX_STARTED;
-import static org.apache.ignite.internal.GridTopic.TOPIC_CACHE_COORDINATOR;
import static org.apache.ignite.internal.GridTopic.TOPIC_TX;
import static
org.apache.ignite.internal.managers.communication.GridIoPolicy.SYSTEM_POOL;
import static
org.apache.ignite.internal.processors.cache.GridCacheOperation.READ;
@@ -3224,10 +3222,6 @@ public class IgniteTxManager extends
GridCacheSharedManagerAdapter {
log.debug("Processing node failed event [locNodeId=" +
cctx.localNodeId() +
", failedNodeId=" + evtNodeId + ']');
- // Null means that recovery voting is not needed.
- GridCompoundFuture<IgniteInternalTx, Void> allTxFinFut =
isMvccRecoveryMessageRequired()
- ? new GridCompoundFuture<>() : null;
-
for (final IgniteInternalTx tx : activeTransactions()) {
if ((tx.near() && !tx.local() &&
tx.originatingNodeId().equals(evtNodeId))
|| (tx.storeWriteThrough() &&
tx.masterNodeIds().contains(evtNodeId))) {
@@ -3257,11 +3251,6 @@ public class IgniteTxManager extends
GridCacheSharedManagerAdapter {
tx.rollbackAsync();
}
}
-
- // Await only mvcc transactions initiated by failed
client node.
- if (allTxFinFut != null &&
tx.eventNodeId().equals(evtNodeId)
- && tx.mvccSnapshot() != null)
- allTxFinFut.add(tx.finishFuture());
}
}
@@ -3271,57 +3260,12 @@ public class IgniteTxManager extends
GridCacheSharedManagerAdapter {
if (log.isInfoEnabled() && preparedTxCnt.get() > 0)
doneFut.listen(this::finishAndRecordTimings);
-
- if (allTxFinFut == null)
- return;
-
- allTxFinFut.markInitialized();
-
- // Send vote to mvcc coordinator when all recovering
transactions have finished.
- allTxFinFut.listen(() -> {
- // If mvcc coordinator issued snapshot for recovering
transaction has failed during recovery,
- // then there is no need to send messages to new
coordinator.
- try {
- cctx.kernalContext().io().sendToGridTopic(
- mvccCrd.nodeId(),
- TOPIC_CACHE_COORDINATOR,
- new MvccRecoveryFinishedMessage(evtNodeId),
- SYSTEM_POOL);
- }
- catch (ClusterTopologyCheckedException e) {
- if (log.isInfoEnabled())
- log.info("Mvcc coordinator issued snapshots for
recovering transactions " +
- "has left the cluster (will ignore)
[locNodeId=" + cctx.localNodeId() +
- ", failedNodeId=" + evtNodeId +
- ", mvccCrdNodeId=" + mvccCrd.nodeId() +
']');
- }
- catch (IgniteCheckedException e) {
- log.warning("Failed to notify mvcc coordinator that
all recovering transactions were " +
- "finished [locNodeId=" + cctx.localNodeId() +
- ", failedNodeId=" + evtNodeId +
- ", mvccCrdNodeId=" + mvccCrd.nodeId() + ']', e);
- }
- });
}
finally {
cctx.kernalContext().gateway().readUnlock();
}
}
- /**
- * Determines need to send a recovery message or not.
- *
- * @return True if message required, false otherwise.
- */
- private boolean isMvccRecoveryMessageRequired() {
- ClusterNode mvccCrdNode = null;
-
- if (mvccCrd != null && mvccCrd.nodeId() != null)
- mvccCrdNode = cctx.node(mvccCrd.nodeId());
-
- return node.isClient() && mvccCrdNode != null &&
cctx.kernalContext().coordinators().mvccEnabled();
- }
-
/**
* @param tx Tx.
* @param failedNode Failed node.
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
index da8a8dcb824..d29da192ca1 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
@@ -130,11 +130,6 @@ public abstract class IgniteTxRemoteStateAdapter
implements IgniteTxRemoteState
assert false;
}
- /** MVCC Enabled */
- public boolean mvccEnabled() {
- return mvccEnabled;
- }
-
/** {@inheritDoc} */
@Override public boolean useMvccCaching(int cacheId) {
return mvccCachingCacheIds.contains(cacheId);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
index 68422a5aaf0..310193a8cc7 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
@@ -482,11 +482,6 @@ public class IgniteTxStateImpl extends
IgniteTxLocalStateAdapter {
return writeView != null && writeView.size() == 1 ?
F.firstValue(writeView) : null;
}
- /** MVCC Enabled */
- public boolean mvccEnabled() {
- return Boolean.TRUE == mvccEnabled;
- }
-
/** {@inheritDoc} */
@Override public boolean useMvccCaching(int cacheId) {
return mvccCachingCacheIds.contains(cacheId);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/CacheDataTree.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/CacheDataTree.java
index 65887df7fc8..9e0029cc9ff 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/CacheDataTree.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/CacheDataTree.java
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.pagemem.store.PageStore;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccUtils;
import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
import
org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter;
import org.apache.ignite.internal.processors.cache.persistence.CacheSearchRow;
@@ -38,11 +37,6 @@ import
org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageP
import
org.apache.ignite.internal.processors.cache.persistence.tree.io.IOVersions;
import org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO;
import
org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseList;
-import
org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccCacheIdAwareDataInnerIO;
-import
org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccCacheIdAwareDataLeafIO;
-import
org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccDataInnerIO;
-import
org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccDataLeafIO;
-import org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccDataRow;
import
org.apache.ignite.internal.processors.cache.tree.mvcc.search.MvccDataPageClosure;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.lang.GridCursor;
@@ -53,7 +47,6 @@ import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import static org.apache.ignite.internal.pagemem.PageIdUtils.itemId;
import static org.apache.ignite.internal.pagemem.PageIdUtils.pageId;
-import static
org.apache.ignite.internal.processors.cache.persistence.tree.io.DataPageIO.MVCC_INFO_SIZE;
import static
org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO.T_DATA;
import static org.apache.ignite.internal.util.GridArrays.clearTail;
@@ -187,7 +180,6 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
GridCacheSharedContext shared = grp.shared();
GridCacheDatabaseSharedManager db =
(GridCacheDatabaseSharedManager)shared.database();
PageStore pageStore = db.getPageStore(grpId, partId);
- boolean mvccEnabled = grp.mvccEnabled();
int pageSize = pageSize();
long startPageId =
((PageMemoryEx)pageMem).partitionMetaPageId(grp.groupId(), partId);
@@ -267,7 +259,7 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
for (int i = 0; i < rowsCnt; i++) {
if (c == null || c.applyMvcc(io, pageAddr, i,
pageSize)) {
- DataRow row = mvccEnabled ? new
MvccDataRow() : new DataRow();
+ DataRow row = new DataRow();
row.initFromDataPage(
io,
@@ -323,9 +315,6 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
* @return Tree inner IO.
*/
private static IOVersions<? extends AbstractDataInnerIO>
innerIO(CacheGroupContext grp) {
- if (grp.mvccEnabled())
- return grp.sharedGroup() ? MvccCacheIdAwareDataInnerIO.VERSIONS :
MvccDataInnerIO.VERSIONS;
-
return grp.sharedGroup() ? CacheIdAwareDataInnerIO.VERSIONS :
DataInnerIO.VERSIONS;
}
@@ -334,9 +323,6 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
* @return Tree leaf IO.
*/
private static IOVersions<? extends AbstractDataLeafIO>
leafIO(CacheGroupContext grp) {
- if (grp.mvccEnabled())
- return grp.sharedGroup() ? MvccCacheIdAwareDataLeafIO.VERSIONS :
MvccDataLeafIO.VERSIONS;
-
return grp.sharedGroup() ? CacheIdAwareDataLeafIO.VERSIONS :
DataLeafIO.VERSIONS;
}
@@ -350,9 +336,6 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
/** {@inheritDoc} */
@Override protected int compare(BPlusIO<CacheSearchRow> iox, long
pageAddr, int idx, CacheSearchRow row)
throws IgniteCheckedException {
- assert !grp.mvccEnabled() || row.mvccCoordinatorVersion() !=
MvccUtils.MVCC_CRD_COUNTER_NA
- || (row.getClass() == SearchRow.class && row.key() == null) : row;
-
RowLinkIO io = (RowLinkIO)iox;
int cmp;
@@ -390,16 +373,7 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
cmp = compareKeys(row.key(), link);
- if (cmp != 0 || !grp.mvccEnabled())
- return cmp;
-
- long crd = io.getMvccCoordinatorVersion(pageAddr, idx);
- long cntr = io.getMvccCounter(pageAddr, idx);
- int opCntr = io.getMvccOperationCounter(pageAddr, idx);
-
- assert MvccUtils.mvccVersionIsValid(crd, cntr, opCntr);
-
- return -MvccUtils.compare(crd, cntr, opCntr, row); // descending order
+ return cmp;
}
/** {@inheritDoc} */
@@ -413,15 +387,7 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
CacheDataRowAdapter.RowData x = asRowData(flags);
- if (grp.mvccEnabled()) {
- long mvccCrdVer = rowIo.getMvccCoordinatorVersion(pageAddr, idx);
- long mvccCntr = rowIo.getMvccCounter(pageAddr, idx);
- int mvccOpCntr = rowIo.getMvccOperationCounter(pageAddr, idx);
-
- return rowStore.mvccRow(cacheId, hash, link, x, mvccCrdVer,
mvccCntr, mvccOpCntr);
- }
- else
- return rowStore.dataRow(cacheId, hash, link, x);
+ return rowStore.dataRow(cacheId, hash, link, x);
}
/** {@inheritDoc} */
@@ -456,9 +422,6 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
if (data.nextLink() == 0) {
long addr = pageAddr + data.offset();
- if (grp.mvccEnabled())
- addr += MVCC_INFO_SIZE; // Skip MVCC info.
-
if (grp.storeCacheIdInDataPage())
addr += 4; // Skip cache id.
@@ -504,8 +467,7 @@ public class CacheDataTree extends
BPlusTree<CacheSearchRow, CacheDataRow> {
releasePage(pageId, page);
}
- // TODO GG-11768.
- CacheDataRowAdapter other = grp.mvccEnabled() ? new MvccDataRow(link)
: new CacheDataRowAdapter(link);
+ CacheDataRowAdapter other = new CacheDataRowAdapter(link);
other.initFromLink(grp, CacheDataRowAdapter.RowData.KEY_ONLY);
byte[] bytes1 = other.key().valueBytes(grp.cacheObjectContext());
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/PendingRow.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/PendingRow.java
index 4116ae0b219..1a6a1837c1b 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/PendingRow.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/PendingRow.java
@@ -21,7 +21,6 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import
org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter;
-import org.apache.ignite.internal.processors.cache.tree.mvcc.data.MvccDataRow;
import org.apache.ignite.internal.util.typedef.internal.S;
/**
@@ -69,7 +68,7 @@ public class PendingRow {
* @throws IgniteCheckedException If failed.
*/
PendingRow initKey(CacheGroupContext grp) throws IgniteCheckedException {
- CacheDataRowAdapter rowData = grp.mvccEnabled() ? new
MvccDataRow(link) : new CacheDataRowAdapter(link);
+ CacheDataRowAdapter rowData = new CacheDataRowAdapter(link);
rowData.initFromLink(grp, CacheDataRowAdapter.RowData.KEY_ONLY);
key = rowData.key();
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
index f0be798624c..5c5034b7f9b 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
@@ -32,7 +32,6 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import javax.cache.configuration.Factory;
-import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.query.BulkLoadContextCursor;
import org.apache.ignite.cache.query.FieldsQueryCursor;
@@ -53,7 +52,6 @@ import
org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.QueryCursorImpl;
import
org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccUtils;
import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
import org.apache.ignite.internal.processors.cache.query.QueryCursorEx;
import org.apache.ignite.internal.processors.cache.query.SqlFieldsQueryEx;
@@ -71,7 +69,6 @@ import org.apache.ignite.internal.processors.query.QueryUtils;
import org.apache.ignite.internal.processors.query.SqlClientContext;
import org.apache.ignite.internal.sql.optimizer.affinity.PartitionResult;
import org.apache.ignite.internal.util.GridSpinBusyLock;
-import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.S;
@@ -240,25 +237,12 @@ public class JdbcRequestHandler implements
ClientListenerRequestHandler {
}
/** {@inheritDoc} */
- @Override public ClientListenerResponse handle(ClientListenerRequest req0)
{
- assert req0 != null;
+ @Override public ClientListenerResponse handle(ClientListenerRequest req) {
+ assert req != null;
- assert req0 instanceof JdbcRequest;
+ assert req instanceof JdbcRequest;
- JdbcRequest req = (JdbcRequest)req0;
-
- if (!MvccUtils.mvccEnabled(connCtx.kernalContext()))
- return doHandle(req);
- else {
- GridFutureAdapter<ClientListenerResponse> fut =
worker.process(req);
-
- try {
- return fut.get();
- }
- catch (IgniteCheckedException e) {
- return exceptionToResult(e);
- }
- }
+ return doHandle((JdbcRequest)req);
}
/** {@inheritDoc} */
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
index 5415395ff7c..eb84a170c62 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
@@ -28,8 +28,6 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import javax.cache.configuration.Factory;
-
-import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.query.FieldsQueryCursor;
@@ -38,7 +36,6 @@ import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.binary.BinaryWriterExImpl;
import org.apache.ignite.internal.binary.GridBinaryMarshaller;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccUtils;
import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
import org.apache.ignite.internal.processors.cache.query.SqlFieldsQueryEx;
import
org.apache.ignite.internal.processors.odbc.ClientListenerProtocolVersion;
@@ -57,7 +54,6 @@ import
org.apache.ignite.internal.processors.query.NestedTxMode;
import org.apache.ignite.internal.processors.query.QueryUtils;
import org.apache.ignite.internal.processors.query.SqlClientContext;
import org.apache.ignite.internal.util.GridSpinBusyLock;
-import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -191,25 +187,12 @@ public class OdbcRequestHandler implements
ClientListenerRequestHandler {
}
/** {@inheritDoc} */
- @Override public ClientListenerResponse handle(ClientListenerRequest req0)
{
- assert req0 != null;
-
- assert req0 instanceof OdbcRequest;
+ @Override public ClientListenerResponse handle(ClientListenerRequest req) {
+ assert req != null;
- OdbcRequest req = (OdbcRequest)req0;
-
- if (!MvccUtils.mvccEnabled(ctx))
- return doHandle(req);
- else {
- GridFutureAdapter<ClientListenerResponse> fut =
worker.process(req);
+ assert req instanceof OdbcRequest;
- try {
- return fut.get();
- }
- catch (IgniteCheckedException e) {
- return exceptionToResult(e);
- }
- }
+ return doHandle((OdbcRequest)req);
}
/**
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java
index dedd7b402b7..efaadd7c98b 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java
@@ -45,7 +45,6 @@ import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleMessage;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccProcessor;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.lang.IgniteBiInClosure;
@@ -367,21 +366,9 @@ public class GridExchangeFreeSwitchTest extends
GridCommonAbstractTest {
Random r = new Random();
- Ignite candidate;
- MvccProcessor proc;
+ int nodeToStop = r.nextInt(nodes);
- int nodeToStop;
-
- do {
- nodeToStop = r.nextInt(nodes);
- candidate = grid(nodeToStop);
-
- proc = ((IgniteEx)candidate).context().coordinators();
- }
- // MVCC coordinator fail always breaks transactions, excluding.
- while (proc.mvccEnabled() && proc.currentCoordinator().local());
-
- Ignite failed = candidate;
+ Ignite failed = grid(nodeToStop);
int multiplicator = 3;
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java
index 9bd4f0eaae1..dcd44136b7f 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java
@@ -52,7 +52,6 @@ import
org.apache.ignite.internal.pagemem.wal.record.delta.PageDeltaRecord;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
-import org.apache.ignite.internal.processors.cache.mvcc.MvccUtils;
import org.apache.ignite.internal.processors.cache.mvcc.txlog.TxLog;
import org.apache.ignite.internal.processors.cache.persistence.DataRegion;
import
org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl;
@@ -65,7 +64,6 @@ import
org.apache.ignite.internal.processors.cache.persistence.tree.io.Compactab
import org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO;
import
org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager;
import org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer;
-import org.apache.ignite.internal.processors.cache.tree.AbstractDataLeafIO;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -75,8 +73,6 @@ import org.apache.ignite.plugin.PluginContext;
import org.apache.ignite.spi.encryption.EncryptionSpi;
import org.mockito.Mockito;
-import static
org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO.T_CACHE_ID_DATA_REF_MVCC_LEAF;
-import static
org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO.T_DATA_REF_MVCC_LEAF;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -542,9 +538,6 @@ public class PageMemoryTracker implements IgnitePlugin {
long totalAllocated =
pageStoreMgr.pagesAllocated(MetaStorage.METASTORAGE_CACHE_ID);
- if (MvccUtils.mvccEnabled(gridCtx))
- totalAllocated +=
pageStoreMgr.pagesAllocated(TxLog.TX_LOG_CACHE_ID);
-
for (CacheGroupContext ctx : gridCtx.cache().cacheGroups())
totalAllocated += pageStoreMgr.pagesAllocated(ctx.groupId());
@@ -685,20 +678,6 @@ public class PageMemoryTracker implements IgnitePlugin {
PageIO pageIo = PageIO.getPageIO(actualPageAddr);
- if (pageIo.getType() == T_DATA_REF_MVCC_LEAF || pageIo.getType() ==
T_CACHE_ID_DATA_REF_MVCC_LEAF) {
- assert cacheProc.cacheGroup(fullPageId.groupId()).mvccEnabled();
-
- AbstractDataLeafIO io = (AbstractDataLeafIO)pageIo;
-
- int cnt = io.getMaxCount(actualPageAddr, pageSize);
-
- // Reset lock info as there is no sense to log it into WAL.
- for (int i = 0; i < cnt; i++) {
- io.setMvccLockCoordinatorVersion(expPageAddr, i,
io.getMvccLockCoordinatorVersion(actualPageAddr, i));
- io.setMvccLockCounter(expPageAddr, i,
io.getMvccLockCounter(actualPageAddr, i));
- }
- }
-
// Compare only meaningful data.
if (pageIo instanceof CompactablePageIO) {
tmpBuf1.clear();
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/CommandProcessor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/CommandProcessor.java
index e3894254330..17d6c40126e 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/CommandProcessor.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/CommandProcessor.java
@@ -43,11 +43,9 @@ import
org.apache.ignite.internal.processors.bulkload.BulkLoadParser;
import org.apache.ignite.internal.processors.bulkload.BulkLoadProcessor;
import org.apache.ignite.internal.processors.bulkload.BulkLoadStreamerWriter;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
-import
org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
import org.apache.ignite.internal.processors.query.IgniteSQLException;
-import org.apache.ignite.internal.processors.query.NestedTxMode;
import org.apache.ignite.internal.processors.query.QueryEntityEx;
import org.apache.ignite.internal.processors.query.QueryField;
import org.apache.ignite.internal.processors.query.QueryUtils;
@@ -90,12 +88,8 @@ import org.h2.command.dml.NoOperation;
import org.h2.table.Column;
import org.h2.value.DataType;
import org.h2.value.Value;
-import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.mvccEnabled;
-import static org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.tx;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.txStart;
import static org.apache.ignite.internal.processors.query.QueryUtils.convert;
import static
org.apache.ignite.internal.processors.query.QueryUtils.isDdlOnSchemaSupported;
import static
org.apache.ignite.internal.processors.query.h2.sql.GridSqlQueryParser.PARAM_WRAP_VALUE;
@@ -193,8 +187,6 @@ public class CommandProcessor extends SqlCommandProcessor {
return processBulkLoadCommand((SqlBulkLoadCommand)cmdNative,
qryId);
else if (cmdNative instanceof SqlSetStreamingCommand)
processSetStreamingCommand((SqlSetStreamingCommand)cmdNative,
cliCtx);
- else
- processTxCommand(cmdNative, params);
return null;
}
@@ -615,108 +607,6 @@ public class CommandProcessor extends SqlCommandProcessor
{
}
}
- /**
- * Process transactional command.
- * @param cmd Command.
- * @param params Parameters.
- * @throws IgniteCheckedException if failed.
- */
- private void processTxCommand(SqlCommand cmd, QueryParameters params)
- throws IgniteCheckedException {
- NestedTxMode nestedTxMode = params.nestedTxMode();
-
- GridNearTxLocal tx = tx(ctx);
-
- if (cmd instanceof SqlBeginTransactionCommand) {
- if (!mvccEnabled(ctx))
- throw new IgniteSQLException("MVCC must be enabled in order to
start transaction.",
- IgniteQueryErrorCode.MVCC_DISABLED);
-
- if (tx != null) {
- if (nestedTxMode == null)
- nestedTxMode = NestedTxMode.DEFAULT;
-
- switch (nestedTxMode) {
- case COMMIT:
- doCommit(tx);
-
- txStart(ctx, params.timeout());
-
- break;
-
- case IGNORE:
- log.warning("Transaction has already been started,
ignoring BEGIN command.");
-
- break;
-
- case ERROR:
- throw new IgniteSQLException("Transaction has already
been started.",
- IgniteQueryErrorCode.TRANSACTION_EXISTS);
-
- default:
- throw new IgniteSQLException("Unexpected nested
transaction handling mode: " +
- nestedTxMode.name());
- }
- }
- else
- txStart(ctx, params.timeout());
- }
- else if (cmd instanceof SqlCommitTransactionCommand) {
- // Do nothing if there's no transaction.
- if (tx != null)
- doCommit(tx);
- }
- else {
- assert cmd instanceof SqlRollbackTransactionCommand;
-
- // Do nothing if there's no transaction.
- if (tx != null)
- doRollback(tx);
- }
- }
-
- /**
- * Commit and properly close transaction.
- * @param tx Transaction.
- * @throws IgniteCheckedException if failed.
- */
- private void doCommit(@NotNull GridNearTxLocal tx) throws
IgniteCheckedException {
- try {
- tx.commit();
- }
- finally {
- closeTx(tx);
- }
- }
-
- /**
- * Rollback and properly close transaction.
- * @param tx Transaction.
- * @throws IgniteCheckedException if failed.
- */
- public void doRollback(@NotNull GridNearTxLocal tx) throws
IgniteCheckedException {
- try {
- tx.rollback();
- }
- finally {
- closeTx(tx);
- }
- }
-
- /**
- * Properly close transaction.
- * @param tx Transaction.
- * @throws IgniteCheckedException if failed.
- */
- private void closeTx(@NotNull GridNearTxLocal tx) throws
IgniteCheckedException {
- try {
- tx.close();
- }
- finally {
- ctx.cache().context().tm().resetContext();
- }
- }
-
/**
* Process SET STREAMING command.
*
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/GridCacheTwoStepQuery.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/GridCacheTwoStepQuery.java
index 842972d6590..aad80a1b66d 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/GridCacheTwoStepQuery.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/GridCacheTwoStepQuery.java
@@ -225,13 +225,6 @@ public class GridCacheTwoStepQuery {
return tbls;
}
- /**
- * @return Mvcc flag.
- */
- public boolean mvccEnabled() {
- return mvccEnabled;
- }
-
/**
* @return Number of parameters
*/
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 681f019b843..bbb088cc091 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -159,8 +159,6 @@ import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.util.Collections.singletonList;
import static org.apache.ignite.events.EventType.EVT_SQL_QUERY_EXECUTION;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.checkActive;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.mvccEnabled;
import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.requestSnapshot;
import static org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.tx;
import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.txStart;
@@ -411,8 +409,6 @@ public class IgniteH2Indexing implements GridQueryIndexing {
boolean inTx,
int timeout
) {
- assert !select.mvccEnabled() || mvccTracker != null;
-
String qry;
if (select.forUpdate())
@@ -1121,7 +1117,7 @@ public class IgniteH2Indexing implements
GridQueryIndexing {
Exception failReason = null;
try (TraceSurroundings ignored =
MTC.support(ctx.tracing().create(SQL_DML_QRY_EXECUTE, MTC.span()))) {
- if (!dml.mvccEnabled() && !updateInTxAllowed &&
ctx.cache().context().tm().inUserTx()) {
+ if (!updateInTxAllowed && ctx.cache().context().tm().inUserTx()) {
throw new IgniteSQLException("DML statements are not allowed
inside a transaction over " +
"cache(s) with TRANSACTIONAL atomicity mode (change
atomicity mode to " +
"TRANSACTIONAL_SNAPSHOT or disable this error message with
system property " +
@@ -1211,28 +1207,6 @@ public class IgniteH2Indexing implements
GridQueryIndexing {
boolean inTx = false;
- if (select.mvccEnabled()) {
- mvccCctx =
ctx.cache().context().cacheContext(select.mvccCacheId());
-
- if (mvccCctx == null)
- throw new IgniteCheckedException("Cache has been stopped
concurrently [cacheId=" +
- select.mvccCacheId() + ']');
-
- boolean autoStartTx = !qryParams.autoCommit() && tx(ctx) ==
null;
-
- // Start new user tx in case of autocommit == false.
- if (autoStartTx)
- txStart(ctx, qryParams.timeout());
-
- tx = tx(ctx);
-
- checkActive(tx);
-
- inTx = tx != null;
-
- tracker = MvccUtils.mvccTracker(mvccCctx, tx);
- }
-
int timeout = operationTimeout(qryParams.timeout(), tx);
Iterable<List<?>> iter = executeSelect0(
@@ -1345,8 +1319,6 @@ public class IgniteH2Indexing implements
GridQueryIndexing {
boolean inTx,
int timeout
) {
- assert !select.mvccEnabled() || mvccTracker != null;
-
// Check security.
if (ctx.security().enabled())
checkSecurity(select.cacheIds());
@@ -1687,9 +1659,6 @@ public class IgniteH2Indexing implements
GridQueryIndexing {
};
}
else {
- assert !twoStepQry.mvccEnabled() ||
!F.isEmpty(twoStepQry.cacheIds());
- assert twoStepQry.mvccEnabled() == (mvccTracker != null);
-
iter = new Iterable<List<?>>() {
@Override public Iterator<List<?>> iterator() {
try (TraceSurroundings ignored =
MTC.support(ctx.tracing().create(SQL_ITER_OPEN, MTC.span()))) {
@@ -2075,14 +2044,8 @@ public class IgniteH2Indexing implements
GridQueryIndexing {
}
/** {@inheritDoc} */
- @Override public void onClientDisconnect() throws IgniteCheckedException {
- if (!mvccEnabled(ctx))
- return;
-
- GridNearTxLocal tx = tx(ctx);
-
- if (tx != null)
- cmdProc.doRollback(tx);
+ @Override public void onClientDisconnect() {
+ // No-op.
}
/** {@inheritDoc} */
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultDml.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultDml.java
index 79ebfe2c542..9d5626db296 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultDml.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultDml.java
@@ -65,13 +65,6 @@ public class QueryParserResultDml {
return stmt;
}
- /**
- * @return MVCC enabled.
- */
- public boolean mvccEnabled() {
- return mvccEnabled;
- }
-
/**
* @return Streamer table.
*/
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultSelect.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultSelect.java
index 418dc331e37..8c6c5ff4d62 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultSelect.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParserResultSelect.java
@@ -146,13 +146,6 @@ public class QueryParserResultSelect {
return mvccCacheId;
}
- /**
- * @return Whether this is a SELECT for MVCC caches.
- */
- public boolean mvccEnabled() {
- return mvccCacheId != null;
- }
-
/**
* @return Whether this is FOR UPDATE query.
*/
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 125771e865b..57736d6580e 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -80,7 +80,6 @@ import
org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2DmlRespo
import
org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2QueryRequest;
import org.apache.ignite.internal.processors.tracing.MTC;
import org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings;
-import
org.apache.ignite.internal.transactions.IgniteTxAlreadyCompletedCheckedException;
import org.apache.ignite.internal.util.typedef.C2;
import org.apache.ignite.internal.util.typedef.CIX2;
import org.apache.ignite.internal.util.typedef.F;
@@ -88,7 +87,6 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiClosure;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.transactions.TransactionAlreadyCompletedException;
import org.apache.ignite.transactions.TransactionException;
import org.h2.command.ddl.CreateTableData;
import org.h2.engine.Session;
@@ -102,8 +100,6 @@ import org.jetbrains.annotations.Nullable;
import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap;
import static
org.apache.ignite.IgniteSystemProperties.IGNITE_SQL_RETRY_TIMEOUT;
-import static
org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.checkActive;
-import static org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.tx;
import static
org.apache.ignite.internal.processors.cache.query.GridCacheSqlQuery.EMPTY_PARAMS;
import static
org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.mergeTableIdentifier;
import static org.apache.ignite.internal.processors.tracing.SpanTags.ERROR;
@@ -359,8 +355,6 @@ public class GridReduceQueryExecutor {
Boolean dataPageScanEnabled,
int pageSize
) {
- assert !qry.mvccEnabled() || mvccTracker != null;
-
if (pageSize <= 0)
pageSize = Query.DFLT_PAGE_SIZE;
@@ -372,14 +366,6 @@ public class GridReduceQueryExecutor {
if (parts != null && qry.isReplicatedOnly())
throw new CacheException("Partitions are not supported for
replicated caches");
- try {
- if (qry.mvccEnabled())
- checkActive(tx(ctx));
- }
- catch (IgniteTxAlreadyCompletedCheckedException e) {
- throw new TransactionAlreadyCompletedException(e.getMessage(), e);
- }
-
final boolean singlePartMode = parts != null && parts.length == 1;
if (F.isEmpty(params))
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SqlTransactionCommandsSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SqlTransactionCommandsSelfTest.java
deleted file mode 100644
index 83c213b99de..00000000000
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SqlTransactionCommandsSelfTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.index;
-
-import java.util.concurrent.Callable;
-import org.apache.ignite.internal.processors.query.IgniteSQLException;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.junit.Test;
-
-/**
- *
- */
-public class SqlTransactionCommandsSelfTest extends AbstractSchemaSelfTest {
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- super.beforeTestsStarted();
-
- startGrid(commonConfiguration(0));
-
- super.execute(grid(0), "CREATE TABLE INTS(k int primary key, v int)
WITH \"wrap_value=false,cache_name=ints," +
- "atomicity=transactional\"");
- }
-
- /**
- * @throws Exception if failed.
- */
- @Test
- public void testBeginWithMvccDisabled() throws Exception {
- GridTestUtils.assertThrows(null, new Callable<Object>() {
- @Override public Object call() throws Exception {
- execute(grid(0), "BEGIN");
-
- return null;
- }
- }, IgniteSQLException.class, "MVCC must be enabled in order to start
transaction.");
- }
-
- /**
- * @throws Exception if failed.
- */
- @Test
- public void testCommitWithMvccDisabled() throws Exception {
- execute(grid(0), "COMMIT");
- // assert no exception
- }
-
- /**
- * @throws Exception if failed.
- */
- @Test
- public void testRollbackWithMvccDisabled() throws Exception {
- execute(grid(0), "ROLLBACK");
- // assert no exception
- }
-}
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java
index 4805bf92d01..219ecc25cf3 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java
@@ -95,7 +95,6 @@ import
org.apache.ignite.internal.processors.cache.index.LongIndexNameTest;
import
org.apache.ignite.internal.processors.cache.index.OptimizedMarshallerIndexNameTest;
import
org.apache.ignite.internal.processors.cache.index.PojoIndexLocalQueryTest;
import
org.apache.ignite.internal.processors.cache.index.SqlPartitionEvictionTest;
-import
org.apache.ignite.internal.processors.cache.index.SqlTransactionCommandsSelfTest;
import
org.apache.ignite.internal.processors.cache.metric.SqlViewExporterSpiTest;
import
org.apache.ignite.internal.processors.cache.query.IgniteCacheQueryCacheDestroySelfTest;
import
org.apache.ignite.internal.processors.cache.query.ScanQueryConcurrentSqlUpdatesTest;
@@ -267,8 +266,6 @@ import org.junit.runners.Suite;
GridIndexRebuildTest.class,
CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.class,
- SqlTransactionCommandsSelfTest.class,
-
IgniteSqlDefaultValueTest.class,
IgniteDecimalSelfTest.class,
IgniteSQLColumnConstraintsTest.class,