You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by av...@apache.org on 2023/08/23 10:31:43 UTC
[ignite] branch master updated: IGNITE-20245 MVCC test/suites removal (#10900)
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 d4cccf70457 IGNITE-20245 MVCC test/suites removal (#10900)
d4cccf70457 is described below
commit d4cccf70457b2d18d6da9bf7f1cd9bc9692035cc
Author: Anton Vinogradov <av...@apache.org>
AuthorDate: Wed Aug 23 13:31:32 2023 +0300
IGNITE-20245 MVCC test/suites removal (#10900)
---
.../ignite/jdbc/JdbcVersionMismatchSelfTest.java | 172 -
.../jdbc/suite/IgniteJdbcDriverMvccTestSuite.java | 46 -
.../jdbc/suite/IgniteJdbcDriverTestSuite.java | 18 -
...eJdbcThinDriverPartitionAwarenessTestSuite.java | 2 -
.../JdbcThinConnectionMvccEnabledSelfTest.java | 367 --
.../jdbc/thin/JdbcThinConnectionSelfTest.java | 6 +-
.../jdbc/thin/JdbcThinMultiStatementSelfTest.java | 207 --
...onAwarenessReconnectionAndFailoverSelfTest.java | 55 -
...ThinPartitionAwarenessTransactionsSelfTest.java | 259 --
...dbcThinTransactionsAbstractComplexSelfTest.java | 1063 ------
...ransactionsClientAutoCommitComplexSelfTest.java | 33 -
...nsactionsClientNoAutoCommitComplexSelfTest.java | 33 -
.../thin/JdbcThinTransactionsLeaksMvccTest.java | 151 -
.../jdbc/thin/JdbcThinTransactionsSelfTest.java | 468 ---
...ransactionsServerAutoCommitComplexSelfTest.java | 33 -
...nsactionsServerNoAutoCommitComplexSelfTest.java | 33 -
...dbcThinTransactionsWithMvccEnabledSelfTest.java | 439 ---
...nsactionFinishOnDeactivatedClusterSelfTest.java | 162 -
.../org/apache/ignite/IgniteSystemProperties.java | 4 -
.../apache/ignite/cache/CacheAtomicityMode.java | 10 +
.../processors/cache/CacheInvokeEntry.java | 33 +-
.../processors/cache/GridCacheEntryEx.java | 5 -
.../processors/cache/GridCacheMapEntry.java | 6 +-
.../processors/cache/mvcc/MvccProcessorImpl.java | 12 -
...gniteCacheEntryProcessorSequentialCallTest.java | 20 +-
...nerRWThroughDisabledTransactionalCacheTest.java | 16 -
...CacheStoreSessionListenerLifecycleSelfTest.java | 8 -
...StoreSessionListenerWriteBehindEnabledTest.java | 10 -
.../CacheTransactionalStoreReadFromBackupTest.java | 8 -
.../GridCacheLoadOnlyStoreAdapterSelfTest.java | 5 -
.../jdbc/CacheJdbcPojoStoreAbstractSelfTest.java | 10 -
.../CacheJdbcStoreSessionListenerSelfTest.java | 8 -
...ridCacheJdbcBlobStoreMultithreadedSelfTest.java | 10 -
.../ignite/failure/IoomFailureHandlerTest.java | 36 +-
.../GridCacheHashMapPutAllWarningsTest.java | 4 -
.../internal/IgniteClientReconnectCacheTest.java | 28 +-
.../ignite/internal/TransactionMetricsTest.java | 10 -
.../managers/IgniteDiagnosticMessagesTest.java | 69 +-
.../internal/metric/IoStatisticsCacheSelfTest.java | 24 +-
.../ignite/internal/metric/JmxExporterSpiTest.java | 5 -
.../ignite/internal/metric/SystemViewSelfTest.java | 6 -
.../GridCacheTxLoadFromStoreOnLockSelfTest.java | 8 -
.../cache/AbstractDataTypesCoverageTest.java | 12 +-
.../processors/cache/CacheClientStoreSelfTest.java | 8 -
.../cache/CacheConcurrentReadThroughTest.java | 8 -
.../cache/CacheConnectionLeakStoreTxTest.java | 21 -
.../cache/CacheDeferredDeleteQueueTest.java | 13 -
.../cache/CacheDeferredDeleteSanitySelfTest.java | 22 +-
.../cache/CacheEnumOperationsAbstractTest.java | 14 -
.../cache/CacheEventWithTxLabelTest.java | 10 -
.../cache/CacheFutureExceptionSelfTest.java | 6 -
...eGetEntryPessimisticRepeatableReadSelfTest.java | 55 -
.../cache/CacheGetRemoveSkipStoreTest.java | 8 -
...ceptorPartitionCounterRandomOperationsTest.java | 112 +-
.../cache/CacheKeepBinaryTransactionTest.java | 7 +-
.../cache/CacheMetricsEntitiesCountTest.java | 12 +-
.../cache/CacheMetricsForClusterGroupSelfTest.java | 8 -
.../processors/cache/CacheMetricsManageTest.java | 10 -
.../cache/CacheMvccTxFastFinishTest.java | 72 -
.../cache/CacheNearReaderUpdateTest.java | 13 -
.../cache/CacheNoAffinityExchangeTest.java | 8 -
.../cache/CacheOffheapMapEntrySelfTest.java | 12 +-
.../cache/CachePutEventListenerErrorSelfTest.java | 5 -
.../processors/cache/CachePutIfAbsentTest.java | 4 -
.../cache/CacheReadThroughRestartSelfTest.java | 11 -
.../processors/cache/CacheRemoveAllSelfTest.java | 11 +-
.../cache/CacheStopAndDestroySelfTest.java | 8 +-
.../cache/CacheStoreTxPutAllMultiNodeTest.java | 3 -
...CacheStoreUsageMultinodeDynamicStartTxTest.java | 8 -
.../CacheStoreUsageMultinodeStaticStartTxTest.java | 8 -
.../processors/cache/CacheTxFastFinishTest.java | 4 -
.../cache/CacheTxNotAllowReadFromBackupTest.java | 70 -
.../cache/ClusterReadOnlyModeTestUtils.java | 13 +-
.../processors/cache/CrossCacheLockTest.java | 8 -
.../cache/CrossCacheTxRandomOperationsTest.java | 32 +-
.../EntryVersionConsistencyReadThroughTest.java | 25 -
.../cache/GridCacheAbstractFullApiSelfTest.java | 12 +-
.../cache/GridCacheAbstractIteratorsSelfTest.java | 4 -
.../cache/GridCacheAbstractSelfTest.java | 4 +-
.../cache/GridCacheBasicApiAbstractTest.java | 27 -
.../cache/GridCacheBasicStoreAbstractTest.java | 10 -
.../cache/GridCacheClearAllSelfTest.java | 4 -
.../cache/GridCacheClearLocallySelfTest.java | 5 +-
.../GridCacheConfigurationConsistencySelfTest.java | 29 +-
.../cache/GridCacheEntryMemorySizeSelfTest.java | 4 +-
.../cache/GridCacheEntryVersionSelfTest.java | 11 -
.../cache/GridCacheEvictionEventAbstractTest.java | 12 -
.../GridCacheFastNodeLeftForTransactionTest.java | 1 -
.../cache/GridCacheFinishPartitionsSelfTest.java | 8 -
.../GridCacheGetAndTransformStoreAbstractTest.java | 10 -
.../GridCacheInterceptorAbstractSelfTest.java | 23 +-
...CacheInterceptorTransactionalRebalanceTest.java | 6 -
.../GridCacheMarshallingNodeJoinSelfTest.java | 12 -
.../GridCacheMixedPartitionExchangeSelfTest.java | 3 +-
.../GridCacheMultinodeUpdateAbstractSelfTest.java | 17 +-
...ultinodeUpdateNearEnabledNoBackupsSelfTest.java | 11 -
...ridCacheMultinodeUpdateNearEnabledSelfTest.java | 15 +-
.../processors/cache/GridCacheMvccFlagsTest.java | 147 -
.../cache/GridCacheMvccManagerSelfTest.java | 102 -
.../GridCacheMvccMultiThreadedUpdateSelfTest.java | 218 --
.../cache/GridCacheMvccPartitionedSelfTest.java | 1083 ------
.../processors/cache/GridCacheMvccSelfTest.java | 1864 ----------
.../cache/GridCacheObjectToStringSelfTest.java | 11 +-
.../cache/GridCacheOffheapUpdateSelfTest.java | 17 +-
.../cache/GridCachePartitionedGetSelfTest.java | 6 -
.../cache/GridCachePartitionedWritesTest.java | 6 -
.../GridCachePreloadingEvictionsSelfTest.java | 3 -
.../processors/cache/GridCacheReloadSelfTest.java | 18 -
.../processors/cache/GridCacheStopSelfTest.java | 54 +-
.../GridCacheStoreManagerDeserializationTest.java | 10 -
.../processors/cache/GridCacheTestEntryEx.java | 5 -
.../cache/GridCacheTtlManagerEvictionSelfTest.java | 9 -
.../cache/GridCacheTtlManagerSelfTest.java | 11 +-
.../GridCacheTxPartitionedLocalStoreSelfTest.java | 8 -
.../GridCacheValueConsistencyAbstractSelfTest.java | 9 -
.../cache/GridCacheVariableTopologySelfTest.java | 9 -
.../cache/GridCacheVersionMultinodeTest.java | 34 +-
.../cache/GridCacheVersionTopologyChangeTest.java | 9 -
.../cache/GridEvictionPolicyMBeansTest.java | 30 +-
...IgniteCacheClusterReadOnlyModeAbstractTest.java | 8 +-
.../IgniteCacheClusterReadOnlyModeSelfTest.java | 38 +-
.../IgniteCacheEntryListenerAbstractTest.java | 11 +-
...niteCacheEntryListenerEagerTtlDisabledTest.java | 8 -
.../cache/IgniteCacheEntryProcessorCallTest.java | 32 +-
.../processors/cache/IgniteCacheGroupsTest.java | 185 +-
...IgniteCacheInvokeReadThroughSingleNodeTest.java | 38 +-
.../cache/IgniteCacheInvokeReadThroughTest.java | 55 -
.../cache/IgniteCacheMvccTxInvokeTest.java | 59 -
.../IgniteCacheMvccTxNearEnabledInvokeTest.java | 32 -
.../cache/IgniteCacheNearLockValueSelfTest.java | 5 -
.../cache/IgniteCacheNoSyncForGetTest.java | 9 -
.../IgniteCacheReadThroughEvictionSelfTest.java | 14 -
.../cache/IgniteCacheReadThroughStoreCallTest.java | 8 -
...gniteCacheStoreClusterReadOnlyModeSelfTest.java | 3 -
.../cache/IgniteCacheStoreCollectionTest.java | 12 +-
.../cache/IgniteCacheTxCopyOnReadDisabledTest.java | 8 -
.../IgniteCacheTxNearEnabledStoreValueTest.java | 8 -
.../cache/IgniteCacheTxNearPeekModesTest.java | 8 -
.../cache/IgniteCacheTxStoreValueTest.java | 8 -
.../IgniteClientCacheInitializationFailTest.java | 39 +-
.../cache/IgniteClientCacheStartFailoverTest.java | 29 +-
...usterActivateDeactivateTestWithPersistence.java | 4 -
...niteDynamicCacheStartNoExchangeTimeoutTest.java | 34 -
.../cache/IgniteDynamicCacheStartSelfTest.java | 16 -
.../IgniteDynamicClientCacheStartSelfTest.java | 4 +-
.../IgniteMvccTxMultiThreadedAbstractTest.java | 117 -
.../IgniteMvccTxSingleThreadedAbstractTest.java | 49 -
.../cache/IgniteNearClientCacheCloseTest.java | 24 -
.../cache/IgniteOnePhaseCommitNearSelfTest.java | 4 -
.../cache/IgniteOutOfMemoryPropagationTest.java | 2 +-
.../cache/IgnitePdsDataRegionMetricsTxTest.java | 7 -
.../cache/IgnitePutAllLargeBatchSelfTest.java | 10 -
...ePutAllUpdateNonPreloadedPartitionSelfTest.java | 10 -
.../IgniteStartCacheInTransactionSelfTest.java | 3 -
...TopologyValidatorAbstractTxCacheGroupsTest.java | 55 +-
...IgniteTopologyValidatorAbstractTxCacheTest.java | 31 +-
.../IgniteTopologyValidatorGridSplitCacheTest.java | 4 -
...yValidatorNearPartitionedTxCacheGroupsTest.java | 8 -
...opologyValidatorNearPartitionedTxCacheTest.java | 8 -
.../processors/cache/IgniteTxAbstractTest.java | 5 -
.../cache/IgniteTxConfigCacheSelfTest.java | 4 -
.../cache/IgniteTxExceptionAbstractSelfTest.java | 9 +-
.../IgniteTxStoreExceptionAbstractSelfTest.java | 6 +-
.../cache/MvccCacheGroupMetricsTest.java | 38 -
...MvccTxPessimisticCacheGetsDistributionTest.java | 32 -
...MvccTxPessimisticCacheGetsDistributionTest.java | 32 -
.../cache/TransactionValidationTest.java | 5 -
.../binary/CacheKeepBinaryWithInterceptorTest.java | 19 -
.../distributed/CacheAsyncOperationsTest.java | 9 -
.../cache/distributed/CacheGroupsPreloadTest.java | 47 -
.../CacheLoadingConcurrentGridStartSelfTest.java | 6 -
.../distributed/CacheLockChangingTopologyTest.java | 3 -
.../distributed/CacheLockReleaseNodeLeaveTest.java | 6 -
.../CachePartitionLossWithRestartsTest.java | 38 +-
.../cache/distributed/CacheStartOnJoinTest.java | 14 +-
.../distributed/CacheTryLockMultithreadedTest.java | 6 -
.../CacheTxNearUpdateTopologyChangeTest.java | 8 -
...AbstractDistributedByteArrayValuesSelfTest.java | 43 +-
.../GridCacheAbstractPrimarySyncSelfTest.java | 7 -
.../distributed/GridCacheBasicOpAbstractTest.java | 8 -
.../GridCacheClientModesAbstractSelfTest.java | 12 -
.../distributed/GridCacheEventAbstractTest.java | 16 -
.../distributed/GridCacheLockAbstractTest.java | 10 -
.../GridCacheMultiNodeAbstractTest.java | 10 -
.../GridCacheMultiNodeLockAbstractTest.java | 9 -
.../GridCacheNodeFailureAbstractTest.java | 3 -
.../GridCachePartitionNotLoadedEventSelfTest.java | 6 -
...nedNearDisabledMvccTxMultiThreadedSelfTest.java | 31 -
.../GridCachePreloadEventsAbstractSelfTest.java | 6 -
.../GridCachePreloadRestartAbstractSelfTest.java | 7 -
.../GridCacheTransformEventSelfTest.java | 41 +-
.../IgniteAbstractTxSuspendResumeTest.java | 9 +-
.../IgniteCacheClientNodeChangingTopologyTest.java | 6 -
.../IgniteCacheConnectionRecoveryTest.java | 15 +-
.../IgniteCacheCreatePutMultiNodeSelfTest.java | 15 +-
.../distributed/IgniteCacheCreatePutTest.java | 11 -
.../IgniteCacheFailedUpdateResponseTest.java | 35 +-
...niteCacheMessageRecoveryIdleConnectionTest.java | 9 -
.../IgniteCacheMultiClientsStartTest.java | 2 +-
.../distributed/IgniteCachePrimarySyncTest.java | 16 +-
.../distributed/IgniteCacheReadFromBackupTest.java | 54 -
.../IgniteCacheSingleGetMessageTest.java | 24 -
.../IgniteCacheSystemTransactionsSelfTest.java | 8 +-
.../distributed/IgniteCacheThreadLocalTxTest.java | 4 -
.../distributed/IgniteCacheTxIteratorSelfTest.java | 14 +-
.../IgniteCrossCacheTxStoreSelfTest.java | 5 -
.../IgniteMvccTxTimeoutAbstractTest.java | 129 -
.../IgnitePessimisticTxSuspendResumeTest.java | 4 -
.../distributed/IgniteTxCachePrimarySyncTest.java | 85 +-
...WriteSynchronizationModesMultithreadedTest.java | 86 +-
.../IgniteTxConcurrentRemoveObjectsTest.java | 10 -
...sticOriginatingNodeFailureAbstractSelfTest.java | 10 +-
.../distributed/IgniteTxPreloadAbstractTest.java | 4 +-
.../IgniteTxRemoveTimeoutObjectsTest.java | 12 -
...CacheAbstractTransformWriteThroughSelfTest.java | 10 -
...CacheColocatedMvccTxSingleThreadedSelfTest.java | 82 -
.../distributed/dht/GridCacheDhtEntrySelfTest.java | 3 -
.../dht/GridCacheDhtMappingSelfTest.java | 6 -
.../dht/GridCacheDhtPreloadDisabledSelfTest.java | 3 -
.../dht/GridCacheDhtPreloadPutGetSelfTest.java | 8 -
.../distributed/dht/GridCacheGlobalLoadTest.java | 8 -
.../dht/IgniteCacheClearDuringRebalanceTest.java | 7 -
.../dht/IgniteCacheLockFailoverSelfTest.java | 8 -
.../dht/IgniteCacheMultiTxLockSelfTest.java | 8 -
...achePrimaryNodeFailureRecoveryAbstractTest.java | 25 +-
.../dht/IgniteCrossCacheMvccTxSelfTest.java | 41 -
.../dht/NotMappedPartitionInTxTest.java | 47 +-
...ractNearPartitionedByteArrayValuesSelfTest.java | 16 -
.../near/GridCacheGetStoreErrorSelfTest.java | 12 +-
.../near/GridCacheMvccNearEvictionSelfTest.java | 33 -
.../near/GridCacheNearMetricsSelfTest.java | 3 -
.../near/GridCacheNearMultiGetSelfTest.java | 20 -
.../near/GridCacheNearMultiNodeSelfTest.java | 14 -
.../near/GridCacheNearOneNodeSelfTest.java | 10 -
.../near/GridCacheNearOnlyTopologySelfTest.java | 6 -
.../GridCacheNearPartitionedClearSelfTest.java | 3 -
.../near/GridCacheNearReaderPreloadSelfTest.java | 6 -
.../near/GridCacheNearReadersSelfTest.java | 6 -
.../near/GridCacheNearTxExceptionSelfTest.java | 8 -
.../near/GridCacheNearTxPreloadSelfTest.java | 8 -
...achePartitionedBasicStoreMultiNodeSelfTest.java | 16 -
.../near/GridCachePartitionedEventSelfTest.java | 8 -
...PartitionedExplicitLockNodeFailureSelfTest.java | 6 -
.../GridCachePartitionedHitsAndMissesSelfTest.java | 3 -
.../GridCachePartitionedLoadCacheSelfTest.java | 6 -
.../near/GridCachePartitionedMetricsSelfTest.java | 10 -
...achePartitionedMvccTxMultiThreadedSelfTest.java | 105 -
...chePartitionedMvccTxSingleThreadedSelfTest.java | 81 -
.../GridCachePartitionedMvccTxTimeoutSelfTest.java | 47 -
.../near/GridCachePartitionedStorePutSelfTest.java | 10 -
.../near/GridCachePutArrayValueSelfTest.java | 10 -
.../near/GridNearCacheStoreUpdateTest.java | 4 -
.../near/GridPartitionedBackupLoadSelfTest.java | 4 -
.../near/IgniteCacheNearOnlyTxTest.java | 8 -
.../near/IgniteCacheNearReadCommittedTest.java | 8 -
.../near/IgniteTxExceptionNodeFailTest.java | 17 +-
.../distributed/near/NearCacheSyncUpdateTest.java | 11 -
...dCacheRebalancingPartitionCountersMvccTest.java | 29 -
.../GridCacheRebalancingSyncSelfTest.java | 11 +-
...dCacheRebalancingWithAsyncClearingMvccTest.java | 34 -
.../GridCacheReplicatedMetricsSelfTest.java | 10 -
...CacheReplicatedMvccTxMultiThreadedSelfTest.java | 83 -
...acheReplicatedMvccTxSingleThreadedSelfTest.java | 77 -
.../GridCacheReplicatedMvccTxTimeoutSelfTest.java | 44 -
.../GridCacheSyncReplicatedPreloadSelfTest.java | 4 -
.../GridCacheReplicatedPreloadSelfTest.java | 8 -
.../cache/eviction/DhtAndNearEvictionTest.java | 12 -
...CacheConcurrentEvictionConsistencySelfTest.java | 25 +-
.../GridCacheEmptyEntriesAbstractSelfTest.java | 4 -
.../GridCacheEmptyEntriesPartitionedSelfTest.java | 6 -
.../eviction/GridCacheEvictionFilterSelfTest.java | 4 +-
.../GridCacheEvictionLockUnlockSelfTest.java | 11 +-
.../eviction/GridCacheEvictionTouchSelfTest.java | 10 -
.../lru/LruNearEvictionPolicySelfTest.java | 13 -
.../lru/LruNearOnlyNearEvictionPolicySelfTest.java | 26 -
.../eviction/paged/PageEvictionMetricTest.java | 10 -
.../paged/PageEvictionMultinodeAbstractTest.java | 16 -
.../PageEvictionPagesRecyclingAndReusingTest.java | 20 -
.../paged/PageEvictionReadThroughTest.java | 19 -
.../eviction/paged/PageEvictionTouchOrderTest.java | 19 -
.../PageEvictionWithRebalanceAbstractTest.java | 10 -
.../IgniteCacheLoadAllAbstractTest.java | 12 -
.../integration/IgniteCacheTxLoaderWriterTest.java | 16 -
...eCacheTxNearEnabledNoLoadPreviousValueTest.java | 16 -
...IgniteCacheTxNearEnabledNoWriteThroughTest.java | 16 -
.../IgniteCacheTxNoLoadPreviousValueTest.java | 16 -
.../IgniteCacheTxNoReadThroughTest.java | 16 -
.../IgniteCacheTxNoWriteThroughTest.java | 16 -
.../integration/IgniteCacheTxStoreSessionTest.java | 16 -
...cheTxStoreSessionWriteBehindCoalescingTest.java | 10 -
.../IgniteCacheTxStoreSessionWriteBehindTest.java | 16 -
...heMvccAbstractBasicCoordinatorFailoverTest.java | 870 -----
.../CacheMvccAbstractCoordinatorFailoverTest.java | 137 -
.../cache/mvcc/CacheMvccAbstractFeatureTest.java | 297 --
.../cache/mvcc/CacheMvccAbstractTest.java | 2447 -------------
.../cache/mvcc/CacheMvccClientReconnectTest.java | 109 -
.../cache/mvcc/CacheMvccClientTopologyTest.java | 305 --
.../cache/mvcc/CacheMvccClusterRestartTest.java | 170 -
.../mvcc/CacheMvccConfigurationValidationTest.java | 419 ---
...eMvccIteratorWithConcurrentTransactionTest.java | 66 -
...cLocalEntriesWithConcurrentTransactionTest.java | 67 -
.../cache/mvcc/CacheMvccOperationChecksTest.java | 187 -
...acheMvccPartitionedCoordinatorFailoverTest.java | 195 --
.../mvcc/CacheMvccProcessorLazyStartTest.java | 181 -
.../cache/mvcc/CacheMvccProcessorTest.java | 111 -
.../mvcc/CacheMvccRemoteTxOnNearNodeStartTest.java | 88 -
...CacheMvccReplicatedCoordinatorFailoverTest.java | 30 -
...MvccScanQueryWithConcurrentTransactionTest.java | 78 -
...CacheMvccSizeWithConcurrentTransactionTest.java | 54 -
.../cache/mvcc/CacheMvccTransactionsTest.java | 3628 --------------------
.../cache/mvcc/CacheMvccTxFailoverTest.java | 279 --
.../processors/cache/mvcc/CacheMvccVacuumTest.java | 368 --
.../processors/cache/mvcc/MvccCachePeekTest.java | 163 -
.../cache/mvcc/MvccStructuresOverheadTest.java | 128 -
.../cache/mvcc/MvccUnsupportedTxModesTest.java | 368 --
...itePdsCacheStartStopWithFreqCheckpointTest.java | 6 +-
.../IgnitePdsContinuousRestartTest.java | 16 +-
...tePdsContinuousRestartTestWithExpiryPolicy.java | 8 -
.../persistence/IgnitePdsDynamicCacheTest.java | 12 +-
.../IgnitePdsPartitionsStateRecoveryTest.java | 9 +-
.../IgnitePdsRecoveryAfterFileCorruptionTest.java | 6 +-
...ocalWalModeChangeDuringRebalancingSelfTest.java | 8 +-
.../ClientAffinityAssignmentWithBaselineTest.java | 7 +-
.../persistence/db/IgniteLogicalRecoveryTest.java | 22 -
.../db/IgnitePdsPartitionPreloadTest.java | 154 +-
.../db/IgnitePdsTransactionsHangTest.java | 14 +-
...IgnitePdsWithTtlExpirationOnDeactivateTest.java | 3 -
.../cache/persistence/db/IgnitePdsWithTtlTest.java | 4 +-
.../persistence/db/IgnitePdsWithTtlTest2.java | 3 -
...CheckpointSimulationWithRealCpDisabledTest.java | 53 +-
.../wal/IgniteNodeStoppedDuringDisableWALTest.java | 5 -
...eWalFlushMultiNodeFailoverAbstractSelfTest.java | 4 -
.../db/wal/IgniteWalHistoryReservationsTest.java | 10 -
.../wal/IgniteWalRecoverySeveralRestartsTest.java | 10 -
.../db/wal/reader/IgniteWalReaderTest.java | 4 -
.../continuous/CacheContinuousBatchAckTest.java | 57 -
...ContinuousQueryAsyncFailoverMvccTxSelfTest.java | 52 -
...acheContinuousQueryAsyncFilterListenerTest.java | 128 -
...ntinuousQueryConcurrentPartitionUpdateTest.java | 47 -
.../CacheContinuousQueryExecuteInPrimaryTest.java | 24 +-
...nuousQueryFactoryFilterRandomOperationTest.java | 40 +-
...cheContinuousQueryFailoverAbstractSelfTest.java | 62 +-
...nuousQueryFailoverMvccTxReplicatedSelfTest.java | 31 -
...CacheContinuousQueryFailoverMvccTxSelfTest.java | 47 -
.../CacheContinuousQueryLostPartitionTest.java | 24 +-
...heContinuousQueryOperationFromCallbackTest.java | 106 -
.../CacheContinuousQueryOperationP2PTest.java | 53 -
.../CacheContinuousQueryOrderingEventTest.java | 67 -
.../CacheContinuousQueryRandomOperationsTest.java | 240 +-
...acheEntryProcessorExternalizableFailedTest.java | 132 +-
.../CacheEntryProcessorNonSerializableTest.java | 101 +-
.../CacheKeepBinaryIterationNearEnabledTest.java | 16 -
.../CacheKeepBinaryIterationStoreEnabledTest.java | 16 -
.../continuous/CacheKeepBinaryIterationTest.java | 27 -
.../ClientReconnectContinuousQueryTest.java | 5 -
.../GridCacheContinuousQueryAbstractSelfTest.java | 14 +-
.../GridCacheContinuousQueryConcurrentTest.java | 68 +-
...acheContinuousQueryReplicatedTxOneNodeTest.java | 14 +-
.../GridCacheWriteBehindStoreAbstractTest.java | 10 -
...iteBehindStorePartitionedMultiNodeSelfTest.java | 6 -
...nteCacheClientWriteBehindStoreAbstractTest.java | 10 -
...ionIntegrityWithPrimaryIndexCorruptionTest.java | 9 -
.../cache/transactions/TxOnCachesStopTest.java | 12 -
.../transactions/TxRollbackAsyncNearCacheTest.java | 9 -
.../cache/transactions/TxRollbackAsyncTest.java | 19 +-
.../TxRollbackOnIncorrectParamsTest.java | 42 +-
.../transactions/TxRollbackOnTimeoutTest.java | 4 -
.../TxRollbackOnTopologyChangeTest.java | 5 -
.../cache/transactions/TxStateChangeEventTest.java | 4 +-
.../transactions/TxWithKeyContentionSelfTest.java | 4 -
.../TxWithSmallTimeoutAndContentionOneKeyTest.java | 10 -
.../CacheObjectTransformationEvolutionTest.java | 2 +-
.../transform/CacheObjectTransformationTest.java | 2 +-
.../database/IgniteDbDynamicCacheSelfTest.java | 13 +-
.../database/IgniteDbPutGetAbstractTest.java | 6 +-
.../database/IgniteDbPutGetWithCacheStoreTest.java | 8 -
...DataStreamProcessorMvccPersistenceSelfTest.java | 28 -
.../DataStreamProcessorMvccSelfTest.java | 73 -
.../datastreamer/DataStreamProcessorSelfTest.java | 8 +-
.../ignite/testframework/MvccFeatureChecker.java | 175 -
.../testframework/junits/GridAbstractTest.java | 7 +-
.../junits/multijvm/IgniteProcessProxy.java | 4 +-
.../testsuites/IgniteBinaryCacheTestSuite.java | 3 -
.../testsuites/IgniteCacheMvccTestSuite.java | 80 -
.../testsuites/IgniteCacheMvccTestSuite1.java | 237 --
.../testsuites/IgniteCacheMvccTestSuite2.java | 231 --
.../testsuites/IgniteCacheMvccTestSuite3.java | 129 -
.../testsuites/IgniteCacheMvccTestSuite4.java | 183 -
.../testsuites/IgniteCacheMvccTestSuite5.java | 124 -
.../testsuites/IgniteCacheMvccTestSuite6.java | 120 -
.../testsuites/IgniteCacheMvccTestSuite7.java | 88 -
.../testsuites/IgniteCacheMvccTestSuite8.java | 124 -
.../testsuites/IgniteCacheMvccTestSuite9.java | 97 -
.../ignite/testsuites/IgniteCacheTestSuite.java | 6 -
.../ignite/testsuites/IgniteCacheTestSuite10.java | 2 -
.../ignite/testsuites/IgnitePdsMvccTestSuite.java | 90 -
.../ignite/testsuites/IgnitePdsMvccTestSuite2.java | 104 -
.../ignite/testsuites/IgnitePdsMvccTestSuite3.java | 47 -
.../ignite/testsuites/IgnitePdsMvccTestSuite4.java | 85 -
.../query/h2/sql/GridSqlQueryParser.java | 2 +-
.../GridCacheSqlDdlClusterReadOnlyModeTest.java | 6 -
.../index/DynamicEnableIndexingBasicSelfTest.java | 17 +-
.../DynamicEnableIndexingConcurrentSelfTest.java | 6 +-
.../cache/index/H2DynamicTableSelfTest.java | 3 +-
.../cache/index/MvccEmptyTransactionSelfTest.java | 103 -
...st.java => SqlTransactionCommandsSelfTest.java} | 2 +-
...ransactionsCommandsWithMvccEnabledSelfTest.java | 319 --
.../cache/index/SqlTransactionsSelfTest.java | 421 ---
.../CacheMvccAbstractContinuousQuerySelfTest.java | 72 -
...acheMvccAbstractSqlContinuousQuerySelfTest.java | 35 -
...acheMvccAbstractSqlCoordinatorFailoverTest.java | 395 ---
.../cache/mvcc/CacheMvccBackupsAbstractTest.java | 822 -----
.../mvcc/CacheMvccBasicContinuousQueryTest.java | 618 ----
.../cache/mvcc/CacheMvccBulkLoadTest.java | 127 -
...acheMvccClientReconnectContinuousQueryTest.java | 30 -
.../CacheMvccContinuousQueryBackupQueueTest.java | 30 -
...acheMvccContinuousQueryClientReconnectTest.java | 45 -
.../mvcc/CacheMvccContinuousQueryClientTest.java | 30 -
...CacheMvccContinuousQueryImmutableEntryTest.java | 30 -
...MvccContinuousQueryMultiNodesFilteringTest.java | 30 -
...acheMvccContinuousQueryPartitionedSelfTest.java | 29 -
...vccContinuousQueryPartitionedTxOneNodeTest.java | 36 -
...CacheMvccContinuousQueryReplicatedSelfTest.java | 29 -
...MvccContinuousQueryReplicatedTxOneNodeTest.java | 37 -
...vccContinuousWithTransformerClientSelfTest.java | 39 -
...ntinuousWithTransformerPartitionedSelfTest.java | 46 -
...ontinuousWithTransformerReplicatedSelfTest.java | 40 -
.../cache/mvcc/CacheMvccDmlSimpleTest.java | 205 --
...cIteratorWithConcurrentJdbcTransactionTest.java | 28 -
...alEntriesWithConcurrentJdbcTransactionTest.java | 29 -
.../mvcc/CacheMvccPartitionedBackupsTest.java | 30 -
...eMvccPartitionedSqlCoordinatorFailoverTest.java | 214 --
.../mvcc/CacheMvccPartitionedSqlQueriesTest.java | 30 -
.../mvcc/CacheMvccPartitionedSqlTxQueriesTest.java | 30 -
...MvccPartitionedSqlTxQueriesWithReducerTest.java | 88 -
.../cache/mvcc/CacheMvccReplicatedBackupsTest.java | 30 -
...heMvccReplicatedSqlCoordinatorFailoverTest.java | 30 -
.../mvcc/CacheMvccReplicatedSqlQueriesTest.java | 30 -
.../mvcc/CacheMvccReplicatedSqlTxQueriesTest.java | 246 --
...eMvccReplicatedSqlTxQueriesWithReducerTest.java | 30 -
...ScanQueryWithConcurrentJdbcTransactionTest.java | 29 -
.../CacheMvccSelectForUpdateQueryBasicTest.java | 792 -----
.../mvcc/CacheMvccSelectForUpdateQueryTest.java | 184 -
.../processors/cache/mvcc/CacheMvccSizeTest.java | 495 ---
...eMvccSizeWithConcurrentJdbcTransactionTest.java | 28 -
.../CacheMvccSqlConfigurationValidationTest.java | 116 -
...eMvccSqlContinuousQueryPartitionedSelfTest.java | 30 -
...heMvccSqlContinuousQueryReplicatedSelfTest.java | 29 -
.../cache/mvcc/CacheMvccSqlLockTimeoutTest.java | 361 --
.../mvcc/CacheMvccSqlQueriesAbstractTest.java | 1659 ---------
.../cache/mvcc/CacheMvccSqlTxModesTest.java | 234 --
.../mvcc/CacheMvccSqlTxQueriesAbstractTest.java | 2108 ------------
...cheMvccSqlTxQueriesWithReducerAbstractTest.java | 879 -----
.../cache/mvcc/CacheMvccSqlUpdateCountersTest.java | 562 ---
.../cache/mvcc/CacheMvccStreamingInsertTest.java | 125 -
.../cache/mvcc/CacheMvccTxNodeMappingTest.java | 216 --
.../cache/mvcc/CacheMvccTxRecoveryTest.java | 753 ----
.../mvcc/MvccDeadlockDetectionConfigTest.java | 156 -
.../cache/mvcc/MvccDeadlockDetectionTest.java | 632 ----
.../cache/mvcc/MvccRepeatableReadBulkOpsTest.java | 642 ----
.../mvcc/MvccRepeatableReadOperationsTest.java | 316 --
.../IgnitePdsIndexingDefragmentationTest.java | 34 +-
.../cache/ttl/CacheTtlReadOnlyModeSelfTest.java | 6 -
.../database/RebuildIndexWithMVCCTest.java | 39 -
.../internal/processors/query/LazyOnDmlTest.java | 4 +-
.../query/WrongQueryEntityFieldTypeTest.java | 17 +-
.../GridIndexRebuildWithMvccEnabledSelfTest.java | 124 -
.../processors/query/h2/QueryDataPageScanTest.java | 23 +-
.../twostep/AbstractPartitionPruningBaseTest.java | 41 +-
.../twostep/MvccDmlPartitionPruningSelfTest.java | 259 --
...achePartitionedAtomicColumnConstraintsTest.java | 4 -
...dTransactionalSnapshotColumnConstraintTest.java | 158 -
...dTransactionalSnapshotColumnConstraintTest.java | 158 -
.../sql/IgniteSQLColumnConstraintsTest.java | 25 +-
.../IgniteTransactionSQLColumnConstraintTest.java | 74 -
.../IgniteBinaryCacheQueryTestSuite3.java | 14 +-
.../testsuites/IgniteCacheMvccSqlTestSuite.java | 203 --
.../testsuites/IgniteCacheQuerySelfTestSuite4.java | 6 -
.../testsuites/IgnitePdsWithIndexingTestSuite.java | 2 -
.../internal/processors/cache/mvcc/mvcc_person.csv | 2 -
.../processors/cache/mvcc/mvcc_person_broken.csv | 2 -
modules/platforms/cpp/odbc-test/CMakeLists.txt | 1 -
.../odbc-test/config/queries-transaction-32.xml | 59 -
.../cpp/odbc-test/config/queries-transaction.xml | 41 -
.../cpp/odbc-test/src/transaction_test.cpp | 845 -----
485 files changed, 393 insertions(+), 43121 deletions(-)
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcVersionMismatchSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcVersionMismatchSelfTest.java
deleted file mode 100644
index 8f749e929e5..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcVersionMismatchSelfTest.java
+++ /dev/null
@@ -1,172 +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.jdbc;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
-import org.apache.ignite.internal.processors.odbc.SqlStateCode;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Test;
-
-/**
- * JDBC version mismatch test.
- */
-public class JdbcVersionMismatchSelfTest extends GridCommonAbstractTest {
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- startGrid();
-
- try (Connection conn = connect()) {
- executeUpdate(conn,
- "CREATE TABLE test (a INT PRIMARY KEY, b INT, c VARCHAR) WITH \"atomicity=TRANSACTIONAL_SNAPSHOT, cache_name=TEST\"");
-
- executeUpdate(conn, "INSERT INTO test VALUES (1, 1, 'test_1')");
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testVersionMismatchJdbc() throws Exception {
- try (Connection conn1 = connect(); Connection conn2 = connect()) {
- conn1.setAutoCommit(false);
- conn2.setAutoCommit(false);
-
- // Start first transaction and observe some values.
- assertEquals(1, executeQuery(conn1, "SELECT * FROM test").size());
-
- // Change values while first transaction is still in progress.
- executeUpdate(conn2, "INSERT INTO test VALUES (2, 2, 'test_2')");
- executeUpdate(conn2, "COMMIT");
- assertEquals(2, executeQuery(conn2, "SELECT * FROM test").size());
-
- // Force version mismatch.
- try {
- executeUpdate(conn1, "INSERT INTO test VALUES (2, 2, 'test_2')");
-
- fail();
- }
- catch (SQLException e) {
- assertEquals(SqlStateCode.SERIALIZATION_FAILURE, e.getSQLState());
- assertEquals(IgniteQueryErrorCode.TRANSACTION_SERIALIZATION_ERROR, e.getErrorCode());
-
- assertNotNull(e.getMessage());
- assertTrue(e.getMessage().contains("Cannot serialize transaction due to write conflict"));
- }
-
- // Subsequent call should cause exception due to TX being rolled back.
- try {
- executeQuery(conn1, "SELECT * FROM test").size();
-
- fail();
- }
- catch (SQLException e) {
- assertEquals(SqlStateCode.TRANSACTION_STATE_EXCEPTION, e.getSQLState());
- assertEquals(IgniteQueryErrorCode.TRANSACTION_COMPLETED, e.getErrorCode());
-
- assertNotNull(e.getMessage());
- assertTrue(e.getMessage().contains("Transaction is already completed"));
- }
-
- // Commit should fail.
- try {
- conn1.commit();
-
- fail();
- }
- catch (SQLException e) {
- // Cannot pass proper error codes for now
- assertEquals(SqlStateCode.INTERNAL_ERROR, e.getSQLState());
- assertEquals(IgniteQueryErrorCode.UNKNOWN, e.getErrorCode());
-
- assertNotNull(e.getMessage());
- assertTrue(e.getMessage().contains("Failed to finish transaction because it has been rolled back"));
- }
-
- // Rollback should work.
- conn1.rollback();
-
- // Subsequent calls should work fine.
- assertEquals(2, executeQuery(conn2, "SELECT * FROM test").size());
- }
- }
-
- /**
- * Establish JDBC connection.
- *
- * @return Connection.
- * @throws Exception If failed.
- */
- private Connection connect() throws Exception {
- return DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800");
- }
-
- /**
- * Execute update statement.
- *
- * @param conn Connection.
- * @param sql SQL.
- * @throws Exception If failed.
- */
- private static void executeUpdate(Connection conn, String sql) throws Exception {
- try (Statement stmt = conn.createStatement()) {
- stmt.executeUpdate(sql);
- }
- }
-
- /**
- * Execute query.
- *
- * @param conn Connection.
- * @param sql SQL.
- * @return Result.
- * @throws Exception If failed.
- */
- private static List<List<Object>> executeQuery(Connection conn, String sql) throws Exception {
- List<List<Object>> rows = new ArrayList<>();
-
- try (Statement stmt = conn.createStatement()) {
- try (ResultSet rs = stmt.executeQuery(sql)) {
- int colCnt = rs.getMetaData().getColumnCount();
-
- while (rs.next()) {
- List<Object> row = new ArrayList<>(colCnt);
-
- for (int i = 0; i < colCnt; i++)
- row.add(rs.getObject(i + 1));
-
- rows.add(row);
- }
- }
- }
-
- return rows;
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverMvccTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverMvccTestSuite.java
deleted file mode 100644
index 87229697da7..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverMvccTestSuite.java
+++ /dev/null
@@ -1,46 +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.jdbc.suite;
-
-import org.apache.ignite.jdbc.JdbcVersionMismatchSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinConnectionMvccEnabledSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsClientAutoCommitComplexSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsClientNoAutoCommitComplexSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsServerAutoCommitComplexSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsServerNoAutoCommitComplexSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsWithMvccEnabledSelfTest;
-import org.apache.ignite.jdbc.thin.MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/** */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- JdbcThinConnectionMvccEnabledSelfTest.class,
- JdbcVersionMismatchSelfTest.class,
-
- // Transactions
- JdbcThinTransactionsWithMvccEnabledSelfTest.class,
- JdbcThinTransactionsClientAutoCommitComplexSelfTest.class,
- JdbcThinTransactionsServerAutoCommitComplexSelfTest.class,
- JdbcThinTransactionsClientNoAutoCommitComplexSelfTest.class,
- JdbcThinTransactionsServerNoAutoCommitComplexSelfTest.class,
- MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.class
-})
-public class IgniteJdbcDriverMvccTestSuite {
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
index c53fa76a04f..450db60030d 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
@@ -39,7 +39,6 @@ import org.apache.ignite.jdbc.thin.JdbcThinComplexDmlDdlSkipReducerOnUpdateSelfT
import org.apache.ignite.jdbc.thin.JdbcThinComplexQuerySelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinConnectionAdditionalSecurityTest;
import org.apache.ignite.jdbc.thin.JdbcThinConnectionMultipleAddressesTest;
-import org.apache.ignite.jdbc.thin.JdbcThinConnectionMvccEnabledSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinConnectionPropertiesTest;
import org.apache.ignite.jdbc.thin.JdbcThinConnectionSSLTest;
import org.apache.ignite.jdbc.thin.JdbcThinConnectionSelfTest;
@@ -65,7 +64,6 @@ import org.apache.ignite.jdbc.thin.JdbcThinMergeStatementSkipReducerOnUpdateSelf
import org.apache.ignite.jdbc.thin.JdbcThinMetadataPrimaryKeysSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinMetadataSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinMissingLongArrayResultsTest;
-import org.apache.ignite.jdbc.thin.JdbcThinMultiStatementSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinNoDefaultSchemaTest;
import org.apache.ignite.jdbc.thin.JdbcThinPreparedStatementLeakTest;
import org.apache.ignite.jdbc.thin.JdbcThinPreparedStatementSelfTest;
@@ -80,12 +78,6 @@ import org.apache.ignite.jdbc.thin.JdbcThinStreamingNotOrderedSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinStreamingOrderedSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinStreamingResetStreamTest;
import org.apache.ignite.jdbc.thin.JdbcThinTcpIoTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsClientAutoCommitComplexSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsClientNoAutoCommitComplexSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsLeaksMvccTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsServerAutoCommitComplexSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinTransactionsServerNoAutoCommitComplexSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinUpdateStatementSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinUpdateStatementSkipReducerOnUpdateSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinWalModeChangeSelfTest;
@@ -150,7 +142,6 @@ import org.junit.runners.Suite;
// New thin JDBC
JdbcThinConnectionSelfTest.class,
- JdbcThinConnectionMvccEnabledSelfTest.class,
JdbcThinConnectionMultipleAddressesTest.class,
JdbcThinTcpIoTest.class,
JdbcThinConnectionAdditionalSecurityTest.class,
@@ -189,7 +180,6 @@ import org.junit.runners.Suite;
JdbcThinDynamicIndexTransactionalPartitionedNearSelfTest.class,
JdbcThinDynamicIndexTransactionalPartitionedSelfTest.class,
JdbcThinDynamicIndexTransactionalReplicatedSelfTest.class,
- JdbcThinMultiStatementSelfTest.class,
// New thin JDBC driver, DML tests
JdbcThinBulkLoadSelfTest.class,
@@ -206,13 +196,6 @@ import org.junit.runners.Suite;
JdbcThinComplexDmlDdlSkipReducerOnUpdateSelfTest.class,
JdbcThinComplexDmlDdlCustomSchemaSelfTest.class,
- // Transactions
- JdbcThinTransactionsSelfTest.class,
- JdbcThinTransactionsClientAutoCommitComplexSelfTest.class,
- JdbcThinTransactionsServerAutoCommitComplexSelfTest.class,
- JdbcThinTransactionsClientNoAutoCommitComplexSelfTest.class,
- JdbcThinTransactionsServerNoAutoCommitComplexSelfTest.class,
-
JdbcThinLocalQueriesSelfTest.class,
// Various commands.
@@ -220,7 +203,6 @@ import org.junit.runners.Suite;
JdbcThinAuthenticateConnectionSelfTest.class,
JdbcThinPreparedStatementLeakTest.class,
- JdbcThinTransactionsLeaksMvccTest.class,
JdbcThinSqlMergeTest.class,
// Data types coverage.
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcThinDriverPartitionAwarenessTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcThinDriverPartitionAwarenessTestSuite.java
index 485ab3aee24..69722306e26 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcThinDriverPartitionAwarenessTestSuite.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcThinDriverPartitionAwarenessTestSuite.java
@@ -21,7 +21,6 @@ import org.apache.ignite.jdbc.thin.JdbcThinAbstractSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinConnectionSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinPartitionAwarenessSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinPartitionAwarenessTransactionsSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinStatementSelfTest;
import org.apache.ignite.jdbc.thin.JdbcThinTcpIoTest;
import org.apache.ignite.testframework.GridTestUtils;
@@ -38,7 +37,6 @@ import org.junit.runners.Suite;
JdbcThinTcpIoTest.class,
JdbcThinStatementSelfTest.class,
JdbcThinPartitionAwarenessSelfTest.class,
- JdbcThinPartitionAwarenessTransactionsSelfTest.class,
JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.class,
})
public class IgniteJdbcThinDriverPartitionAwarenessTestSuite {
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMvccEnabledSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMvccEnabledSelfTest.java
deleted file mode 100644
index 76048c424ba..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionMvccEnabledSelfTest.java
+++ /dev/null
@@ -1,367 +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.jdbc.thin;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Savepoint;
-import java.util.concurrent.Callable;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.util.lang.RunnableX;
-import org.apache.ignite.testframework.GridStringLogger;
-import org.jetbrains.annotations.NotNull;
-import org.junit.Test;
-
-import static java.sql.Connection.TRANSACTION_NONE;
-import static java.sql.Connection.TRANSACTION_READ_COMMITTED;
-import static java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
-import static java.sql.Connection.TRANSACTION_REPEATABLE_READ;
-import static java.sql.Connection.TRANSACTION_SERIALIZABLE;
-import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
-
-/**
- * Connection test.
- */
-@SuppressWarnings("ThrowableNotThrown")
-public class JdbcThinConnectionMvccEnabledSelfTest extends JdbcThinAbstractSelfTest {
- /** */
- private static final String URL = "jdbc:ignite:thin://127.0.0.1";
-
- /** {@inheritDoc} */
- @SuppressWarnings({"deprecation", "unchecked"})
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
- cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME).setNearConfiguration(null));
-
- cfg.setMarshaller(new BinaryMarshaller());
- cfg.setGridLogger(new GridStringLogger());
-
- return cfg;
- }
-
- /**
- * @param name Cache name.
- * @return Cache configuration.
- */
- private CacheConfiguration cacheConfiguration(@NotNull String name) {
- CacheConfiguration cfg = defaultCacheConfiguration();
-
- cfg.setName(name);
- cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- super.beforeTestsStarted();
-
- startGridsMultiThreaded(2);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMetadataDefaults() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL)) {
- DatabaseMetaData meta = conn.getMetaData();
-
- assertEquals(TRANSACTION_REPEATABLE_READ, meta.getDefaultTransactionIsolation());
- assertTrue(meta.supportsTransactions());
-
- assertFalse(meta.supportsTransactionIsolationLevel(TRANSACTION_NONE));
- assertFalse(meta.supportsTransactionIsolationLevel(TRANSACTION_READ_UNCOMMITTED));
- assertFalse(meta.supportsTransactionIsolationLevel(TRANSACTION_READ_COMMITTED));
- assertTrue(meta.supportsTransactionIsolationLevel(TRANSACTION_REPEATABLE_READ));
- assertFalse(meta.supportsTransactionIsolationLevel(TRANSACTION_SERIALIZABLE));
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testGetSetAutoCommit() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL)) {
- assertTrue(conn.getMetaData().supportsTransactions());
-
- assertTrue(conn.getAutoCommit());
-
- conn.setAutoCommit(false);
-
- assertFalse(conn.getAutoCommit());
-
- conn.setAutoCommit(true);
-
- assertTrue(conn.getAutoCommit());
-
- conn.close();
-
- // Exception when called on closed connection
- checkConnectionClosed(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.setAutoCommit(true);
- }
- });
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testCommit() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL)) {
- assertTrue(conn.getMetaData().supportsTransactions());
-
- // Should not be called in auto-commit mode
- assertThrows(log,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- conn.commit();
-
- return null;
- }
- },
- SQLException.class,
- "Transaction cannot be committed explicitly in auto-commit mode"
- );
-
- conn.setAutoCommit(false);
-
- conn.commit();
-
- conn.close();
-
- // Exception when called on closed connection
- checkConnectionClosed(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.commit();
- }
- });
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testRollback() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL)) {
- assertTrue(conn.getMetaData().supportsTransactions());
-
- // Should not be called in auto-commit mode
- assertThrows(log,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- conn.rollback();
-
- return null;
- }
- },
- SQLException.class,
- "Transaction cannot be rolled back explicitly in auto-commit mode."
- );
-
- conn.setAutoCommit(false);
-
- conn.rollback();
-
- conn.close();
-
- // Exception when called on closed connection
- checkConnectionClosed(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.rollback();
- }
- });
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testSetSavepoint() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL)) {
- assert !conn.getMetaData().supportsSavepoints();
-
- // Disallowed in auto-commit mode
- assertThrows(log,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- conn.setSavepoint();
-
- return null;
- }
- },
- SQLException.class,
- "Savepoint cannot be set in auto-commit mode"
- );
-
- conn.setAutoCommit(false);
-
- // Unsupported
- checkNotSupported(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.setSavepoint();
- }
- });
-
- conn.close();
-
- checkConnectionClosed(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.setSavepoint();
- }
- });
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testSetSavepointName() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL)) {
- assert !conn.getMetaData().supportsSavepoints();
-
- // Invalid arg
- assertThrows(log,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- conn.setSavepoint(null);
-
- return null;
- }
- },
- SQLException.class,
- "Savepoint name cannot be null"
- );
-
- final String name = "savepoint";
-
- // Disallowed in auto-commit mode
- assertThrows(log,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- conn.setSavepoint(name);
-
- return null;
- }
- },
- SQLException.class,
- "Savepoint cannot be set in auto-commit mode"
- );
-
- conn.setAutoCommit(false);
-
- // Unsupported
- checkNotSupported(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.setSavepoint(name);
- }
- });
-
- conn.close();
-
- checkConnectionClosed(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.setSavepoint(name);
- }
- });
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testRollbackSavePoint() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL)) {
- assert !conn.getMetaData().supportsSavepoints();
-
- // Invalid arg
- assertThrows(log,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- conn.rollback(null);
-
- return null;
- }
- },
- SQLException.class,
- "Invalid savepoint"
- );
-
- final Savepoint savepoint = getFakeSavepoint();
-
- // Disallowed in auto-commit mode
- assertThrows(log,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- conn.rollback(savepoint);
-
- return null;
- }
- },
- SQLException.class,
- "Auto-commit mode"
- );
-
- conn.setAutoCommit(false);
-
- // Unsupported
- checkNotSupported(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.rollback(savepoint);
- }
- });
-
- conn.close();
-
- checkConnectionClosed(new RunnableX() {
- @Override public void runx() throws Exception {
- conn.rollback(savepoint);
- }
- });
- }
- }
-
- /**
- * @return Savepoint.
- */
- private Savepoint getFakeSavepoint() {
- return new Savepoint() {
- @Override public int getSavepointId() throws SQLException {
- return 100;
- }
-
- @Override public String getSavepointName() {
- return "savepoint";
- }
- };
- }
-}
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 f40d34eb4d7..917ac650e28 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
@@ -1294,7 +1294,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest {
* @throws Exception if failed.
*/
@Test
- public void testBeginFailsWhenMvccIsDisabled() throws Exception {
+ public void testBeginFails() throws Exception {
try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp)) {
conn.createStatement().execute("BEGIN");
@@ -1309,7 +1309,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest {
* @throws Exception if failed.
*/
@Test
- public void testCommitIgnoredWhenMvccIsDisabled() throws Exception {
+ public void testCommitIgnored() throws Exception {
try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp)) {
conn.setAutoCommit(false);
conn.createStatement().execute("COMMIT");
@@ -1323,7 +1323,7 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest {
* @throws Exception if failed.
*/
@Test
- public void testRollbackIgnoredWhenMvccIsDisabled() throws Exception {
+ public void testRollbackIgnored() throws Exception {
try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp)) {
conn.setAutoCommit(false);
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMultiStatementSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMultiStatementSelfTest.java
deleted file mode 100644
index b9b36a6dc83..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMultiStatementSelfTest.java
+++ /dev/null
@@ -1,207 +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.jdbc.thin;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import org.apache.ignite.IgniteSystemProperties;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests for ddl queries that contain multiply sql statements, separated by ";".
- */
-public class JdbcThinMultiStatementSelfTest extends GridCommonAbstractTest {
- /** {@inheritDoc} */
- @Override public void beforeTestsStarted() throws Exception {
- System.setProperty(IgniteSystemProperties.IGNITE_SQL_PARSER_DISABLE_H2_FALLBACK, "false");
-
- startGrids(2);
- }
-
- /**
- * Setup tables.
- */
- @Before
- public void setupTables() throws Exception {
- execute("DROP TABLE IF EXISTS TEST_TX; " +
- "DROP TABLE IF EXISTS public.transactions; " +
- "DROP TABLE IF EXISTS ONE;" +
- "DROP TABLE IF EXISTS TWO;");
-
- execute("CREATE TABLE TEST_TX " +
- "(ID INT PRIMARY KEY, AGE INT, NAME VARCHAR) " +
- "WITH \"atomicity=transactional_snapshot\";");
-
- execute("INSERT INTO TEST_TX VALUES " +
- "(1, 17, 'James'), " +
- "(2, 43, 'Valery'), " +
- "(3, 25, 'Michel'), " +
- "(4, 19, 'Nick');");
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- stopAllGrids();
- }
-
- /**
- * Execute sql script using thin driver.
- */
- private void execute(String sql) throws Exception {
- try (Connection c = GridTestUtils.connect(grid(0), null)) {
- try (Statement stmt = c.createStatement()) {
- stmt.executeUpdate(sql);
- }
-
- }
- }
-
- /**
- * Assert that script containing both h2 and non h2 (native) sql statements is handled correctly.
- */
- @Test
- public void testMixedCommands() throws Exception {
- execute("CREATE TABLE public.transactions (pk INT, id INT, k VARCHAR, v VARCHAR, PRIMARY KEY (pk, id)); " +
- "CREATE INDEX transactions_id_k_v ON public.transactions (id, k, v) INLINE_SIZE 150; " +
- "INSERT INTO public.transactions VALUES (1,2,'some', 'word') ; " +
- "CREATE INDEX transactions_k_v_id ON public.transactions (k, v, id) INLINE_SIZE 150; " +
- "CREATE INDEX transactions_pk_id ON public.transactions (pk, id) INLINE_SIZE 20;");
- }
-
- /**
- * Sanity test for scripts, containing empty statements are handled correctly.
- */
- @Test
- public void testEmptyStatements() throws Exception {
- execute(";; ;;;;");
- execute(" ;; ;;;; ");
- execute("CREATE TABLE ONE (id INT PRIMARY KEY, VAL VARCHAR);;" +
- "CREATE INDEX T_IDX ON ONE(val)" +
- ";;UPDATE ONE SET VAL = 'SOME';;; ");
- execute("DROP INDEX T_IDX ;; ;;" +
- "UPDATE ONE SET VAL = 'SOME'");
- }
-
- /**
- * Check multi-statement containing both h2 and native parser statements (having "?" args) works well.
- */
- @Test
- public void testMultiStatementTxWithParams() throws Exception {
- int leoAge = 28;
-
- String nickolas = "Nickolas";
-
- int gabAge = 84;
- String gabName = "Gab";
-
- int delYounger = 19;
-
- String complexQuery =
- "INSERT INTO TEST_TX VALUES (5, ?, 'Leo'); " + // 1
- ";;;;" +
- "BEGIN ; " +
- "UPDATE TEST_TX SET name = ? WHERE name = 'Nick' ;" + // 2
- "INSERT INTO TEST_TX VALUES (6, ?, ?); " + // 3, 4
- "DELETE FROM TEST_TX WHERE age < ?; " + // 5
- "COMMIT;";
-
- try (Connection c = GridTestUtils.connect(grid(0), null)) {
- try (PreparedStatement p = c.prepareStatement(complexQuery)) {
- p.setInt(1, leoAge);
- p.setString(2, nickolas);
- p.setInt(3, gabAge);
- p.setString(4, gabName);
- p.setInt(5, delYounger);
-
- assertFalse("Expected, that first result is an update count.", p.execute());
-
- assertTrue("Expected update count of the INSERT.", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
-
- assertTrue("Expected update count of an empty statement.", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
- assertTrue("Expected update count of an empty statement.", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
- assertTrue("Expected update count of an empty statement.", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
- assertTrue("Expected update count of an empty statement.", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
-
- assertTrue("Expected update count of the BEGIN", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
- assertTrue("Expected update count of the UPDATE", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
- assertTrue("Expected update count of the INSERT", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
- assertTrue("Expected update count of the DELETE", p.getUpdateCount() != -1);
- assertTrue("More results are expected.", p.getMoreResults());
- assertTrue("Expected update count of the COMMIT", p.getUpdateCount() != -1);
-
- assertFalse("There should have been no results.", p.getMoreResults());
- assertFalse("There should have been no update results.", p.getUpdateCount() != -1);
- }
-
- try (PreparedStatement sel = c.prepareStatement("SELECT * FROM TEST_TX ORDER BY ID;")) {
- try (ResultSet pers = sel.executeQuery()) {
- assertTrue(pers.next());
- assertEquals(43, age(pers));
- assertEquals("Valery", name(pers));
-
- assertTrue(pers.next());
- assertEquals(25, age(pers));
- assertEquals("Michel", name(pers));
-
- assertTrue(pers.next());
- assertEquals(19, age(pers));
- assertEquals("Nickolas", name(pers));
-
- assertTrue(pers.next());
- assertEquals(28, age(pers));
- assertEquals("Leo", name(pers));
-
- assertTrue(pers.next());
- assertEquals(84, age(pers));
- assertEquals("Gab", name(pers));
-
- assertFalse(pers.next());
- }
- }
- }
- }
-
- /**
- * Extract person's name from result set.
- */
- private static String name(ResultSet rs) throws SQLException {
- return rs.getString("NAME");
- }
-
- /**
- * Extract person's age from result set.
- */
- private static int age(ResultSet rs) throws SQLException {
- return rs.getInt("AGE");
- }
-
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java
index 1cc3969c40b..e01e2909be3 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java
@@ -35,7 +35,6 @@ import java.util.logging.LogRecord;
import java.util.logging.Logger;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
-import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
@@ -552,60 +551,6 @@ public class JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest extends J
startGridsMultiThreaded(INITIAL_NODES_CNT);
}
- /**
- * Check that there are no retries in case of transactional query.
- *
- * @throws Exception If failed.
- */
- @SuppressWarnings({"unchecked", "ThrowableNotThrown"})
- @Test
- public void testTransactionalQueryFailover() throws Exception {
- try (Connection conn = DriverManager.getConnection(URL_WITH_ONE_PORT)) {
- final String cacheName = UUID.randomUUID().toString().substring(0, 6);
-
- final String sql = "select 1 from \"" + cacheName + "\".Person";
-
- CacheConfiguration<Object, Object> cache = defaultCacheConfiguration().setName(cacheName).
- setNearConfiguration(null).setIndexedTypes(Integer.class, Person.class).
- setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
-
- ignite(0).createCache(cache);
-
- Statement stmt = conn.createStatement();
-
- stmt.execute("BEGIN");
-
- stmt.execute(sql);
-
- stopGrid(0);
-
- logHnd.records.clear();
-
- GridTestUtils.assertThrows(null,
- new Callable<Object>() {
- @Override public Object call() throws Exception {
- stmt.execute(sql);
-
- return null;
- }
- },
- SQLException.class,
- "Failed to communicate with Ignite cluster."
- );
- }
-
- assertEquals("Unexpected log records count.", 1, logHnd.records.size());
-
- LogRecord record = logHnd.records.get(0);
-
- assertEquals("Unexpected log record text.", "Exception during sending an sql request.",
- record.getMessage());
-
- assertEquals("Unexpected log level", Level.FINE, record.getLevel());
-
- startGrid(0);
- }
-
/**
* Check that there are no retries in following cases:
* <ul>
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessTransactionsSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessTransactionsSelfTest.java
deleted file mode 100644
index 47f1da18f42..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessTransactionsSelfTest.java
+++ /dev/null
@@ -1,259 +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.jdbc.thin;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Collection;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.processors.query.NestedTxMode;
-import org.apache.ignite.internal.processors.query.running.QueryHistory;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.jetbrains.annotations.NotNull;
-import org.junit.Test;
-
-/**
- * Jdbc thin transactional partition awareness test.
- */
-public class JdbcThinPartitionAwarenessTransactionsSelfTest extends JdbcThinAbstractSelfTest {
- /** */
- private static final String URL = "jdbc:ignite:thin://127.0.0.1:10800..10802?partitionAwareness=true";
-
- /** Nodes count. */
- private static final int NODES_CNT = 3;
-
- /** Query execution multiplier. */
- private static final int QUERY_EXECUTION_MULTIPLIER = 5;
-
- /** Connection. */
- private Connection conn;
-
- /** Statement. */
- private Statement stmt;
-
- /** {@inheritDoc} */
- @SuppressWarnings({"deprecation", "unchecked"})
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- return super.getConfiguration(igniteInstanceName)
- .setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME).setNearConfiguration(null))
- .setMarshaller(new BinaryMarshaller());
- }
-
- /**
- * @param name Cache name.
- * @return Cache configuration.
- */
- private CacheConfiguration cacheConfiguration(@NotNull String name) {
- return defaultCacheConfiguration()
- .setName(name)
- .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- super.beforeTestsStarted();
-
- startGridsMultiThreaded(NODES_CNT);
-
- try (Connection c = prepareConnection(true, NestedTxMode.ERROR)) {
- try (Statement stmt = c.createStatement()) {
- stmt.execute("CREATE TABLE Person (id int primary key, firstName varchar, lastName varchar, age int) " +
- "WITH \"cache_name=persons,wrap_value=true,atomicity=transactional_snapshot\"");
-
- stmt.executeUpdate("insert into Person (id, firstName, lastName, age) values (1, 'John1', 'Dow1', 1);" +
- "insert into Person (id, firstName, lastName, age) values (2, 'John2', 'Dow2', 2);" +
- "insert into Person (id, firstName, lastName, age) values (3, 'John3', 'Dow3', 3);");
- }
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- conn = DriverManager.getConnection(URL);
-
- stmt = conn.createStatement();
-
- assert stmt != null;
- assert !stmt.isClosed();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- U.closeQuiet(stmt);
-
- conn.close();
-
- assert stmt.isClosed();
- assert conn.isClosed();
- }
-
- /**
- * @param autoCommit Auto commit mode.
- * @param nestedTxMode Nested transactions mode.
- * @return Connection.
- * @throws SQLException if failed.
- */
- private static Connection prepareConnection(boolean autoCommit, NestedTxMode nestedTxMode) throws SQLException {
- Connection res = DriverManager.getConnection(URL + "&nestedTransactionsMode=" + nestedTxMode.name());
-
- res.setAutoCommit(autoCommit);
-
- return res;
- }
-
- /**
- * Check that queries goes to the same node within transaction.
- *
- * @throws Exception If failed.
- */
- @Test
- public void testExecuteQueries() throws Exception {
- stmt.execute("BEGIN");
- checkNodesUsage("select * from Person where _key = 1", 1, false);
- stmt.execute("COMMIT");
-
- stmt.execute("BEGIN");
- checkNodesUsage("select * from Person where _key = 1 or _key = 2", 2, false);
- stmt.execute("COMMIT");
-
- stmt.execute("BEGIN");
- checkNodesUsage("select * from Person where _key in (1, 2)", 2, false);
- stmt.execute("COMMIT");
- }
-
- /**
- * Check that dml queries(updates) goes to the same node within transaction.
- *
- * @throws Exception If failed.
- */
- @Test
- public void testUpdateQueries() throws Exception {
- stmt.execute("BEGIN");
- checkNodesUsage("update Person set firstName = 'TestFirstName' where _key = 1", 1,
- true);
- stmt.execute("COMMIT");
-
- stmt.execute("BEGIN");
- checkNodesUsage("update Person set firstName = 'TestFirstName' where _key = 1 or _key = 2",
- 2, true);
- stmt.execute("COMMIT");
-
- stmt.execute("BEGIN");
- checkNodesUsage("update Person set firstName = 'TestFirstName' where _key in (1, 2)",
- 2, true);
- stmt.execute("COMMIT");
- }
-
- /**
- * Check that dml queries(delete) goes to the same node within transaction.
- *
- * @throws Exception If failed.
- */
- @Test
- public void testDeleteQueries() throws Exception {
- stmt.execute("BEGIN");
- checkNodesUsage("delete from Person where _key = 1000 or _key = 2000", 0, true);
- stmt.execute("COMMIT");
-
- stmt.execute("BEGIN");
- checkNodesUsage("delete from Person where _key in (1000, 2000)", 0, true);
- stmt.execute("COMMIT");
- }
-
- /**
- * Utility method that:
- * 1. warms up an affinity cache;
- * 2. resets query history;
- * 3. executes given query multiple times;
- * 4. checks query history metrics in order to verify that not more than expected nodes were used.
- *
- * @param sql Sql query, either prepared statement or sql query should be used.
- * @param expRowsCnt Expected rows count within result.
- * @param dml Flag that signals whether we execute dml or not.
- * @throws Exception If failed.
- */
- private void checkNodesUsage(String sql, int expRowsCnt, boolean dml)
- throws Exception {
- // Warm up an affinity cache.
- if (dml)
- stmt.executeUpdate(sql);
- else
- stmt.executeQuery(sql);
-
- // Reset query history.
- for (int i = 0; i < NODES_CNT; i++)
- grid(i).context().query().runningQueryManager().resetQueryHistoryMetrics();
-
- // Execute query multiple times
- for (int i = 0; i < NODES_CNT * QUERY_EXECUTION_MULTIPLIER; i++) {
- ResultSet rs = null;
-
- int updatedRowsCnt = 0;
-
- if (dml)
- updatedRowsCnt = stmt.executeUpdate(sql);
- else
- rs = stmt.executeQuery(sql);
-
- if (dml) {
- assertEquals("Unexpected updated rows count: expected [" + expRowsCnt + "]," +
- " got [" + updatedRowsCnt + "]", expRowsCnt, updatedRowsCnt);
- }
- else {
- assert rs != null;
-
- int gotRowsCnt = 0;
-
- while (rs.next())
- gotRowsCnt++;
-
- assertEquals("Unexpected rows count: expected [" + expRowsCnt + "], got [" + gotRowsCnt + "]",
- expRowsCnt, gotRowsCnt);
- }
- }
-
- // Check query history metrics in order to verify that not more than expected nodes were used.
- int nonEmptyMetricsCntr = 0;
- int qryExecutionsCntr = 0;
-
- for (int i = 0; i < NODES_CNT; i++) {
- Collection<QueryHistory> metrics = grid(i).context().query().runningQueryManager()
- .queryHistoryMetrics().values();
-
- if (!metrics.isEmpty()) {
- nonEmptyMetricsCntr++;
- qryExecutionsCntr += new ArrayList<>(metrics).get(0).executions();
- }
- }
-
- assertTrue("Unexpected amount of used nodes: expected [0 < nodesCnt <= 1" +
- "], got [" + nonEmptyMetricsCntr + "]",
- nonEmptyMetricsCntr == 1);
-
- assertEquals("Executions count doesn't match expeted value: expected [" +
- NODES_CNT * QUERY_EXECUTION_MULTIPLIER + "], got [" + qryExecutionsCntr + "]",
- NODES_CNT * QUERY_EXECUTION_MULTIPLIER, qryExecutionsCntr);
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsAbstractComplexSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsAbstractComplexSelfTest.java
deleted file mode 100644
index 067ea3942b9..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsAbstractComplexSelfTest.java
+++ /dev/null
@@ -1,1063 +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.jdbc.thin;
-
-import java.sql.BatchUpdateException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CountDownLatch;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
-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;
-import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.junit.Test;
-
-/**
- * Test to check various transactional scenarios.
- */
-public abstract class JdbcThinTransactionsAbstractComplexSelfTest extends JdbcThinAbstractSelfTest {
- /** Client node index. */
- static final int CLI_IDX = 1;
-
- /**
- * Closure to perform ordinary delete after repeatable read.
- */
- private final IgniteInClosure<Connection> afterReadDel = new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where firstname = 'John'");
- }
- };
-
- /**
- * Closure to perform fast delete after repeatable read.
- */
- private final IgniteInClosure<Connection> afterReadFastDel = new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where id = 1");
- }
- };
-
- /**
- * Closure to perform ordinary update after repeatable read.
- */
- private final IgniteInClosure<Connection> afterReadUpdate = new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "UPDATE \"Person\".Person set firstname = 'Joe' where firstname = 'John'");
- }
- };
-
- /**
- * Closure to perform ordinary delete and rollback after repeatable read.
- */
- private final IgniteInClosure<Connection> afterReadDelAndRollback = new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where firstname = 'John'");
-
- rollback(conn);
- }
- };
-
- /**
- * Closure to perform fast delete after repeatable read.
- */
- private final IgniteInClosure<Connection> afterReadFastDelAndRollback = new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where id = 1");
-
- rollback(conn);
- }
- };
-
- /**
- * Closure to perform ordinary update and rollback after repeatable read.
- */
- private final IgniteInClosure<Connection> afterReadUpdateAndRollback = new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "UPDATE \"Person\".Person set firstname = 'Joe' where firstname = 'John'");
-
- rollback(conn);
- }
- };
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String testIgniteInstanceName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(testIgniteInstanceName);
-
- CacheConfiguration<Integer, Person> ccfg = new CacheConfiguration<>("Person");
-
- ccfg.setIndexedTypes(Integer.class, Person.class);
-
- ccfg.getQueryEntities().iterator().next().setKeyFieldName("id");
-
- ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
-
- ccfg.setCacheMode(CacheMode.PARTITIONED);
-
- cfg.setCacheConfiguration(ccfg);
-
- // Let the node with index 1 be client node.
- cfg.setClientMode(F.eq(testIgniteInstanceName, getTestIgniteInstanceName(CLI_IDX)));
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- super.beforeTest();
-
- execute("ALTER TABLE \"Person\".person add if not exists cityid int");
-
- execute("ALTER TABLE \"Person\".person add if not exists companyid int");
-
- execute("CREATE TABLE City (id int primary key, name varchar, population int) WITH " +
- "\"atomicity=transactional_snapshot,template=partitioned,backups=3,cache_name=City\"");
-
- execute("CREATE TABLE Company (id int, \"cityid\" int, name varchar, primary key (id, \"cityid\")) WITH " +
- "\"atomicity=transactional_snapshot,template=partitioned,backups=1,wrap_value=false,affinity_key=cityid," +
- "cache_name=Company\"");
-
- execute("CREATE TABLE Product (id int primary key, name varchar, companyid int) WITH " +
- "\"atomicity=transactional_snapshot,template=partitioned,backups=2,cache_name=Product\"");
-
- execute("CREATE INDEX IF NOT EXISTS prodidx ON Product(companyid)");
-
- execute("CREATE INDEX IF NOT EXISTS persidx ON \"Person\".person(cityid)");
-
- insertPerson(1, "John", "Smith", 1, 1);
- insertPerson(2, "Mike", "Johns", 1, 2);
- insertPerson(3, "Sam", "Jules", 2, 2);
- insertPerson(4, "Alex", "Pope", 2, 3);
- insertPerson(5, "Peter", "Williams", 2, 3);
-
- insertCity(1, "Los Angeles", 5000);
- insertCity(2, "Seattle", 1500);
- insertCity(3, "New York", 12000);
- insertCity(4, "Cupertino", 400);
-
- insertCompany(1, "Microsoft", 2);
- insertCompany(2, "Google", 3);
- insertCompany(3, "Facebook", 1);
- insertCompany(4, "Uber", 1);
- insertCompany(5, "Apple", 4);
-
- insertProduct(1, "Search", 2);
- insertProduct(2, "Windows", 1);
- insertProduct(3, "Mac", 5);
-
- awaitPartitionMapExchange();
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- super.beforeTestsStarted();
-
- startGridsMultiThreaded(4);
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- execute("DELETE FROM \"Person\".Person");
-
- execute("DROP TABLE City");
-
- execute("DROP TABLE Company");
-
- execute("DROP TABLE Product");
-
- super.afterTest();
- }
-
- /**
- *
- */
- @Test
- public void testSingleDmlStatement() throws SQLException {
- insertPerson(6, "John", "Doe", 2, 2);
-
- assertEquals(Collections.singletonList(l(6, "John", "Doe", 2, 2)),
- execute("SELECT * FROM \"Person\".Person where id = 6"));
- }
-
- /**
- *
- */
- @Test
- public void testMultipleDmlStatements() throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- insertPerson(conn, 6, "John", "Doe", 2, 2);
-
- // https://issues.apache.org/jira/browse/IGNITE-6938 - we can only see results of
- // UPDATE of what we have not inserted ourselves.
- execute(conn, "UPDATE \"Person\".person SET lastname = 'Jameson' where lastname = 'Jules'");
-
- execute(conn, "DELETE FROM \"Person\".person where id = 5");
- }
- });
-
- assertEquals(l(
- l(3, "Sam", "Jameson", 2, 2),
- l(6, "John", "Doe", 2, 2)
- ), execute("SELECT * FROM \"Person\".Person where id = 3 or id >= 5 order by id"));
- }
-
- /**
- *
- */
- @Test
- public void testBatchDmlStatements() throws SQLException {
- doBatchedInsert();
-
- assertEquals(l(
- l(6, "John", "Doe", 2, 2),
- l(7, "Mary", "Lee", 1, 3)
- ), execute("SELECT * FROM \"Person\".Person where id > 5 order by id"));
- }
-
- /**
- *
- */
- @Test
- public void testBatchDmlStatementsIntermediateFailure() throws SQLException {
- insertPerson(6, "John", "Doe", 2, 2);
-
- IgniteException e = (IgniteException)GridTestUtils.assertThrows(null, new Callable<Object>() {
- @Override public Object call() throws Exception {
- doBatchedInsert();
-
- return null;
- }
- }, IgniteException.class, "Duplicate key during INSERT [key=KeyCacheObjectImpl " +
- "[part=6, val=6, hasValBytes=true]]");
-
- assertTrue(e.getCause() instanceof BatchUpdateException);
-
- assertEquals(IgniteQueryErrorCode.DUPLICATE_KEY, ((BatchUpdateException)e.getCause()).getErrorCode());
-
- assertTrue(e.getCause().getMessage().contains("Duplicate key during INSERT [key=KeyCacheObjectImpl " +
- "[part=6, val=6, hasValBytes=true]]"));
-
- // First we insert id 7, then 6. Still, 7 is not in the cache as long as the whole batch has failed inside tx.
- assertEquals(Collections.emptyList(), execute("SELECT * FROM \"Person\".Person where id > 6 order by id"));
- }
-
- /**
- *
- */
- private void doBatchedInsert() throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- try {
- try (PreparedStatement ps = conn.prepareStatement("INSERT INTO \"Person\".person " +
- "(id, firstName, lastName, cityId, companyId) values (?, ?, ?, ?, ?)")) {
- ps.setInt(1, 7);
-
- ps.setString(2, "Mary");
-
- ps.setString(3, "Lee");
-
- ps.setInt(4, 1);
-
- ps.setInt(5, 3);
-
- ps.addBatch();
-
- ps.setInt(1, 6);
-
- ps.setString(2, "John");
-
- ps.setString(3, "Doe");
-
- ps.setInt(4, 2);
-
- ps.setInt(5, 2);
-
- ps.addBatch();
-
- ps.executeBatch();
- }
- }
- catch (SQLException e) {
- throw new IgniteException(e);
- }
- }
- });
- }
-
- /**
- *
- */
- @Test
- public void testInsertAndQueryMultipleCaches() throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- insertCity(conn, 5, "St Petersburg", 6000);
-
- insertCompany(conn, 6, "VK", 5);
-
- insertPerson(conn, 6, "Peter", "Sergeev", 5, 6);
- }
- });
-
- try (Connection c = connect("distributedJoins=true")) {
- assertEquals(l(l(5, "St Petersburg", 6000, 6, 5, "VK", 6, "Peter", "Sergeev", 5, 6)),
- execute(c, "SELECT * FROM City left join Company on City.id = Company.\"cityid\" " +
- "left join \"Person\".Person p on City.id = p.cityid WHERE p.id = 6 or company.id = 6"));
- }
- }
-
- /**
- *
- */
- @Test
- public void testColocatedJoinSelectAndInsertInTransaction() throws SQLException {
- // We'd like to put some Google into cities with over 1K population which don't have it yet
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- List<Integer> ids = flat(execute(conn, "SELECT distinct City.id from City left join Company c on " +
- "City.id = c.\"cityid\" where population >= 1000 and c.name <> 'Google' order by City.id"));
-
- assertEqualsCollections(l(1, 2), ids);
-
- int i = 5;
-
- for (int l : ids)
- insertCompany(conn, ++i, "Google", l);
- }
- });
-
- assertEqualsCollections(l("Los Angeles", "Seattle", "New York"), flat(execute("SELECT City.name from City " +
- "left join Company c on city.id = c.\"cityid\" WHERE c.name = 'Google' order by City.id")));
- }
-
- /**
- *
- */
- @Test
- public void testDistributedJoinSelectAndInsertInTransaction() throws SQLException {
- try (Connection c = connect("distributedJoins=true")) {
- // We'd like to put some Google into cities with over 1K population which don't have it yet
- executeInTransaction(c, new TransactionClosure() {
- @Override public void apply(Connection conn) {
- List<?> res = flat(execute(conn, "SELECT p.id,p.name,c.id from Company c left join Product p on " +
- "c.id = p.companyid left join City on city.id = c.\"cityid\" WHERE c.name <> 'Microsoft' " +
- "and population < 1000"));
-
- assertEqualsCollections(l(3, "Mac", 5), res);
-
- insertProduct(conn, 4, (String)res.get(1), 1);
- }
- });
- }
-
- try (Connection c = connect("distributedJoins=true")) {
- assertEqualsCollections(l("Windows", "Mac"), flat(execute(c, "SELECT p.name from Company c left join " +
- "Product p on c.id = p.companyid WHERE c.name = 'Microsoft' order by p.id")));
- }
- }
-
- /**
- *
- */
- @Test
- public void testInsertFromExpression() throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- execute(conn, "insert into city (id, name, population) values (? + 1, ?, ?)",
- 8, "Moscow", 15000);
- }
- });
- }
-
- /**
- *
- */
- @Test
- public void testAutoRollback() throws SQLException {
- try (Connection c = connect()) {
- begin(c);
-
- insertPerson(c, 6, "John", "Doe", 2, 2);
- }
-
- // Connection has not hung on close and update has not been applied.
- assertTrue(personCache().query(new SqlFieldsQuery("SELECT * FROM \"Person\".Person WHERE id = 6"))
- .getAll().isEmpty());
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadWithConcurrentDelete() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where firstname = 'John'");
- }
- }, null);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadWithConcurrentFastDelete() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where id = 1");
- }
- }, null);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadWithConcurrentCacheRemove() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- personCache().remove(1);
- }
- }, null);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndDeleteWithConcurrentDelete() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where firstname = 'John'");
- }
- }, afterReadDel);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndDeleteWithConcurrentFastDelete() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where id = 1");
- }
- }, afterReadDel);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndDeleteWithConcurrentCacheRemove() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- personCache().remove(1);
- }
- }, afterReadDel);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndFastDeleteWithConcurrentDelete() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where firstname = 'John'");
- }
- }, afterReadFastDel);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndFastDeleteWithConcurrentFastDelete() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where id = 1");
- }
- }, afterReadFastDel);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndFastDeleteWithConcurrentCacheRemove() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- personCache().remove(1);
- }
- }, afterReadFastDel);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndDeleteWithConcurrentDeleteAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where firstname = 'John'");
- }
- }, afterReadDelAndRollback);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndDeleteWithConcurrentFastDeleteAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where id = 1");
- }
- }, afterReadDelAndRollback);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndDeleteWithConcurrentCacheRemoveAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- personCache().remove(1);
- }
- }, afterReadDelAndRollback);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndFastDeleteWithConcurrentDeleteAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where firstname = 'John'");
- }
- }, afterReadFastDelAndRollback);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndFastDeleteWithConcurrentFastDeleteAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "DELETE FROM \"Person\".Person where id = 1");
- }
- }, afterReadFastDelAndRollback);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndFastDeleteWithConcurrentCacheRemoveAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- personCache().remove(1);
- }
- }, afterReadFastDelAndRollback);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadWithConcurrentUpdate() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "UPDATE \"Person\".Person SET lastname = 'Fix' where firstname = 'John'");
- }
- }, null);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadWithConcurrentCacheReplace() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- Person p = new Person();
-
- p.id = 1;
- p.firstName = "Luke";
- p.lastName = "Maxwell";
-
- personCache().replace(1, p);
- }
- }, null);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndUpdateWithConcurrentUpdate() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "UPDATE \"Person\".Person SET lastname = 'Fix' where firstname = 'John'");
- }
- }, afterReadUpdate);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndUpdateWithConcurrentCacheReplace() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- Person p = new Person();
-
- p.id = 1;
- p.firstName = "Luke";
- p.lastName = "Maxwell";
-
- personCache().replace(1, p);
- }
- }, afterReadUpdate);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndUpdateWithConcurrentUpdateAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- execute(conn, "UPDATE \"Person\".Person SET lastname = 'Fix' where firstname = 'John'");
- }
- }, afterReadUpdateAndRollback);
- }
-
- /**
- *
- */
- @Test
- public void testRepeatableReadAndUpdateWithConcurrentCacheReplaceAndRollback() throws Exception {
- doTestRepeatableRead(new IgniteInClosure<Connection>() {
- @Override public void apply(Connection conn) {
- Person p = new Person();
-
- p.id = 1;
- p.firstName = "Luke";
- p.lastName = "Maxwell";
-
- personCache().replace(1, p);
- }
- }, afterReadUpdateAndRollback);
- }
-
- /**
- * Perform repeatable reads and concurrent changes.
- * @param concurrentWriteClo Updating closure.
- * @param afterReadClo Closure making write changes that should also be made inside repeatable read transaction
- * (must yield an exception).
- * @throws Exception if failed.
- */
- private void doTestRepeatableRead(final IgniteInClosure<Connection> concurrentWriteClo,
- final IgniteInClosure<Connection> afterReadClo) throws Exception {
- final CountDownLatch repeatableReadLatch = new CountDownLatch(1);
-
- final CountDownLatch initLatch = new CountDownLatch(1);
-
- final IgniteInternalFuture<?> readFut = multithreadedAsync(new Callable<Object>() {
- @Override public Object call() throws Exception {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- List<?> before = flat(execute(conn, "SELECT * from \"Person\".Person where id = 1"));
-
- assertEqualsCollections(l(1, "John", "Smith", 1, 1), before);
-
- initLatch.countDown();
-
- try {
- U.await(repeatableReadLatch);
- }
- catch (IgniteInterruptedCheckedException e) {
- throw new IgniteException(e);
- }
-
- List<?> after = flat(execute(conn, "SELECT * from \"Person\".Person where id = 1"));
-
- assertEqualsCollections(before, after);
-
- if (afterReadClo != null)
- afterReadClo.apply(conn);
- }
- });
-
- return null;
- }
- }, 1);
-
- IgniteInternalFuture<?> conModFut = multithreadedAsync(new Callable<Object>() {
- @Override public Object call() throws Exception {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- try {
- U.await(initLatch);
- }
- catch (IgniteInterruptedCheckedException e) {
- throw new IgniteException(e);
- }
-
- concurrentWriteClo.apply(conn);
-
- repeatableReadLatch.countDown();
- }
- });
-
- return null;
- }
- }, 1);
-
- conModFut.get();
-
- if (afterReadClo != null) {
- IgniteCheckedException ex = (IgniteCheckedException)GridTestUtils.assertThrows(null, new Callable() {
- @Override public Object call() throws Exception {
- readFut.get();
-
- return null;
- }
- }, IgniteCheckedException.class, "Cannot serialize transaction due to write conflict");
-
- assertTrue(X.hasCause(ex, SQLException.class));
-
- assertTrue(X.getCause(ex).getMessage().contains("Cannot serialize transaction due to write conflict"));
- }
- else
- readFut.get();
- }
-
- /**
- * Create a new connection, a new transaction and run given closure in its scope.
- * @param clo Closure.
- * @throws SQLException if failed.
- */
- private void executeInTransaction(TransactionClosure clo) throws SQLException {
- try (Connection conn = connect()) {
- executeInTransaction(conn, clo);
- }
- }
-
- /**
- * Create a new transaction and run given closure in its scope.
- * @param conn Connection.
- * @param clo Closure.
- * @throws SQLException if failed.
- */
- private void executeInTransaction(Connection conn, TransactionClosure clo) throws SQLException {
- begin(conn);
-
- clo.apply(conn);
-
- commit(conn);
- }
-
- /**
- * @return Auto commit strategy for this test.
- */
- abstract boolean autoCommit();
-
- /**
- * @param c Connection to begin a transaction on.
- */
- private void begin(Connection c) {
- if (autoCommit())
- execute(c, "BEGIN");
- }
-
- /**
- * @param c Connection to begin a transaction on.
- */
- private void commit(Connection c) throws SQLException {
- if (autoCommit())
- execute(c, "COMMIT");
- else
- c.commit();
- }
-
- /**
- * @param c Connection to rollback a transaction on.
- */
- private void rollback(Connection c) {
- try {
- if (autoCommit())
- execute(c, "ROLLBACK");
- else
- c.rollback();
- }
- catch (SQLException e) {
- throw new IgniteException(e);
- }
- }
-
- /**
- * @param sql Statement.
- * @param args Arguments.
- * @return Result set.
- * @throws SQLException if failed.
- */
- List<List<?>> execute(String sql, Object... args) throws SQLException {
- try (Connection c = connect()) {
- c.setAutoCommit(true);
-
- return execute(c, sql, args);
- }
- }
-
- /**
- * @param sql Statement.
- * @param args Arguments.
- * @return Result set.
- * @throws RuntimeException if failed.
- */
- @Override protected List<List<?>> execute(Connection conn, String sql, Object... args) {
- try {
- return super.execute(conn, sql, args);
- }
- catch (SQLException e) {
- throw new IgniteException(e);
- }
- }
-
- /**
- * @return New connection to default node.
- * @throws SQLException if failed.
- */
- private Connection connect() throws SQLException {
- return connect(null);
- }
-
- /**
- * @param params Connection parameters.
- * @return New connection to default node.
- * @throws SQLException if failed.
- */
- private Connection connect(String params) throws SQLException {
- Connection c = connect(node(), params);
-
- c.setAutoCommit(false);
-
- return c;
- }
-
- /**
- * @param node Node to connect to.
- * @param params Connection parameters.
- * @return Thin JDBC connection to specified node.
- */
- @Override protected Connection connect(IgniteEx node, String params) {
- try {
- return super.connect(node, params);
- }
- catch (SQLException e) {
- throw new AssertionError(e);
- }
- }
-
- /**
- * @return Default node to fire queries from.
- */
- private IgniteEx node() {
- return grid(nodeIndex());
- }
-
- /**
- * @return {@link Person} cache.
- */
- private IgniteCache<Integer, Person> personCache() {
- return node().cache("Person");
- }
-
- /**
- * @return Node index to fire queries from.
- */
- abstract int nodeIndex();
-
- /**
- * @param id New person's id.
- * @param firstName First name.
- * @param lastName Second name.
- * @param cityId City id.
- * @param companyId Company id.
- * @throws SQLException if failed.
- */
- private void insertPerson(final int id, final String firstName, final String lastName, final int cityId,
- final int companyId) throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- insertPerson(conn, id, firstName, lastName, cityId, companyId);
- }
- });
- }
-
- /**
- * @param c Connection.
- * @param id New person's id.
- * @param firstName First name.
- * @param lastName Second name.
- * @param cityId City id.
- * @param companyId Company id.
- */
- private void insertPerson(Connection c, int id, String firstName, String lastName, int cityId, int companyId) {
- execute(c, "INSERT INTO \"Person\".person (id, firstName, lastName, cityId, companyId) values (?, ?, ?, ?, ?)",
- id, firstName, lastName, cityId, companyId);
- }
-
- /**
- * @param id New city's id.
- * @param name City name.
- * @param population Number of people.
- * @throws SQLException if failed.
- */
- private void insertCity(final int id, final String name, final int population) throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- insertCity(conn, id, name, population);
- }
- });
- }
-
- /**
- * @param c Connection.
- * @param id New city's id.
- * @param name City name.
- * @param population Number of people.
- */
- private void insertCity(Connection c, int id, String name, int population) {
- execute(c, "INSERT INTO city (id, name, population) values (?, ?, ?)", id, name, population);
- }
-
- /**
- * @param id New company's id.
- * @param name Company name.
- * @param cityId City id.
- * @throws SQLException if failed.
- */
- private void insertCompany(final int id, final String name, final int cityId) throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- insertCompany(conn, id, name, cityId);
- }
- });
- }
-
- /**
- * @param c Connection.
- * @param id New company's id.
- * @param name Company name.
- * @param cityId City id.
- */
- private void insertCompany(Connection c, int id, String name, int cityId) {
- execute(c, "INSERT INTO company (id, name, \"cityid\") values (?, ?, ?)", id, name, cityId);
- }
-
- /**
- * @param id New product's id.
- * @param name Product name.
- * @param companyId Company id..
- * @throws SQLException if failed.
- */
- private void insertProduct(final int id, final String name, final int companyId) throws SQLException {
- executeInTransaction(new TransactionClosure() {
- @Override public void apply(Connection conn) {
- insertProduct(conn, id, name, companyId);
- }
- });
- }
-
- /**
- * @param c Connection.
- * @param id New product's id.
- * @param name Product name.
- * @param companyId Company id..
- */
- private void insertProduct(Connection c, int id, String name, int companyId) {
- execute(c, "INSERT INTO product (id, name, companyid) values (?, ?, ?)", id, name, companyId);
- }
-
- /**
- * Person class.
- */
- private static final class Person {
- /** */
- @QuerySqlField
- public int id;
-
- /** */
- @QuerySqlField
- public String firstName;
-
- /** */
- @QuerySqlField
- public String lastName;
- }
-
- /**
- * Closure to be executed in scope of a transaction.
- */
- private abstract static class TransactionClosure implements IgniteInClosure<Connection> {
- // No-op.
- }
-
- /**
- * @return List of given arguments.
- */
- private static List<?> l(Object... args) {
- return F.asList(args);
- }
-
- /**
- * Flatten rows.
- * @param rows Rows.
- * @return Rows as a single list.
- */
- private static <T> List<T> flat(Collection<? extends Collection<?>> rows) {
- return new ArrayList<>(F.flatCollections((Collection<? extends Collection<T>>)rows));
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsClientAutoCommitComplexSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsClientAutoCommitComplexSelfTest.java
deleted file mode 100644
index d5b505a784a..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsClientAutoCommitComplexSelfTest.java
+++ /dev/null
@@ -1,33 +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.jdbc.thin;
-
-/**
- *
- */
-public class JdbcThinTransactionsClientAutoCommitComplexSelfTest extends JdbcThinTransactionsAbstractComplexSelfTest {
- /** {@inheritDoc} */
- @Override boolean autoCommit() {
- return true;
- }
-
- /** {@inheritDoc} */
- @Override int nodeIndex() {
- return CLI_IDX;
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsClientNoAutoCommitComplexSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsClientNoAutoCommitComplexSelfTest.java
deleted file mode 100644
index 7fa69fdc468..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsClientNoAutoCommitComplexSelfTest.java
+++ /dev/null
@@ -1,33 +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.jdbc.thin;
-
-/**
- *
- */
-public class JdbcThinTransactionsClientNoAutoCommitComplexSelfTest extends JdbcThinTransactionsAbstractComplexSelfTest {
- /** {@inheritDoc} */
- @Override boolean autoCommit() {
- return false;
- }
-
- /** {@inheritDoc} */
- @Override int nodeIndex() {
- return CLI_IDX;
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsLeaksMvccTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsLeaksMvccTest.java
deleted file mode 100644
index 8da619d3bec..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsLeaksMvccTest.java
+++ /dev/null
@@ -1,151 +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.jdbc.thin;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Set;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.query.NestedTxMode;
-import org.apache.ignite.internal.processors.query.h2.ConnectionManager;
-import org.apache.ignite.internal.processors.query.h2.H2Connection;
-import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.WithSystemProperty;
-import org.junit.Test;
-
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_MAX_COMPLETED_TX_COUNT;
-
-/**
- * Tests to check leaks at the ConnectionManager#detachedConns map.
- */
-public class JdbcThinTransactionsLeaksMvccTest extends JdbcThinAbstractSelfTest {
- /** */
- private static final String URL = "jdbc:ignite:thin://127.0.0.1";
-
- /** Keys count. */
- private static final int KEYS = 10;
-
- /** Iterations count. */
- private static final int ITERATIONS = 1_000;
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- return super.getConfiguration(igniteInstanceName)
- .setSystemWorkerBlockedTimeout(Long.MAX_VALUE);
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- super.beforeTest();
-
- startGrids(3);
-
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("CREATE TABLE TEST (k int primary key, v int) WITH \"atomicity=transactional_snapshot\"");
-
- for (int i = 0; i < KEYS; ++i)
- s.execute("INSERT INTO TEST VALUES (" + i + ", " + i + ")");
-
- }
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
- }
-
- /**
- * @param autoCommit Auto commit mode.
- * @param nestedTxMode Nested transactions mode.
- * @return Connection.
- * @throws SQLException if failed.
- */
- private static Connection c(boolean autoCommit, NestedTxMode nestedTxMode) throws SQLException {
- Connection res = DriverManager.getConnection(URL + "/?nestedTransactionsMode=" + nestedTxMode.name());
-
- res.setAutoCommit(autoCommit);
-
- return res;
- }
-
- /**
- *
- */
- @Test
- @WithSystemProperty(key = IGNITE_MAX_COMPLETED_TX_COUNT, value = "1024")
- public void testLeaks() {
- runQueries(ITERATIONS);
-
- int prevUsedConns = usedConnectionCount(grid(0));
-
- runQueries(ITERATIONS * 2);
-
- int curUsedConns = usedConnectionCount(grid(0));
-
- assertTrue("Detached connection leaks: prevSize=" + prevUsedConns + ", curSize=" + curUsedConns,
- curUsedConns < prevUsedConns * 2 + 1);
- }
-
- /**
- * @param iters Count of queries.
- */
- private void runQueries(int iters) {
- for (int i = 0; i < iters; ++i) {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("BEGIN");
-
- s.execute("SELECT * FROM TEST");
-
- ResultSet rs = s.getResultSet();
-
- int cnt = 0;
-
- while (rs.next())
- ++cnt;
-
- assertEquals(KEYS, cnt);
-
- c.commit();
- }
- }
- catch (SQLException e) {
- throw new AssertionError(e);
- }
- }
- }
-
- /**
- * @param igx Node.
- * @return Count of detached connections.
- */
- private int usedConnectionCount(IgniteEx igx) {
- ConnectionManager connMgr = ((IgniteH2Indexing)igx.context().query().getIndexing()).connections();
-
- Set<H2Connection> usedConns = GridTestUtils.getFieldValue(connMgr, "usedConns");
-
- return usedConns.size();
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsSelfTest.java
deleted file mode 100644
index 7100eb73ed8..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsSelfTest.java
+++ /dev/null
@@ -1,468 +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.jdbc.thin;
-
-import java.sql.BatchUpdateException;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.concurrent.Callable;
-import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.processors.query.NestedTxMode;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.GridStringLogger;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.jetbrains.annotations.NotNull;
-import org.junit.Test;
-
-/**
- * Tests to check behavior with transactions on.
- */
-public class JdbcThinTransactionsSelfTest extends JdbcThinAbstractSelfTest {
- /** */
- private static final String URL = "jdbc:ignite:thin://127.0.0.1";
-
- /** Logger. */
- private GridStringLogger log;
-
- /** {@inheritDoc} */
- @SuppressWarnings({"deprecation", "unchecked"})
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
- cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME).setNearConfiguration(null));
-
- cfg.setMarshaller(new BinaryMarshaller());
-
- cfg.setGridLogger(log = new GridStringLogger());
-
- return cfg;
- }
-
- /**
- * @param name Cache name.
- * @return Cache configuration.
- * @throws Exception In case of error.
- */
- private CacheConfiguration cacheConfiguration(@NotNull String name) throws Exception {
- CacheConfiguration cfg = defaultCacheConfiguration();
-
- cfg.setName(name);
- cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- super.beforeTest();
-
- startGrid(0);
-
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("CREATE TABLE INTS (k int primary key, v int) WITH \"cache_name=ints,wrap_value=false," +
- "atomicity=transactional_snapshot\"");
- }
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
- }
-
- /**
- * @param autoCommit Auto commit mode.
- * @param nestedTxMode Nested transactions mode.
- * @return Connection.
- * @throws SQLException if failed.
- */
- private static Connection c(boolean autoCommit, NestedTxMode nestedTxMode) throws SQLException {
- Connection res = DriverManager.getConnection(URL + "/?nestedTransactionsMode=" + nestedTxMode.name());
-
- res.setAutoCommit(autoCommit);
-
- return res;
- }
-
- /**
- *
- */
- @Test
- public void testTransactionsBeginCommitRollback() throws IgniteCheckedException {
- final AtomicBoolean stop = new AtomicBoolean();
-
- IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Runnable() {
- @Override public void run() {
- try {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- while (!stop.get()) {
- try (Statement s = c.createStatement()) {
- s.execute("BEGIN");
-
- c.commit();
-
- s.execute("BEGIN");
-
- c.rollback();
- }
- }
- }
- }
- catch (SQLException e) {
- throw new AssertionError(e);
- }
- }
- }, 8, "jdbc-transactions");
-
- U.sleep(5000);
-
- stop.set(true);
-
- fut.get();
- }
-
- /**
- *
- */
- @Test
- public void testTransactionsBeginCommitRollbackAutocommit() throws IgniteCheckedException {
- GridTestUtils.runMultiThreadedAsync(new Runnable() {
- @Override public void run() {
- try {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("BEGIN");
-
- s.execute("COMMIT");
-
- s.execute("BEGIN");
-
- s.execute("ROLLBACK");
- }
- }
- }
- catch (SQLException e) {
- throw new AssertionError(e);
- }
- }
- }, 8, "jdbc-transactions").get();
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOff() throws SQLException {
- try (Connection c = c(false, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, false);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOff() throws SQLException {
- try (Connection c = c(false, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, false);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOff() throws SQLException {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- doNestedTxStart(c, false);
- }
-
- throw new AssertionError();
- }
- }, SQLException.class, "Transaction has already been started.");
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOn() throws SQLException {
- try (Connection c = c(true, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, false);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOn() throws SQLException {
- try (Connection c = c(true, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, false);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOn() throws SQLException {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- doNestedTxStart(c, false);
- }
-
- throw new AssertionError();
- }
- }, SQLException.class, "Transaction has already been started.");
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOffBatched() throws SQLException {
- try (Connection c = c(false, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, true);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOffBatched() throws SQLException {
- try (Connection c = c(false, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, true);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOffBatched() throws SQLException {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- doNestedTxStart(c, true);
- }
-
- throw new AssertionError();
- }
- }, BatchUpdateException.class, "Transaction has already been started.");
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOnBatched() throws SQLException {
- try (Connection c = c(true, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, true);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOnBatched() throws SQLException {
- try (Connection c = c(true, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, true);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOnBatched() throws SQLException {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- doNestedTxStart(c, true);
- }
-
- throw new AssertionError();
- }
- }, BatchUpdateException.class, "Transaction has already been started.");
- }
-
- /**
- * Try to start nested transaction via batch as well as separate statements.
- * @param conn Connection.
- * @param batched Whether {@link Statement#executeBatch()} should be used.
- * @throws SQLException if failed.
- */
- private void doNestedTxStart(Connection conn, boolean batched) throws SQLException {
- try (Statement s = conn.createStatement()) {
- s.executeQuery("SELECT * FROM INTS");
-
- if (batched) {
- s.addBatch("BEGIN");
-
- s.addBatch("BEGIN");
-
- s.executeBatch();
- }
- else {
- s.execute("BEGIN");
-
- s.execute("BEGIN");
- }
- }
- }
-
- /**
- * @throws SQLException if failed.
- */
- @Test
- public void testAutoCommitSingle() throws SQLException {
- doTestAutoCommit(false);
- }
-
- /**
- * @throws SQLException if failed.
- */
- @Test
- public void testAutoCommitBatched() throws SQLException {
- doTestAutoCommit(true);
- }
-
- /**
- * @param batched Batch mode flag.
- * @throws SQLException if failed.
- */
- private void doTestAutoCommit(boolean batched) throws SQLException {
- IgniteCache<Integer, ?> cache = grid(0).cache("ints");
-
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- assertFalse(s.executeQuery("SELECT * from INTS").next());
-
- if (batched) {
- s.addBatch("INSERT INTO INTS(k, v) values(1, 1)");
-
- s.executeBatch();
- }
- else
- s.execute("INSERT INTO INTS(k, v) values(1, 1)");
-
- // We haven't committed anything yet - this check shows that autoCommit flag is in effect.
- assertTrue(cache.query(new SqlFieldsQuery("SELECT * from INTS")).getAll().isEmpty());
-
- // We should see own updates.
- assertTrue(s.executeQuery("SELECT * from INTS").next());
-
- c.commit();
-
- c.setAutoCommit(true);
-
- assertEquals(1, cache.get(1));
-
- assertTrue(s.executeQuery("SELECT * from INTS").next());
- }
- }
- }
-
- /**
- * Test that exception in one of the statements does not kill connection worker altogether.
- * @throws SQLException if failed.
- */
- @Test
- public void testExceptionHandling() throws SQLException {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("INSERT INTO INTS(k, v) values(1, 1)");
-
- assertEquals(1, grid(0).cache("ints").get(1));
-
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- s.execute("INSERT INTO INTS(x, y) values(1, 1)");
-
- return null;
- }
- }, SQLException.class, "Failed to parse query");
-
- s.execute("INSERT INTO INTS(k, v) values(2, 2)");
-
- assertEquals(2, grid(0).cache("ints").get(2));
- }
- }
- }
-
- /**
- * Test that exception in one of the statements does not kill connection worker altogether.
- * @throws SQLException if failed.
- */
- @Test
- public void testParsingErrorHasNoSideEffect() throws SQLException {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("INSERT INTO INTS(k, v) values(1, 1)");
-
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- s.execute("INSERT INTO INTS(k, v) values(1)");
-
- return null;
- }
- }, SQLException.class, "Failed to parse query");
-
- s.execute("INSERT INTO INTS(k, v) values(2, 2)");
-
- c.commit();
- }
-
- assertEquals(1, grid(0).cache("ints").get(1));
- assertEquals(2, grid(0).cache("ints").get(2));
- }
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsServerAutoCommitComplexSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsServerAutoCommitComplexSelfTest.java
deleted file mode 100644
index 3c473ab872d..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsServerAutoCommitComplexSelfTest.java
+++ /dev/null
@@ -1,33 +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.jdbc.thin;
-
-/**
- *
- */
-public class JdbcThinTransactionsServerAutoCommitComplexSelfTest extends JdbcThinTransactionsAbstractComplexSelfTest {
- /** {@inheritDoc} */
- @Override boolean autoCommit() {
- return true;
- }
-
- /** {@inheritDoc} */
- @Override int nodeIndex() {
- return 0;
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsServerNoAutoCommitComplexSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsServerNoAutoCommitComplexSelfTest.java
deleted file mode 100644
index 655d4c5c8f9..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsServerNoAutoCommitComplexSelfTest.java
+++ /dev/null
@@ -1,33 +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.jdbc.thin;
-
-/**
- *
- */
-public class JdbcThinTransactionsServerNoAutoCommitComplexSelfTest extends JdbcThinTransactionsAbstractComplexSelfTest {
- /** {@inheritDoc} */
- @Override boolean autoCommit() {
- return false;
- }
-
- /** {@inheritDoc} */
- @Override int nodeIndex() {
- return 0;
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsWithMvccEnabledSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsWithMvccEnabledSelfTest.java
deleted file mode 100644
index 5521d85ebf6..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinTransactionsWithMvccEnabledSelfTest.java
+++ /dev/null
@@ -1,439 +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.jdbc.thin;
-
-import java.sql.BatchUpdateException;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.concurrent.Callable;
-import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.processors.query.NestedTxMode;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.GridStringLogger;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.jetbrains.annotations.NotNull;
-import org.junit.Test;
-
-/**
- * Tests to check behavior with transactions on.
- */
-public class JdbcThinTransactionsWithMvccEnabledSelfTest extends JdbcThinAbstractSelfTest {
- /** */
- private static final String URL = "jdbc:ignite:thin://127.0.0.1";
-
- /** Logger. */
- private GridStringLogger log;
-
- /** {@inheritDoc} */
- @SuppressWarnings({"deprecation", "unchecked"})
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
- cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME).setNearConfiguration(null));
-
- cfg.setMarshaller(new BinaryMarshaller());
-
- cfg.setGridLogger(log = new GridStringLogger());
-
- return cfg;
- }
-
- /**
- * @param name Cache name.
- * @return Cache configuration.
- */
- private CacheConfiguration cacheConfiguration(@NotNull String name) {
- CacheConfiguration cfg = defaultCacheConfiguration();
-
- cfg.setName(name);
- cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- super.beforeTest();
-
- startGrid(0);
-
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("CREATE TABLE INTS (k int primary key, v int) WITH \"cache_name=ints,wrap_value=false," +
- "atomicity=transactional_snapshot\"");
- }
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
- }
-
- /**
- * @param autoCommit Auto commit mode.
- * @param nestedTxMode Nested transactions mode.
- * @return Connection.
- * @throws SQLException if failed.
- */
- private static Connection c(boolean autoCommit, NestedTxMode nestedTxMode) throws SQLException {
- Connection res = DriverManager.getConnection(URL + "/?nestedTransactionsMode=" + nestedTxMode.name());
-
- res.setAutoCommit(autoCommit);
-
- return res;
- }
-
- /**
- *
- */
- @Test
- public void testTransactionsBeginCommitRollback() throws IgniteCheckedException {
- final AtomicBoolean stop = new AtomicBoolean();
-
- IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Runnable() {
- @Override public void run() {
- try {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- while (!stop.get()) {
- try (Statement s = c.createStatement()) {
- s.execute("BEGIN");
-
- c.commit();
-
- s.execute("BEGIN");
-
- c.rollback();
- }
- }
- }
- }
- catch (SQLException e) {
- throw new AssertionError(e);
- }
- }
- }, 8, "jdbc-transactions");
-
- U.sleep(5000);
-
- stop.set(true);
-
- fut.get();
- }
-
- /**
- *
- */
- @Test
- public void testTransactionsBeginCommitRollbackAutocommit() throws IgniteCheckedException {
- GridTestUtils.runMultiThreadedAsync(new Runnable() {
- @Override public void run() {
- try {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("BEGIN");
-
- s.execute("COMMIT");
-
- s.execute("BEGIN");
-
- s.execute("ROLLBACK");
- }
- }
- }
- catch (SQLException e) {
- throw new AssertionError(e);
- }
- }
- }, 8, "jdbc-transactions").get();
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOff() throws SQLException {
- try (Connection c = c(false, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, false);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOff() throws SQLException {
- try (Connection c = c(false, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, false);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOff() {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- doNestedTxStart(c, false);
- }
-
- throw new AssertionError();
- }
- }, SQLException.class, "Transaction has already been started.");
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOn() throws SQLException {
- try (Connection c = c(true, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, false);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOn() throws SQLException {
- try (Connection c = c(true, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, false);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOn() {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- doNestedTxStart(c, false);
- }
-
- throw new AssertionError();
- }
- }, SQLException.class, "Transaction has already been started.");
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOffBatched() throws SQLException {
- try (Connection c = c(false, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, true);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOffBatched() throws SQLException {
- try (Connection c = c(false, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, true);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOffBatched() {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- doNestedTxStart(c, true);
- }
-
- throw new AssertionError();
- }
- }, BatchUpdateException.class, "Transaction has already been started.");
- }
-
- /**
- *
- */
- @Test
- public void testIgnoreNestedTxAutocommitOnBatched() throws SQLException {
- try (Connection c = c(true, NestedTxMode.IGNORE)) {
- doNestedTxStart(c, true);
- }
-
- assertTrue(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testCommitNestedTxAutocommitOnBatched() throws SQLException {
- try (Connection c = c(true, NestedTxMode.COMMIT)) {
- doNestedTxStart(c, true);
- }
-
- assertFalse(log.toString().contains("ignoring BEGIN command"));
- }
-
- /**
- *
- */
- @Test
- public void testErrorNestedTxAutocommitOnBatched() {
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- doNestedTxStart(c, true);
- }
-
- throw new AssertionError();
- }
- }, BatchUpdateException.class, "Transaction has already been started.");
- }
-
- /**
- * Try to start nested transaction via batch as well as separate statements.
- * @param conn Connection.
- * @param batched Whether {@link Statement#executeBatch()} should be used.
- * @throws SQLException if failed.
- */
- private void doNestedTxStart(Connection conn, boolean batched) throws SQLException {
- try (Statement s = conn.createStatement()) {
- s.executeQuery("SELECT * FROM INTS");
-
- if (batched) {
- s.addBatch("BEGIN");
-
- s.addBatch("BEGIN");
-
- s.executeBatch();
- }
- else {
- s.execute("BEGIN");
-
- s.execute("BEGIN");
- }
- }
- }
-
- /**
- * @throws SQLException if failed.
- */
- @Test
- public void testAutoCommitSingle() throws SQLException {
- doTestAutoCommit(false);
- }
-
- /**
- * @throws SQLException if failed.
- */
- @Test
- public void testAutoCommitBatched() throws SQLException {
- doTestAutoCommit(true);
- }
-
- /**
- * @param batched Batch mode flag.
- * @throws SQLException if failed.
- */
- private void doTestAutoCommit(boolean batched) throws SQLException {
- IgniteCache<Integer, ?> cache = grid(0).cache("ints");
-
- try (Connection c = c(false, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- assertFalse(s.executeQuery("SELECT * from INTS").next());
-
- if (batched) {
- s.addBatch("INSERT INTO INTS(k, v) values(1, 1)");
-
- s.executeBatch();
- }
- else
- s.execute("INSERT INTO INTS(k, v) values(1, 1)");
-
- // We haven't committed anything yet - this check shows that autoCommit flag is in effect.
- assertTrue(cache.query(new SqlFieldsQuery("SELECT * from INTS")).getAll().isEmpty());
-
- // We should see own updates.
- assertTrue(s.executeQuery("SELECT * from INTS").next());
-
- c.commit();
-
- c.setAutoCommit(true);
-
- assertEquals(1, cache.get(1));
-
- assertTrue(s.executeQuery("SELECT * from INTS").next());
- }
- }
- }
-
- /**
- * Test that exception in one of the statements does not kill connection worker altogether.
- * @throws SQLException if failed.
- */
- @Test
- public void testExceptionHandling() throws SQLException {
- try (Connection c = c(true, NestedTxMode.ERROR)) {
- try (Statement s = c.createStatement()) {
- s.execute("INSERT INTO INTS(k, v) values(1, 1)");
-
- assertEquals(1, grid(0).cache("ints").get(1));
-
- GridTestUtils.assertThrows(null, new Callable<Void>() {
- @Override public Void call() throws Exception {
- s.execute("INSERT INTO INTS(x, y) values(1, 1)");
-
- return null;
- }
- }, SQLException.class, "Failed to parse query");
-
- s.execute("INSERT INTO INTS(k, v) values(2, 2)");
-
- assertEquals(2, grid(0).cache("ints").get(2));
- }
- }
- }
-}
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.java
deleted file mode 100644
index 98609a94785..00000000000
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.java
+++ /dev/null
@@ -1,162 +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.jdbc.thin;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.Collections;
-import java.util.concurrent.CountDownLatch;
-import org.apache.ignite.cluster.ClusterState;
-import org.apache.ignite.configuration.ConnectorConfiguration;
-import org.apache.ignite.configuration.DataRegionConfiguration;
-import org.apache.ignite.configuration.DataStorageConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.client.GridClient;
-import org.apache.ignite.internal.client.GridClientClusterState;
-import org.apache.ignite.internal.client.GridClientConfiguration;
-import org.apache.ignite.internal.client.GridClientFactory;
-import org.apache.ignite.internal.util.lang.GridAbsPredicate;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Test;
-
-import static org.apache.ignite.cluster.ClusterState.INACTIVE;
-
-/** */
-public class MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest extends GridCommonAbstractTest {
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- cleanPersistenceDir();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
- }
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- return super.getConfiguration(igniteInstanceName)
- .setConnectorConfiguration(new ConnectorConfiguration())
- .setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(
- new DataRegionConfiguration().setPersistenceEnabled(true))
- );
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testTxCommitAfterDeactivation() throws Exception {
- checkTxFinishAfterDeactivation(true);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testTxRollbackAfterDeactivation() throws Exception {
- checkTxFinishAfterDeactivation(false);
- }
-
- /** */
- public void checkTxFinishAfterDeactivation(boolean commit) throws Exception {
- IgniteEx node0 = startGrid(0);
-
- node0.cluster().state(ClusterState.ACTIVE);
-
- try (Connection conn = connect()) {
- execute(conn, "CREATE TABLE t1(a INT, b VARCHAR, PRIMARY KEY(a)) WITH \"atomicity=TRANSACTIONAL_SNAPSHOT,backups=1\"");
- }
-
- final CountDownLatch enlistedLatch = new CountDownLatch(1);
-
- assert node0.cluster().state().active();
-
- IgniteInternalFuture txFinishedFut = GridTestUtils.runAsync(() -> {
- executeTransaction(commit, enlistedLatch, () -> !node0.context().state().publicApiActiveState(true));
-
- return null;
- });
-
- enlistedLatch.await();
-
- deactivateThroughClient();
-
- log.info(">>> Cluster deactivated ...");
-
- try {
- txFinishedFut.get();
- }
- catch (Exception e) {
- e.printStackTrace();
-
- fail("Exception is not expected here");
- }
- }
-
- /** */
- private void executeTransaction(boolean commit, CountDownLatch enlistedLatch,
- GridAbsPredicate beforeCommitCondition) throws Exception {
- try (Connection conn = connect()) {
- execute(conn, "BEGIN");
-
- execute(conn, "INSERT INTO t1 VALUES (1, '1')");
-
- log.info(">>> Started transaction and enlisted entries");
-
- enlistedLatch.countDown();
-
- GridTestUtils.waitForCondition(beforeCommitCondition, 5_000);
-
- log.info(">>> Attempting to finish transaction");
-
- execute(conn, commit ? "COMMIT" : "ROLLBACK");
- }
- }
-
- /** */
- private static Connection connect() throws Exception {
- return DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1");
- }
-
- /** */
- private static void execute(Connection conn, String sql) throws Exception {
- try (Statement stmt = conn.createStatement()) {
- stmt.executeUpdate(sql);
- }
- }
-
- /** */
- private void deactivateThroughClient() throws Exception {
- GridClientConfiguration clientCfg = new GridClientConfiguration();
-
- clientCfg.setServers(Collections.singletonList("127.0.0.1:11211"));
-
- try (GridClient client = GridClientFactory.start(clientCfg)) {
- GridClientClusterState state = client.state();
-
- log.info(">>> Try to deactivate ...");
-
- state.state(INACTIVE, true);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 5fb101aebce..b0682d54a36 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -1628,10 +1628,6 @@ public final class IgniteSystemProperties {
defaults = "" + DFLT_ALLOW_START_CACHES_IN_PARALLEL)
public static final String IGNITE_ALLOW_START_CACHES_IN_PARALLEL = "IGNITE_ALLOW_START_CACHES_IN_PARALLEL";
- /** For test purposes only. Force Mvcc mode. */
- @SystemProperty("For test purposes only. Force Mvcc mode")
- public static final String IGNITE_FORCE_MVCC_MODE_IN_TESTS = "IGNITE_FORCE_MVCC_MODE_IN_TESTS";
-
/**
* Allows to log additional information about all restored partitions after binary and logical recovery phases.
*
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java
index f34fa5f71ce..f8b5ff2a75d 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java
@@ -138,4 +138,14 @@ public enum CacheAtomicityMode {
@Nullable public static CacheAtomicityMode fromOrdinal(int ord) {
return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
}
+
+ /**
+ * TRANSACTIONAL_SNAPSHOT free values.
+ * To be removed on <a href="https://issues.apache.org/jira/browse/IGNITE-13871">MVCC removal</a> finish.
+ *
+ * @return Values.
+ */
+ public static CacheAtomicityMode[] _values() {
+ return new CacheAtomicityMode[] {TRANSACTIONAL, ATOMIC};
+ }
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
index 44a51ecf181..cb79a558792 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
@@ -96,27 +96,10 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
/** {@inheritDoc} */
@Override public void remove() {
- if (!entry.isMvcc()) {
- if (op == Operation.CREATE)
- op = Operation.NONE;
- else
- op = Operation.REMOVE;
- }
- else {
- if (op == Operation.CREATE) {
- assert !hadVal;
-
- op = Operation.NONE;
- }
- else if (exists()) {
- assert hadVal;
-
- op = Operation.REMOVE;
- }
-
- if (hadVal && oldVal == null)
- oldVal = val;
- }
+ if (op == Operation.CREATE)
+ op = Operation.NONE;
+ else
+ op = Operation.REMOVE;
val = null;
valObj = null;
@@ -127,13 +110,7 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
if (val == null)
throw new NullPointerException();
- if (!entry.isMvcc())
- this.oldVal = this.val;
- else {
- if (hadVal && oldVal == null)
- this.oldVal = this.val;
- }
-
+ this.oldVal = this.val;
this.val = val;
op = hadVal ? Operation.UPDATE : Operation.CREATE;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index 431ba34b017..ba15b79bab1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -77,11 +77,6 @@ public interface GridCacheEntryEx {
*/
public boolean isLocal();
- /**
- * @return {@code True} if this is n entry from MVCC cache.
- */
- public boolean isMvcc();
-
/**
* @return {@code False} if entry belongs to cache map, {@code true} if this entry was created in colocated
* cache and node is not primary for this key.
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index f45f803136d..70b4c5870e4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -107,6 +107,7 @@ import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.thread.IgniteThread;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+
import static org.apache.ignite.IgniteSystemProperties.getLong;
import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_EXPIRED;
import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_LOCKED;
@@ -336,11 +337,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
return false;
}
- /** {@inheritDoc} */
- @Override public boolean isMvcc() {
- return cctx.mvccEnabled();
- }
-
/** {@inheritDoc} */
@Override public boolean isNear() {
return false;
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 fd81372fa47..e23607f7065 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
@@ -37,7 +37,6 @@ import java.util.stream.Stream;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.DataRegionConfiguration;
@@ -111,7 +110,6 @@ import org.apache.ignite.thread.IgniteThread;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
@@ -141,10 +139,6 @@ import static org.apache.ignite.internal.processors.cache.persistence.CacheDataR
*/
@SuppressWarnings("unchecked")
public class MvccProcessorImpl extends GridProcessorAdapter implements MvccProcessor, DatabaseLifecycleListener {
- /** */
- private static final boolean FORCE_MVCC =
- IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_FORCE_MVCC_MODE_IN_TESTS, false);
-
/** */
private static final IgniteProductVersion MVCC_SUPPORTED_SINCE = IgniteProductVersion.fromString("2.7.0");
@@ -280,12 +274,6 @@ public class MvccProcessorImpl extends GridProcessorAdapter implements MvccProce
/** {@inheritDoc} */
@Override public void preProcessCacheConfiguration(CacheConfiguration ccfg) {
- if (FORCE_MVCC && ccfg.getAtomicityMode() == TRANSACTIONAL && !CU.isSystemCache(ccfg.getName())) {
- ccfg.setAtomicityMode(TRANSACTIONAL_SNAPSHOT);
- //noinspection unchecked
- ccfg.setNearConfiguration(null);
- }
-
if (ccfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT) {
if (!mvccSupported)
throw new IgniteException("Cannot start MVCC transactional cache. " +
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/IgniteCacheEntryProcessorSequentialCallTest.java b/modules/core/src/test/java/org/apache/ignite/cache/IgniteCacheEntryProcessorSequentialCallTest.java
index 33a37dcf284..2a8b41b190a 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/IgniteCacheEntryProcessorSequentialCallTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/IgniteCacheEntryProcessorSequentialCallTest.java
@@ -39,9 +39,6 @@ public class IgniteCacheEntryProcessorSequentialCallTest extends GridCommonAbstr
/** */
private static final String CACHE = "cache";
- /** */
- private static final String MVCC_CACHE = "mvccCache";
-
/** */
private String cacheName;
@@ -68,10 +65,7 @@ public class IgniteCacheEntryProcessorSequentialCallTest extends GridCommonAbstr
CacheConfiguration ccfg = cacheConfiguration(CACHE);
- CacheConfiguration mvccCfg = cacheConfiguration(MVCC_CACHE)
- .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
-
- cfg.setCacheConfiguration(ccfg, mvccCfg);
+ cfg.setCacheConfiguration(ccfg);
return cfg;
}
@@ -153,18 +147,6 @@ public class IgniteCacheEntryProcessorSequentialCallTest extends GridCommonAbstr
transactionInvokeSequentialCallOnNearNode(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.READ_COMMITTED);
}
- /**
- *
- */
- @Test
- public void testMvccTxInvokeSequentialCall() throws Exception {
- cacheName = MVCC_CACHE;
-
- transactionInvokeSequentialCallOnPrimaryNode(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
-
- transactionInvokeSequentialCallOnNearNode(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
- }
-
/**
* Test for sequential entry processor invoking not null value on primary cache.
* In this test entry processor gets value from local node.
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreListenerRWThroughDisabledTransactionalCacheTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreListenerRWThroughDisabledTransactionalCacheTest.java
index 86f0ab37624..1a45de83020 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreListenerRWThroughDisabledTransactionalCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreListenerRWThroughDisabledTransactionalCacheTest.java
@@ -20,12 +20,9 @@ package org.apache.ignite.cache.store;
import java.util.Random;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -41,19 +38,6 @@ import static org.apache.ignite.transactions.TransactionIsolation.SERIALIZABLE;
*/
public class CacheStoreListenerRWThroughDisabledTransactionalCacheTest
extends CacheStoreSessionListenerReadWriteThroughDisabledAbstractTest {
- /** */
- @Before
- public void beforeCacheStoreListenerRWThroughDisabledTransactionalCacheTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
- /** {@inheritDoc} */
- @Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
- return super.cacheConfiguration(igniteInstanceName);
- }
-
/** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return TRANSACTIONAL;
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerLifecycleSelfTest.java
index 556fb40997d..defb387d439 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerLifecycleSelfTest.java
@@ -31,10 +31,8 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.lifecycle.LifecycleAware;
import org.apache.ignite.resources.IgniteInstanceResource;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -46,12 +44,6 @@ public class CacheStoreSessionListenerLifecycleSelfTest extends GridCommonAbstra
/** */
private static final Queue<String> evts = new ConcurrentLinkedDeque<>();
- /** */
- @Before
- public void beforeCacheStoreSessionListenerLifecycleSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerWriteBehindEnabledTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerWriteBehindEnabledTest.java
index 8ce62e77017..8cae78788d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerWriteBehindEnabledTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheStoreSessionListenerWriteBehindEnabledTest.java
@@ -44,8 +44,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
import org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore;
import org.apache.ignite.resources.CacheStoreSessionResource;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -76,8 +74,6 @@ public class CacheStoreSessionListenerWriteBehindEnabledTest extends GridCacheAb
/** {@inheritDoc} */
@Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
CacheConfiguration cacheCfg = super.cacheConfiguration(igniteInstanceName);
cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(EmptyCacheStore.class));
@@ -96,12 +92,6 @@ public class CacheStoreSessionListenerWriteBehindEnabledTest extends GridCacheAb
return cacheCfg;
}
- /** */
- @Before
- public void beforeCacheStoreSessionListenerWriteBehindEnabledTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
super.beforeTest();
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheTransactionalStoreReadFromBackupTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheTransactionalStoreReadFromBackupTest.java
index 51ca1420907..4837936621f 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/CacheTransactionalStoreReadFromBackupTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/CacheTransactionalStoreReadFromBackupTest.java
@@ -18,7 +18,6 @@
package org.apache.ignite.cache.store;
import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -26,13 +25,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
*
*/
public class CacheTransactionalStoreReadFromBackupTest extends CacheStoreReadFromBackupTest {
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
- super.beforeTestsStarted();
- }
-
/** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return TRANSACTIONAL;
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/GridCacheLoadOnlyStoreAdapterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/GridCacheLoadOnlyStoreAdapterSelfTest.java
index f26cc49cc91..349418ddf2b 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/GridCacheLoadOnlyStoreAdapterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/GridCacheLoadOnlyStoreAdapterSelfTest.java
@@ -25,7 +25,6 @@ import org.apache.ignite.IgniteCache;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -42,8 +41,6 @@ public class GridCacheLoadOnlyStoreAdapterSelfTest extends GridCommonAbstractTes
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
super.beforeTestsStarted();
startGrid(0);
@@ -61,8 +58,6 @@ public class GridCacheLoadOnlyStoreAdapterSelfTest extends GridCommonAbstractTes
*/
@SuppressWarnings("unchecked")
private CacheConfiguration<?, ?> cacheConfiguration() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
CacheConfiguration cfg = defaultCacheConfiguration();
assertNotNull(store);
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
index 015eab33353..954319b7f53 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
@@ -40,7 +40,6 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.binary.BinaryMarshaller;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -113,13 +112,6 @@ public abstract class CacheJdbcPojoStoreAbstractSelfTest extends GridCommonAbstr
};
}
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
- super.beforeTestsStarted();
- }
-
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
Connection conn = getConnection();
@@ -157,8 +149,6 @@ public abstract class CacheJdbcPojoStoreAbstractSelfTest extends GridCommonAbstr
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setCacheConfiguration(cacheConfiguration());
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListenerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListenerSelfTest.java
index 22da3e6ad95..c19d530a2fc 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListenerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListenerSelfTest.java
@@ -32,20 +32,12 @@ import org.apache.ignite.cache.store.CacheStoreSessionListener;
import org.apache.ignite.cache.store.CacheStoreSessionListenerAbstractSelfTest;
import org.apache.ignite.lang.IgniteBiInClosure;
import org.apache.ignite.resources.CacheStoreSessionResource;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.h2.jdbcx.JdbcConnectionPool;
-import org.junit.Before;
/**
* Tests for {@link CacheJdbcStoreSessionListener}.
*/
public class CacheJdbcStoreSessionListenerSelfTest extends CacheStoreSessionListenerAbstractSelfTest {
- /** */
- @Before
- public void beforeCacheJdbcStoreSessionListenerSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected Factory<? extends CacheStore<Integer, Integer>> storeFactory() {
return new Factory<CacheStore<Integer, Integer>>() {
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/GridCacheJdbcBlobStoreMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/GridCacheJdbcBlobStoreMultithreadedSelfTest.java
index 96e1bd00f4c..93de23c0e70 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/GridCacheJdbcBlobStoreMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/GridCacheJdbcBlobStoreMultithreadedSelfTest.java
@@ -37,7 +37,6 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.junit.Test;
@@ -58,13 +57,6 @@ public class GridCacheJdbcBlobStoreMultithreadedSelfTest extends GridCommonAbstr
/** Number of transactions. */
private static final int TX_CNT = 1000;
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
- super.beforeTestsStarted();
- }
-
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
startGridsMultiThreaded(GRID_CNT - 2);
@@ -86,8 +78,6 @@ public class GridCacheJdbcBlobStoreMultithreadedSelfTest extends GridCommonAbstr
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected final IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
if (!c.isClientMode()) {
diff --git a/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java
index 1049ab5b15d..c4a09f7b9fd 100644
--- a/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java
@@ -47,9 +47,6 @@ public class IoomFailureHandlerTest extends AbstractFailureHandlerTest {
/** PDS enabled. */
private boolean pds;
- /** MVCC enabled. */
- private boolean mvcc;
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
@@ -79,7 +76,7 @@ public class IoomFailureHandlerTest extends AbstractFailureHandlerTest {
.setName(DEFAULT_CACHE_NAME)
.setCacheMode(CacheMode.PARTITIONED)
.setBackups(0)
- .setAtomicityMode(mvcc ? CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT : CacheAtomicityMode.TRANSACTIONAL);
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
cfg.setCacheConfiguration(ccfg);
@@ -105,7 +102,7 @@ public class IoomFailureHandlerTest extends AbstractFailureHandlerTest {
*/
@Test
public void testIoomErrorNoStoreHandling() throws Exception {
- testIoomErrorHandling(false, false);
+ testIoomErrorHandling(false);
}
/**
@@ -113,31 +110,14 @@ public class IoomFailureHandlerTest extends AbstractFailureHandlerTest {
*/
@Test
public void testIoomErrorPdsHandling() throws Exception {
- testIoomErrorHandling(true, false);
- }
-
- /**
- * Test IgniteOutOfMemoryException handling with no store.
- */
- @Test
- public void testIoomErrorMvccNoStoreHandling() throws Exception {
- testIoomErrorHandling(false, true);
- }
-
- /**
- * Test IgniteOutOfMemoryException handling with PDS.
- */
- @Test
- public void testIoomErrorMvccPdsHandling() throws Exception {
- testIoomErrorHandling(true, true);
+ testIoomErrorHandling(true);
}
/**
* Test IOOME handling.
*/
- private void testIoomErrorHandling(boolean pds, boolean mvcc) throws Exception {
+ private void testIoomErrorHandling(boolean pds) throws Exception {
this.pds = pds;
- this.mvcc = mvcc;
IgniteEx ignite0 = startGrid(0);
IgniteEx ignite1 = startGrid(1);
@@ -163,12 +143,8 @@ public class IoomFailureHandlerTest extends AbstractFailureHandlerTest {
assertFalse(dummyFailureHandler(ignite0).failure());
- if (mvcc && pds)
- assertFalse(dummyFailureHandler(ignite1).failure());
- else {
- assertTrue(dummyFailureHandler(ignite1).failure());
- assertTrue(X.hasCause(dummyFailureHandler(ignite1).failureContext().error(), IgniteOutOfMemoryException.class));
- }
+ assertTrue(dummyFailureHandler(ignite1).failure());
+ assertTrue(X.hasCause(dummyFailureHandler(ignite1).failureContext().error(), IgniteOutOfMemoryException.class));
}
finally {
stopGrid(1);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridCacheHashMapPutAllWarningsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridCacheHashMapPutAllWarningsTest.java
index c64627a216e..72838fe62da 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridCacheHashMapPutAllWarningsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridCacheHashMapPutAllWarningsTest.java
@@ -31,7 +31,6 @@ import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.testframework.ListeningTestLogger;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -105,9 +104,6 @@ public class GridCacheHashMapPutAllWarningsTest extends GridCommonAbstractTest {
*/
@Test
public void testHashMapPutAllExplicitOptimistic() throws Exception {
- if (MvccFeatureChecker.forcedMvcc())
- return;
-
List<String> messages = Collections.synchronizedList(new ArrayList<>());
testLog = new ListeningTestLogger(log());
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
index 371bdb0a95e..cb991c845bd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
@@ -69,7 +69,6 @@ import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.DiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
@@ -818,19 +817,7 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
IgniteInClosure<IgniteCache<Object, Object>> putOp = new CI1<IgniteCache<Object, Object>>() {
@Override public void apply(IgniteCache<Object, Object> cache) {
- while (true) {
- try {
- cache.put(1, 1);
-
- break;
- }
- catch (Exception e) {
- if (e.getCause() instanceof IgniteClientDisconnectedException)
- throw e;
- else
- MvccFeatureChecker.assertMvccWriteConflict(e);
- }
- }
+ cache.put(1, 1);
}
};
@@ -848,7 +835,7 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
int cnt = 0;
- for (CacheAtomicityMode atomicityMode : CacheAtomicityMode.values()) {
+ for (CacheAtomicityMode atomicityMode : CacheAtomicityMode._values()) {
for (CacheWriteSynchronizationMode syncMode : CacheWriteSynchronizationMode.values()) {
CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
@@ -1416,16 +1403,7 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
assertNotEquals(id, client.localNode().id());
- while (true) {
- try {
- cache.put(1, 1);
-
- break;
- }
- catch (Exception e) {
- MvccFeatureChecker.assertMvccWriteConflict(e);
- }
- }
+ cache.put(1, 1);
GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/TransactionMetricsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/TransactionMetricsTest.java
index d53c5a0e71e..c655929f7bb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/TransactionMetricsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/TransactionMetricsTest.java
@@ -31,7 +31,6 @@ import org.apache.ignite.internal.processors.metric.impl.ObjectGauge;
import org.apache.ignite.mxbean.TransactionMetricsMxBean;
import org.apache.ignite.spi.metric.IntMetric;
import org.apache.ignite.spi.metric.LongMetric;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.junit.Test;
@@ -51,8 +50,6 @@ public class TransactionMetricsTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.METRICS);
-
final IgniteConfiguration cfg = super.getConfiguration(name);
cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
@@ -77,13 +74,6 @@ public class TransactionMetricsTest extends GridCommonAbstractTest {
super.afterTest();
}
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.METRICS);
-
- super.beforeTestsStarted();
- }
-
/**
*
*/
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java
index e72ab4a16df..9240872bb89 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/IgniteDiagnosticMessagesTest.java
@@ -54,15 +54,12 @@ import org.apache.ignite.testframework.GridStringLogger;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.ListeningTestLogger;
import org.apache.ignite.testframework.LogListener;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Ignore;
import org.junit.Test;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.testframework.GridTestUtils.runAsync;
@@ -125,14 +122,6 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
checkBasicDiagnosticInfo(CacheAtomicityMode.TRANSACTIONAL);
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testDiagnosticMessagesMvcc1() throws Exception {
- checkBasicDiagnosticInfo(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
- }
-
/**
* @throws Exception If failed.
*/
@@ -143,16 +132,6 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
checkBasicDiagnosticInfo(CacheAtomicityMode.TRANSACTIONAL);
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testDiagnosticMessagesMvcc2() throws Exception {
- connectionsPerNode = 5;
-
- checkBasicDiagnosticInfo(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
- }
-
/**
* @throws Exception If failed.
*/
@@ -161,14 +140,6 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
checkLongRunning(TRANSACTIONAL);
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testLongRunningMvcc() throws Exception {
- checkLongRunning(TRANSACTIONAL_SNAPSHOT);
- }
-
/**
* @param atomicityMode Cache atomicity mode.
* @throws Exception If failed.
@@ -241,15 +212,6 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
.setNearConfiguration(null);
}
- /**
- * @throws Exception If failed.
- */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10637") // Support diagnostics message or disable test.
- @Test
- public void testSeveralLongRunningMvccTxs() throws Exception {
- checkSeveralLongRunningTxs(TRANSACTIONAL_SNAPSHOT);
- }
-
/**
* @throws Exception If failed.
*/
@@ -363,15 +325,6 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
return cnt;
}
- /**
- * @throws Exception If failed.
- */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10637") // Support diagnostic messages or disable test.
- @Test
- public void testLongRunningMvccTx() throws Exception {
- checkLongRunningTx(TRANSACTIONAL_SNAPSHOT);
- }
-
/**
* @throws Exception If failed.
*/
@@ -578,22 +531,6 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
*/
@Test
public void testRemoteTx() throws Exception {
- checkRemoteTx(TRANSACTIONAL);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testRemoteMvccTx() throws Exception {
- checkRemoteTx(TRANSACTIONAL_SNAPSHOT);
- }
-
- /**
- * @param atomicityMode Cache atomicity mode.
- * @throws Exception If failed.
- */
- public void checkRemoteTx(CacheAtomicityMode atomicityMode) throws Exception {
int timeout = 3500;
System.setProperty(IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT, String.valueOf(timeout));
@@ -611,11 +548,9 @@ public class IgniteDiagnosticMessagesTest extends GridCommonAbstractTest {
awaitPartitionMapExchange();
- CacheConfiguration ccfg = cacheConfiguration(atomicityMode).setBackups(1);
+ CacheConfiguration ccfg = cacheConfiguration(TRANSACTIONAL).setBackups(1);
- if (atomicityMode != TRANSACTIONAL_SNAPSHOT ||
- MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.NEAR_CACHE))
- ccfg.setNearConfiguration(new NearCacheConfiguration<>());
+ ccfg.setNearConfiguration(new NearCacheConfiguration<>());
final Ignite node0 = ignite(0);
final Ignite node1 = ignite(1);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java
index 9bf48f2cbfe..2352abf5adb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java
@@ -56,9 +56,6 @@ public class IoStatisticsCacheSelfTest extends GridCommonAbstractTest {
/** */
protected static final String ATOMIC_CACHE_NAME = "ATOMIC_CACHE";
- /** */
- protected static final String MVCC_CACHE_NAME = "MVCC_CACHE";
-
/** */
protected static final String TRANSACTIONAL_CACHE_NAME = "TRANSACTIONAL_CACHE";
@@ -73,7 +70,7 @@ public class IoStatisticsCacheSelfTest extends GridCommonAbstractTest {
/** */
protected static final Set<String> ALL_CACHE_GROUP_NAMES = Sets.newHashSet(
- ATOMIC_CACHE_NAME, MVCC_CACHE_NAME, TRANSACTIONAL_CACHE_NAME, CACHE_GROUP_NAME);
+ ATOMIC_CACHE_NAME, TRANSACTIONAL_CACHE_NAME, CACHE_GROUP_NAME);
/** */
protected static final int RECORD_COUNT = 100;
@@ -98,10 +95,6 @@ public class IoStatisticsCacheSelfTest extends GridCommonAbstractTest {
.setAtomicityMode(CacheAtomicityMode.ATOMIC)
.setName(ATOMIC_CACHE_NAME);
- final CacheConfiguration mvccCacheCfg = new CacheConfiguration()
- .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT)
- .setName(MVCC_CACHE_NAME);
-
final CacheConfiguration transactionalCacheCfg = new CacheConfiguration()
.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
.setName(TRANSACTIONAL_CACHE_NAME);
@@ -126,8 +119,7 @@ public class IoStatisticsCacheSelfTest extends GridCommonAbstractTest {
cfg.setDataStorageConfiguration(dsCfg);
- cfg.setCacheConfiguration(transactionalCacheCfg, atomicCacheCfg, mvccCacheCfg,
- atomic1CacheGrpCfg, atomic2CacheGrpCfg);
+ cfg.setCacheConfiguration(transactionalCacheCfg, atomicCacheCfg, atomic1CacheGrpCfg, atomic2CacheGrpCfg);
return cfg;
}
@@ -168,14 +160,6 @@ public class IoStatisticsCacheSelfTest extends GridCommonAbstractTest {
cacheTest(TRANSACTIONAL_CACHE_NAME, RECORD_COUNT, RECORD_COUNT * 3, RECORD_COUNT * 2);
}
- /**
- * Test statistics for MVCC cache.
- */
- @Test
- public void testMvccCache() throws Exception {
- cacheTest(MVCC_CACHE_NAME, RECORD_COUNT, RECORD_COUNT * 6, RECORD_COUNT * 3);
- }
-
/**
* Test statistics for ATOMIC cache.
*/
@@ -189,7 +173,7 @@ public class IoStatisticsCacheSelfTest extends GridCommonAbstractTest {
*/
@Test
public void testForThreeCaches() throws Exception {
- prepareData(RECORD_COUNT, ATOMIC_CACHE_NAME, TRANSACTIONAL_CACHE_NAME, MVCC_CACHE_NAME);
+ prepareData(RECORD_COUNT, ATOMIC_CACHE_NAME, TRANSACTIONAL_CACHE_NAME);
GridMetricManager mmgr = ignite.context().metric();
@@ -197,7 +181,7 @@ public class IoStatisticsCacheSelfTest extends GridCommonAbstractTest {
assertEquals(ALL_CACHE_GROUP_NAMES, statisticCacheNames);
- Stream.of(ATOMIC_CACHE_NAME, TRANSACTIONAL_CACHE_NAME, MVCC_CACHE_NAME).forEach((cacheName) -> {
+ Stream.of(ATOMIC_CACHE_NAME, TRANSACTIONAL_CACHE_NAME).forEach((cacheName) -> {
long logicalReads = logicalReads(mmgr, CACHE_GROUP, cacheName);
assertTrue(logicalReads > RECORD_COUNT);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java b/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java
index 1145006a198..c23221f5a43 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java
@@ -48,7 +48,6 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteJdbcThinDriver;
-import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
@@ -734,10 +733,6 @@ public class JmxExporterSpiTest extends AbstractExporterSpiTest {
assertEquals(0L, txv.get("timeout"));
assertTrue(((long)txv.get("startTime")) <= System.currentTimeMillis());
- //Only pessimistic transactions are supported when MVCC is enabled.
- if (Objects.equals(System.getProperty(IgniteSystemProperties.IGNITE_FORCE_MVCC_MODE_IN_TESTS), "true"))
- return;
-
GridTestUtils.runMultiThreadedAsync(() -> {
try (Transaction tx = ignite.transactions().txStart(OPTIMISTIC, SERIALIZABLE)) {
cache.put(cntr.incrementAndGet(), cntr.incrementAndGet());
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
index d69c1c005fd..fce35b6ae41 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
@@ -26,7 +26,6 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.BrokenBarrierException;
@@ -52,7 +51,6 @@ import org.apache.ignite.IgniteLock;
import org.apache.ignite.IgniteQueue;
import org.apache.ignite.IgniteSemaphore;
import org.apache.ignite.IgniteSet;
-import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
@@ -889,10 +887,6 @@ public class SystemViewSelfTest extends GridCommonAbstractTest {
assertTrue(txv.startTime() <= System.currentTimeMillis());
assertEquals(String.valueOf(cacheId(cache1.getName())), txv.cacheIds());
- //Only pessimistic transactions are supported when MVCC is enabled.
- if (Objects.equals(System.getProperty(IgniteSystemProperties.IGNITE_FORCE_MVCC_MODE_IN_TESTS), "true"))
- return;
-
GridTestUtils.runMultiThreadedAsync(() -> {
try (Transaction tx = g.transactions().txStart(OPTIMISTIC, SERIALIZABLE)) {
cache1.put(cntr.incrementAndGet(), cntr.incrementAndGet());
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/GridCacheTxLoadFromStoreOnLockSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/GridCacheTxLoadFromStoreOnLockSelfTest.java
index f0639048d63..1e8a6f4610c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/GridCacheTxLoadFromStoreOnLockSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/GridCacheTxLoadFromStoreOnLockSelfTest.java
@@ -30,24 +30,16 @@ import org.apache.ignite.cache.store.CacheStore;
import org.apache.ignite.cache.store.CacheStoreAdapter;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
-import org.junit.Before;
import org.junit.Test;
/**
*
*/
public class GridCacheTxLoadFromStoreOnLockSelfTest extends GridCommonAbstractTest {
- /** */
- @Before
- public void beforeGridCacheTxLoadFromStoreOnLockSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/AbstractDataTypesCoverageTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/AbstractDataTypesCoverageTest.java
index f1a5e448e91..2a1ef49aeb7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/AbstractDataTypesCoverageTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/AbstractDataTypesCoverageTest.java
@@ -166,7 +166,7 @@ public abstract class AbstractDataTypesCoverageTest extends GridCommonAbstractTe
Object[] paramLine = null;
- for (CacheAtomicityMode atomicityMode : CacheAtomicityMode.values()) {
+ for (CacheAtomicityMode atomicityMode : CacheAtomicityMode._values()) {
paramLine = Arrays.copyOf(baseParamLine, baseParamLine.length);
paramLine[1] = atomicityMode;
@@ -184,14 +184,12 @@ public abstract class AbstractDataTypesCoverageTest extends GridCommonAbstractTe
assert paramLine != null;
- if ((paramLine[1]) != CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT) {
- for (Factory ttlFactory : TTL_FACTORIES) {
- paramLine = Arrays.copyOf(baseParamLine, baseParamLine.length);
+ for (Factory ttlFactory : TTL_FACTORIES) {
+ paramLine = Arrays.copyOf(baseParamLine, baseParamLine.length);
- paramLine[3] = ttlFactory;
+ paramLine[3] = ttlFactory;
- params.add(paramLine);
- }
+ params.add(paramLine);
}
for (int backups : new int[] {0, 1, 2}) {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
index 53b080d42a4..7c74b2570a0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
@@ -37,9 +37,7 @@ import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.lang.IgniteBiInClosure;
import org.apache.ignite.resources.IgniteInstanceResource;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK;
@@ -63,12 +61,6 @@ public class CacheClientStoreSelfTest extends GridCommonAbstractTest {
/** */
private static volatile boolean loadedFromClient;
- /** */
- @Before
- public void beforeCacheClientStoreSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConcurrentReadThroughTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConcurrentReadThroughTest.java
index c429ef325c8..9fbd5dddb44 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConcurrentReadThroughTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConcurrentReadThroughTest.java
@@ -32,9 +32,7 @@ import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgniteRunnable;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -44,12 +42,6 @@ public class CacheConcurrentReadThroughTest extends GridCommonAbstractTest {
/** */
private static final int SYS_THREADS = 16;
- /** */
- @Before
- public void beforeCacheConcurrentReadThroughTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConnectionLeakStoreTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConnectionLeakStoreTxTest.java
index 058e7508826..4f0124910f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConnectionLeakStoreTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConnectionLeakStoreTxTest.java
@@ -38,7 +38,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
-import org.junit.Ignore;
import org.junit.Test;
import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
@@ -154,26 +153,6 @@ public class CacheConnectionLeakStoreTxTest extends GridCommonAbstractTest {
checkConnectionLeak(CacheAtomicityMode.TRANSACTIONAL, PESSIMISTIC, READ_COMMITTED);
}
- /**
- * @throws Exception If failed.
- */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-8582")
- @Test
- public void testConnectionLeakOneBackupMvccPessimisticRepeatableRead() throws Exception {
- checkConnectionLeak(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT, PESSIMISTIC, REPEATABLE_READ);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-8582")
- @Test
- public void testConnectionLeakOneBackupMvccPessimisticRepeatableReadLoadFromStore() throws Exception {
- isLoadFromStore = true;
-
- checkConnectionLeak(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT, PESSIMISTIC, REPEATABLE_READ);
- }
-
/**
* @param atomicityMode Atomicity mode.
* @param txConcurrency Transaction concurrency.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteQueueTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteQueueTest.java
index 0c1cf08cf8a..e928a495bef 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteQueueTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteQueueTest.java
@@ -28,13 +28,11 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.topology.Grid
import org.apache.ignite.internal.util.lang.GridAbsPredicate;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Ignore;
import org.junit.Test;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_CACHE_REMOVED_ENTRIES_TTL;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -74,22 +72,11 @@ public class CacheDeferredDeleteQueueTest extends GridCommonAbstractTest {
testQueue(TRANSACTIONAL, false);
- testQueue(TRANSACTIONAL_SNAPSHOT, false);
-
testQueue(ATOMIC, true);
testQueue(TRANSACTIONAL, true);
}
- /**
- * @throws Exception If failed.
- */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-7187")
- @Test
- public void testDeferredDeleteQueueMvcc() throws Exception {
- testQueue(TRANSACTIONAL_SNAPSHOT, true);
- }
-
/**
* @param atomicityMode Cache atomicity mode.
* @param nearCache {@code True} if need create near cache.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java
index a9b81364449..74ed77681bc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java
@@ -23,11 +23,10 @@ import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Ignore;
import org.junit.Test;
+
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -58,25 +57,6 @@ public class CacheDeferredDeleteSanitySelfTest extends GridCommonAbstractTest {
testDeferredDelete(REPLICATED, TRANSACTIONAL, true, true);
}
- /**
- * @throws Exception If fails.
- */
- @Test
- public void testDeferredDeleteMvcc() throws Exception {
- testDeferredDelete(PARTITIONED, TRANSACTIONAL_SNAPSHOT, false, true);
- testDeferredDelete(REPLICATED, TRANSACTIONAL_SNAPSHOT, false, true);
- }
-
- /**
- * @throws Exception If fails.
- */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-7187")
- @Test
- public void testDeferredDeleteMvccNear() throws Exception {
- testDeferredDelete(PARTITIONED, TRANSACTIONAL_SNAPSHOT, true, false);
- testDeferredDelete(REPLICATED, TRANSACTIONAL_SNAPSHOT, true, true);
- }
-
/**
* @param mode Mode.
* @param atomicityMode Atomicity mode.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEnumOperationsAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEnumOperationsAbstractTest.java
index e613e4edf44..22710b6fa91 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEnumOperationsAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEnumOperationsAbstractTest.java
@@ -29,12 +29,10 @@ import org.apache.ignite.internal.binary.BinaryEnumObjectImpl;
import org.apache.ignite.internal.binary.BinaryMarshaller;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Assume;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -79,18 +77,6 @@ public abstract class CacheEnumOperationsAbstractTest extends GridCommonAbstract
enumOperations(ccfg);
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTx() throws Exception {
- Assume.assumeTrue("https://issues.apache.org/jira/browse/IGNITE-7187", singleNode());
-
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED, 1, TRANSACTIONAL_SNAPSHOT);
-
- enumOperations(ccfg);
- }
-
/**
* @param ccfg Cache configuration.
*/
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEventWithTxLabelTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEventWithTxLabelTest.java
index 7bcd7f7a6ce..ec05d4fea1a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEventWithTxLabelTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEventWithTxLabelTest.java
@@ -37,13 +37,11 @@ import org.apache.ignite.events.Event;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.util.lang.IgnitePair;
import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.junit.Assert;
-import org.junit.Assume;
import org.junit.Test;
import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT;
@@ -109,11 +107,6 @@ public class CacheEventWithTxLabelTest extends GridCommonAbstractTest {
registerEventListeners(primary(), backup1(), backup2(), client());
}
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10270", MvccFeatureChecker.forcedMvcc());
- }
-
/**
* Check all cases for passing transaction label in cash event.
*
@@ -134,9 +127,6 @@ public class CacheEventWithTxLabelTest extends GridCommonAbstractTest {
for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
this.concurrency = concurrency;
- if (MvccFeatureChecker.forcedMvcc() && !MvccFeatureChecker.isSupported(concurrency, isolation))
- continue;
-
for (int i = 0; i < nodes.length - 1; i++) {
Ignite nodeForPut = nodes[i];
Ignite nodeForGet = nodes[i + 1];
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java
index 3c4c4968c7f..43f3aa3c529 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheFutureExceptionSelfTest.java
@@ -31,7 +31,6 @@ import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.failure.StopNodeFailureHandler;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -80,11 +79,6 @@ public class CacheFutureExceptionSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
private void testGet(boolean nearCache, boolean cpyOnRead) throws Exception {
- if (MvccFeatureChecker.forcedMvcc()) {
- if (!MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.NEAR_CACHE))
- return;
- }
-
fail = false;
Ignite srv = grid(0);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetEntryPessimisticRepeatableReadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetEntryPessimisticRepeatableReadSelfTest.java
index d93586e37a0..88c57ca8fc0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetEntryPessimisticRepeatableReadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetEntryPessimisticRepeatableReadSelfTest.java
@@ -17,16 +17,8 @@
package org.apache.ignite.internal.processors.cache;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
-import org.junit.Ignore;
-import org.junit.Test;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-import static org.apache.ignite.cache.CacheMode.REPLICATED;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
/**
* Test getEntry and getEntries methods.
@@ -41,51 +33,4 @@ public class CacheGetEntryPessimisticRepeatableReadSelfTest extends CacheGetEntr
@Override protected TransactionIsolation isolation() {
return TransactionIsolation.REPEATABLE_READ;
}
-
- /**
- * @throws Exception If failed.
- */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-7187")
- @Test
- public void testNearTransactionalMvcc() throws Exception {
- CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
-
- cfg.setWriteSynchronizationMode(FULL_SYNC);
- cfg.setCacheMode(PARTITIONED);
- cfg.setAtomicityMode(TRANSACTIONAL_SNAPSHOT);
- cfg.setName("nearT");
- cfg.setNearConfiguration(new NearCacheConfiguration());
-
- test(cfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testPartitionedTransactionalMvcc() throws Exception {
- CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
-
- cfg.setWriteSynchronizationMode(FULL_SYNC);
- cfg.setCacheMode(PARTITIONED);
- cfg.setAtomicityMode(TRANSACTIONAL_SNAPSHOT);
- cfg.setName("partitionedT");
-
- test(cfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testReplicatedTransactionalMvcc() throws Exception {
- CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
-
- cfg.setWriteSynchronizationMode(FULL_SYNC);
- cfg.setCacheMode(REPLICATED);
- cfg.setAtomicityMode(TRANSACTIONAL_SNAPSHOT);
- cfg.setName("replicatedT");
-
- test(cfg);
- }
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetRemoveSkipStoreTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetRemoveSkipStoreTest.java
index efd0038c13b..f8dbf76c39b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetRemoveSkipStoreTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetRemoveSkipStoreTest.java
@@ -33,7 +33,6 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -71,13 +70,6 @@ public class CacheGetRemoveSkipStoreTest extends GridCommonAbstractTest {
.setWriteThrough(false);
}
- /** {@inheritDoc} */
- @Override public void beforeTest() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
- super.beforeTest();
- }
-
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
super.afterTest();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java
index 0f956633aba..df9ee31c39e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java
@@ -53,14 +53,12 @@ import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.eclipse.jetty.util.BlockingArrayQueue;
import org.jetbrains.annotations.NotNull;
-import org.junit.Assume;
import org.junit.Test;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -283,118 +281,12 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
doTestPartitionCounterOperation(ccfg);
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTx() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
- 1,
- TRANSACTIONAL_SNAPSHOT,
- false);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTxWithStore() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
- 1,
- TRANSACTIONAL_SNAPSHOT,
- true);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTxExplicit() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
- 1,
- TRANSACTIONAL_SNAPSHOT,
- false);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTxReplicated() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
- 0,
- TRANSACTIONAL_SNAPSHOT,
- false);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTxReplicatedWithStore() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
- 0,
- TRANSACTIONAL_SNAPSHOT,
- true);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTxNoBackups() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
- 0,
- TRANSACTIONAL_SNAPSHOT,
- false);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTxNoBackupsWithStore() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
- 0,
- TRANSACTIONAL_SNAPSHOT,
- true);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMvccTxNoBackupsExplicit() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
- 0,
- TRANSACTIONAL_SNAPSHOT,
- false);
-
- doTestPartitionCounterOperation(ccfg);
- }
-
/**
* @param ccfg Cache configuration.
* @throws Exception If failed.
*/
- protected void doTestPartitionCounterOperation(CacheConfiguration<Object, Object> ccfg)
- throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9323",
- ccfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT);
+ protected void doTestPartitionCounterOperation(CacheConfiguration<Object, Object> ccfg) throws Exception {
+ assertTrue(ccfg.getAtomicityMode() == TRANSACTIONAL || ccfg.getAtomicityMode() == ATOMIC);
ignite(0).createCache(ccfg);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheKeepBinaryTransactionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheKeepBinaryTransactionTest.java
index 8e4676106b5..88ccc2dde49 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheKeepBinaryTransactionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheKeepBinaryTransactionTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.TransactionConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -43,10 +42,8 @@ public class CacheKeepBinaryTransactionTest extends GridCommonAbstractTest {
TransactionConfiguration txCfg = new TransactionConfiguration();
- if (!MvccFeatureChecker.forcedMvcc()) {
- txCfg.setDefaultTxConcurrency(TransactionConcurrency.OPTIMISTIC);
- txCfg.setDefaultTxIsolation(TransactionIsolation.REPEATABLE_READ);
- }
+ txCfg.setDefaultTxConcurrency(TransactionConcurrency.OPTIMISTIC);
+ txCfg.setDefaultTxIsolation(TransactionIsolation.REPEATABLE_READ);
cfg.setTransactionConfiguration(txCfg);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsEntitiesCountTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsEntitiesCountTest.java
index 3febf26648e..9e7deab5af9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsEntitiesCountTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsEntitiesCountTest.java
@@ -32,9 +32,9 @@ import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.processors.metric.MetricRegistry;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.spi.metric.LongMetric;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
+
import static org.apache.ignite.internal.processors.metric.impl.MetricUtils.cacheMetricsRegistryName;
/**
@@ -276,10 +276,7 @@ public class CacheMetricsEntitiesCountTest extends GridCommonAbstractTest {
metrics.getOffHeapBackupEntriesCount());
assertEquals(cacheInfo + " offHeapPrimaryEntriesCnt", offHeapPrimaryEntriesCnt,
metrics.getOffHeapPrimaryEntriesCount());
-
- if (!MvccFeatureChecker.forcedMvcc()) // Onheap cache is not supported in Mvcc mode.
- assertEquals(cacheInfo + " heapEntriesCnt", heapEntriesCnt, metrics.getHeapEntriesCount());
-
+ assertEquals(cacheInfo + " heapEntriesCnt", heapEntriesCnt, metrics.getHeapEntriesCount());
assertEquals(cacheInfo + " size", cacheSize, metrics.getSize());
assertEquals(cacheInfo + " keySize", cacheSize, metrics.getKeySize());
assertEquals(cacheInfo + " isEmpty", cacheSize == 0, metrics.isEmpty());
@@ -300,10 +297,7 @@ public class CacheMetricsEntitiesCountTest extends GridCommonAbstractTest {
assertEquals(cacheInfo + " offHeapEntriesCnt", offHeapEntriesCnt, offHeapEntriesCntSum);
assertEquals(cacheInfo + " offHeapBackupEntriesCnt", offHeapBackupEntriesCnt, offHeapBackupEntriesCntSum);
assertEquals(cacheInfo + " offHeapPrimaryEntriesCnt", offHeapPrimaryEntriesCnt, offHeapPrimaryEntriesCntSum);
-
- if (!MvccFeatureChecker.forcedMvcc()) // Onheap cache is not supported in Mvcc mode.
- assertEquals(cacheInfo + " heapEntriesCnt", heapEntriesCnt, heapEntriesCntSum);
-
+ assertEquals(cacheInfo + " heapEntriesCnt", heapEntriesCnt, heapEntriesCntSum);
assertEquals(cacheInfo + " isEmpty", cacheSize == 0, isEmptySum);
}
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
index 165ed3e6d65..0cd45d982a5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.managers.discovery.IgniteClusterNode;
import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.WithSystemProperty;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -58,13 +57,6 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
/** Cache 2. */
private IgniteCache<Integer, Integer> cache2;
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.METRICS);
-
- super.beforeTestsStarted();
- }
-
/**
* Test cluster group metrics in case of statistics enabled.
*/
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java
index 09ab7364cd0..d603b82a434 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java
@@ -64,11 +64,9 @@ import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.mxbean.TransactionsMXBean;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.WithSystemProperty;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Assume;
import org.junit.Test;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_DUMP_TX_COLLISIONS_INTERVAL;
@@ -110,8 +108,6 @@ public class CacheMetricsManageTest extends GridCommonAbstractTest {
*/
@Test
public void testNoPdsStatisticsEnable() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9224", MvccFeatureChecker.forcedMvcc());
-
testStatisticsEnable(false);
}
@@ -120,8 +116,6 @@ public class CacheMetricsManageTest extends GridCommonAbstractTest {
*/
@Test
public void testPdsStatisticsEnable() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9224", MvccFeatureChecker.forcedMvcc());
-
testStatisticsEnable(true);
}
@@ -527,8 +521,6 @@ public class CacheMetricsManageTest extends GridCommonAbstractTest {
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testTxContentionMetric() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9224", MvccFeatureChecker.forcedMvcc());
-
backups = 1;
useTestCommSpi = true;
@@ -663,8 +655,6 @@ public class CacheMetricsManageTest extends GridCommonAbstractTest {
/** Tests metric change interval. */
@Test
public void testKeyCollisionsMetricDifferentTimeout() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9224", MvccFeatureChecker.forcedMvcc());
-
backups = 2;
useTestCommSpi = true;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMvccTxFastFinishTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMvccTxFastFinishTest.java
deleted file mode 100644
index 90eaa3d1f06..00000000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMvccTxFastFinishTest.java
+++ /dev/null
@@ -1,72 +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;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteTransactions;
-import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.apache.ignite.transactions.Transaction;
-
-import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
-import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
-
-/** */
-public class CacheMvccTxFastFinishTest extends CacheTxFastFinishTest {
- /** {@inheritDoc} */
- @Override protected void fastFinishTx(Ignite ignite) {
- assert MvccFeatureChecker.forcedMvcc();
-
- IgniteTransactions txs = ignite.transactions();
-
- IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME);
-
- for (boolean commit : new boolean[] {true, false}) {
- try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
- checkFastTxFinish(tx, commit);
- }
-
- for (int i = 0; i < 100; i++) {
- try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.get(i);
-
- checkNormalTxFinish(tx, commit, true);
- }
- }
-
- for (int i = 0; i < 100; i++) {
- try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.put(i, i);
-
- checkNormalTxFinish(tx, commit, false);
- }
- }
- }
- }
-
- /** {@inheritDoc} */
- @Override protected void checkNormalCommittedTx(IgniteInternalTx tx, boolean readOnly) {
- if (readOnly)
- assertNull(prepareFuture(tx));
- else
- assertNotNull(prepareFuture(tx));
-
- assertNotNull(finishFuture(tx));
- }
-}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNearReaderUpdateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNearReaderUpdateTest.java
index da214ea1713..d9165f87d13 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNearReaderUpdateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNearReaderUpdateTest.java
@@ -40,13 +40,11 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.apache.ignite.transactions.TransactionOptimisticException;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -72,8 +70,6 @@ public class CacheNearReaderUpdateTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
-
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setPeerClassLoadingEnabled(false);
@@ -81,12 +77,6 @@ public class CacheNearReaderUpdateTest extends GridCommonAbstractTest {
return cfg;
}
- /** */
- @Before
- public void beforeCacheNearReaderUpdateTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
- }
-
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
@@ -333,9 +323,6 @@ public class CacheNearReaderUpdateTest extends GridCommonAbstractTest {
int backups,
boolean storeEnabled,
boolean nearCache) {
- if (storeEnabled)
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(cacheMode);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java
index 0f9fe2d5fb5..6cdd2b82ff8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java
@@ -60,7 +60,6 @@ import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedM
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeLeftMessage;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.WithSystemProperty;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
@@ -93,13 +92,6 @@ public class CacheNoAffinityExchangeTest extends GridCommonAbstractTest {
/** Stores errors that triggered failure handler. */
private final Map<String, Throwable> errs = new ConcurrentHashMap<>();
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
- super.beforeTestsStarted();
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapMapEntrySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapMapEntrySelfTest.java
index 69c5ece8ab8..a03599d8293 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapMapEntrySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapMapEntrySelfTest.java
@@ -24,11 +24,10 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheEntry;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.junit.Test;
+
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -75,9 +74,6 @@ public class CacheOffheapMapEntrySelfTest extends GridCacheAbstractSelfTest {
cfg.setAtomicityMode(atomicityMode);
cfg.setName(cacheName);
- if (atomicityMode == TRANSACTIONAL_SNAPSHOT && !MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.NEAR_CACHE))
- cfg.setNearConfiguration(null);
-
return cfg;
}
@@ -90,15 +86,9 @@ public class CacheOffheapMapEntrySelfTest extends GridCacheAbstractSelfTest {
checkCacheMapEntry(TRANSACTIONAL, PARTITIONED, GridNearCacheEntry.class);
- if (MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.CACHE_STORE))
- checkCacheMapEntry(TRANSACTIONAL_SNAPSHOT, PARTITIONED, GridDhtCacheEntry.class);
-
checkCacheMapEntry(ATOMIC, REPLICATED, GridDhtCacheEntry.class);
checkCacheMapEntry(TRANSACTIONAL, REPLICATED, GridDhtCacheEntry.class);
-
- if (MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.CACHE_STORE))
- checkCacheMapEntry(TRANSACTIONAL_SNAPSHOT, REPLICATED, GridDhtCacheEntry.class);
}
/**
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutEventListenerErrorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutEventListenerErrorSelfTest.java
index ec246603df3..924c8e5d85b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutEventListenerErrorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutEventListenerErrorSelfTest.java
@@ -30,7 +30,6 @@ import org.apache.ignite.events.EventType;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -40,8 +39,6 @@ import org.junit.Test;
public class CachePutEventListenerErrorSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_EVENTS);
-
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setIncludeEventTypes(EventType.EVT_CACHE_OBJECT_PUT);
@@ -51,8 +48,6 @@ public class CachePutEventListenerErrorSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_EVENTS);
-
startGridsMultiThreaded(3);
Ignite ignite = startClientGrid("client");
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutIfAbsentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutIfAbsentTest.java
index f3a17caf956..3bebf5a6655 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutIfAbsentTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CachePutIfAbsentTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.IgniteTransactions;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -116,9 +115,6 @@ public class CachePutIfAbsentTest extends GridCommonAbstractTest {
for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
for (TransactionIsolation isolation : TransactionIsolation.values()) {
- if (MvccFeatureChecker.forcedMvcc() && !MvccFeatureChecker.isSupported(concurrency, isolation))
- continue;
-
try (Transaction tx = txs.txStart(concurrency, isolation)) {
Object old = cache.getAndPutIfAbsent(key, 3);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadThroughRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadThroughRestartSelfTest.java
index 52a92aad8e6..9840540148a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadThroughRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadThroughRestartSelfTest.java
@@ -24,11 +24,9 @@ import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.TransactionConfiguration;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -38,12 +36,6 @@ import static org.apache.ignite.cache.CacheMode.PARTITIONED;
* Test for read through store.
*/
public class CacheReadThroughRestartSelfTest extends GridCacheAbstractSelfTest {
- /** */
- @Before
- public void beforeCacheReadThroughRestartSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected int gridCount() {
return 2;
@@ -115,9 +107,6 @@ public class CacheReadThroughRestartSelfTest extends GridCacheAbstractSelfTest {
for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) {
for (TransactionIsolation txIsolation : TransactionIsolation.values()) {
- if (MvccFeatureChecker.forcedMvcc() && !MvccFeatureChecker.isSupported(txConcurrency, txIsolation))
- continue;
-
try (Transaction tx = ignite.transactions().txStart(txConcurrency, txIsolation, 100000, 1000)) {
for (int k = 0; k < 1000; k++) {
String key = "key" + k;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheRemoveAllSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheRemoveAllSelfTest.java
index 871da109d27..430d32a980e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheRemoveAllSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheRemoveAllSelfTest.java
@@ -24,22 +24,13 @@ import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.junit.Assume;
import org.junit.Test;
/**
* Test remove all method.
*/
public class CacheRemoveAllSelfTest extends GridCacheAbstractSelfTest {
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10082", MvccFeatureChecker.forcedMvcc());
-
- super.beforeTest();
- }
-
- /** {@inheritDoc} */
+ /** {@inheritDoc} */
@Override protected long getTestTimeout() {
return 2 * 60 * 1000;
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
index 049b2bf0e8f..b329cf5ed50 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
@@ -44,9 +44,9 @@ import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
+
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
/**
@@ -267,8 +267,6 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
*/
@Test
public void testNearDoubleDestroy() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
-
startGridsMultiThreaded(gridCount());
nearDestroy();
@@ -552,8 +550,6 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
*/
@Test
public void testNearClose() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
-
startGridsMultiThreaded(gridCount());
IgniteCache<String, String> cache0 = grid(0).getOrCreateCache(getNearConfig());
@@ -630,8 +626,6 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
*/
@Test
public void testNearCloseWithTry() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
-
startGridsMultiThreaded(gridCount());
String curVal = null;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java
index afc654cd181..38dec379956 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java
@@ -39,7 +39,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.CacheStoreSessionResource;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -62,8 +61,6 @@ public class CacheStoreTxPutAllMultiNodeTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
startGrid(1);
startGrid(2);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java
index 844b9ec2e23..25519de9a95 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java
@@ -18,8 +18,6 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.junit.Before;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -27,12 +25,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
*
*/
public class CacheStoreUsageMultinodeDynamicStartTxTest extends CacheStoreUsageMultinodeDynamicStartAbstractTest {
- /** */
- @Before
- public void beforeCacheStoreUsageMultinodeDynamicStartTxTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return TRANSACTIONAL;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java
index 0599dc78b48..fcaa7cc20d7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java
@@ -18,8 +18,6 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.junit.Before;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -27,12 +25,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
*
*/
public class CacheStoreUsageMultinodeStaticStartTxTest extends CacheStoreUsageMultinodeStaticStartAbstractTest {
- /** */
- @Before
- public void beforeCacheStoreUsageMultinodeStaticStartTxTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return TRANSACTIONAL;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java
index 64083ebc72c..8613a3c2318 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java
@@ -28,7 +28,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFa
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
import org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -38,7 +37,6 @@ import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-import static org.apache.ignite.testframework.MvccFeatureChecker.Feature.NEAR_CACHE;
import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
@@ -83,8 +81,6 @@ public class CacheTxFastFinishTest extends GridCommonAbstractTest {
*/
@Test
public void testFastFinishTxNearCache() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(NEAR_CACHE);
-
nearCache = true;
fastFinishTx();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxNotAllowReadFromBackupTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxNotAllowReadFromBackupTest.java
index 89dbc047db7..a688409ed06 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxNotAllowReadFromBackupTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxNotAllowReadFromBackupTest.java
@@ -186,76 +186,6 @@ public class CacheTxNotAllowReadFromBackupTest extends GridCommonAbstractTest {
checkBackupConsistencyGetAll(cfg, TransactionConcurrency.OPTIMISTIC, TransactionIsolation.SERIALIZABLE);
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testBackupConsistencyReplicatedMvcc() throws Exception {
- CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>("test-cache");
-
- cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
- cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
- cfg.setCacheMode(CacheMode.REPLICATED);
- cfg.setReadFromBackup(false);
-
- checkBackupConsistency(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
-
- checkBackupConsistencyGetAll(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testBackupConsistencyReplicatedFullSyncMvcc() throws Exception {
- CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>("test-cache");
-
- cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
- cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
- cfg.setCacheMode(CacheMode.REPLICATED);
- cfg.setReadFromBackup(false);
-
- checkBackupConsistency(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
-
- checkBackupConsistencyGetAll(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testBackupConsistencyPartitionedMvcc() throws Exception {
- CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>("test-cache");
-
- cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
- cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
- cfg.setCacheMode(CacheMode.PARTITIONED);
- cfg.setBackups(NODES - 1);
- cfg.setReadFromBackup(false);
-
- checkBackupConsistency(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
-
- checkBackupConsistencyGetAll(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testBackupConsistencyPartitionedFullSyncMvcc() throws Exception {
- CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>("test-cache");
-
- cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
- cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
- cfg.setCacheMode(CacheMode.PARTITIONED);
- cfg.setBackups(NODES - 1);
- cfg.setReadFromBackup(false);
-
- checkBackupConsistency(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
-
- checkBackupConsistencyGetAll(cfg, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
- }
-
/**
* @param ccfg Cache configuration.
* @throws Exception If failed.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTestUtils.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTestUtils.java
index a12f9cb4871..5c4245342c7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTestUtils.java
@@ -37,7 +37,6 @@ import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.junit.Assert.fail;
@@ -52,23 +51,17 @@ public class ClusterReadOnlyModeTestUtils {
/** Replicated transactional cache. */
private static final String REPL_TX_CACHE = "repl_tx_cache";
- /** Replicated transactional cache. */
- private static final String REPL_MVCC_CACHE = "repl_mvcc_cache";
-
/** Partitioned atomic cache. */
public static final String PART_ATOMIC_CACHE = "part_atomic_cache";
/** Partitioned transactional cache. */
private static final String PART_TX_CACHE = "part_tx_cache";
- /** Partitioned mvcc transactional cache. */
- private static final String PART_MVCC_CACHE = "part_mvcc_cache";
-
/**
* @return Configured cache names.
*/
public static Collection<String> cacheNames() {
- return F.asList(REPL_ATOMIC_CACHE, REPL_TX_CACHE, REPL_MVCC_CACHE, PART_ATOMIC_CACHE, PART_TX_CACHE, PART_MVCC_CACHE);
+ return F.asList(REPL_ATOMIC_CACHE, REPL_TX_CACHE, PART_ATOMIC_CACHE, PART_TX_CACHE);
}
/**
@@ -78,10 +71,8 @@ public class ClusterReadOnlyModeTestUtils {
return F.asArray(
cacheConfiguration(REPL_ATOMIC_CACHE, REPLICATED, ATOMIC, null),
cacheConfiguration(REPL_TX_CACHE, REPLICATED, TRANSACTIONAL, null),
- cacheConfiguration(REPL_MVCC_CACHE, REPLICATED, TRANSACTIONAL_SNAPSHOT, "mvcc_repl_grp"),
cacheConfiguration(PART_ATOMIC_CACHE, PARTITIONED, ATOMIC, "part_grp"),
- cacheConfiguration(PART_TX_CACHE, PARTITIONED, TRANSACTIONAL, "part_grp"),
- cacheConfiguration(PART_MVCC_CACHE, PARTITIONED, TRANSACTIONAL_SNAPSHOT, "mvcc_part_grp")
+ cacheConfiguration(PART_TX_CACHE, PARTITIONED, TRANSACTIONAL, "part_grp")
);
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheLockTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheLockTest.java
index c9f7a97c4b4..2aba96d1453 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheLockTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheLockTest.java
@@ -22,9 +22,7 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -42,12 +40,6 @@ public class CrossCacheLockTest extends GridCommonAbstractTest {
/** */
private static final String CACHE2 = "cache2";
- /** */
- @Before
- public void beforeCrossCacheLockTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxRandomOperationsTest.java
index 507821f5aae..42975f9c205 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxRandomOperationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CrossCacheTxRandomOperationsTest.java
@@ -34,13 +34,11 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.jetbrains.annotations.Nullable;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -74,13 +72,6 @@ public class CrossCacheTxRandomOperationsTest extends GridCommonAbstractTest {
return 6 * 60 * 1000;
}
- /** */
- @Before
- public void beforeCrossCacheTxRandomOperationsTest() {
- if (nearCacheEnabled())
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
- }
-
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
@@ -189,16 +180,7 @@ public class CrossCacheTxRandomOperationsTest extends GridCommonAbstractTest {
* @param crossCacheTx If {@code true} uses cross cache transaction.
* @throws Exception If failed.
*/
- private void txOperations(CacheMode cacheMode,
- CacheWriteSynchronizationMode writeSync,
- boolean crossCacheTx) throws Exception {
- if (MvccFeatureChecker.forcedMvcc()) {
- assert !nearCacheEnabled();
-
- if (writeSync != CacheWriteSynchronizationMode.FULL_SYNC)
- return;
- }
-
+ private void txOperations(CacheMode cacheMode, CacheWriteSynchronizationMode writeSync, boolean crossCacheTx) throws Exception {
Ignite ignite = ignite(0);
try {
@@ -208,14 +190,12 @@ public class CrossCacheTxRandomOperationsTest extends GridCommonAbstractTest {
txOperations(PESSIMISTIC, REPEATABLE_READ, crossCacheTx, false);
txOperations(PESSIMISTIC, REPEATABLE_READ, crossCacheTx, true);
- if (!MvccFeatureChecker.forcedMvcc()) {
- txOperations(OPTIMISTIC, REPEATABLE_READ, crossCacheTx, false);
- txOperations(OPTIMISTIC, REPEATABLE_READ, crossCacheTx, true);
+ txOperations(OPTIMISTIC, REPEATABLE_READ, crossCacheTx, false);
+ txOperations(OPTIMISTIC, REPEATABLE_READ, crossCacheTx, true);
- if (writeSync == FULL_SYNC) {
- txOperations(OPTIMISTIC, SERIALIZABLE, crossCacheTx, false);
- txOperations(OPTIMISTIC, SERIALIZABLE, crossCacheTx, true);
- }
+ if (writeSync == FULL_SYNC) {
+ txOperations(OPTIMISTIC, SERIALIZABLE, crossCacheTx, false);
+ txOperations(OPTIMISTIC, SERIALIZABLE, crossCacheTx, true);
}
}
finally {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/EntryVersionConsistencyReadThroughTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/EntryVersionConsistencyReadThroughTest.java
index 50aa3596830..af03012533a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/EntryVersionConsistencyReadThroughTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/EntryVersionConsistencyReadThroughTest.java
@@ -37,14 +37,11 @@ import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Assume;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -96,17 +93,6 @@ public class EntryVersionConsistencyReadThroughTest extends GridCommonAbstractTe
check(false, createCacheConfiguration(TRANSACTIONAL));
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testInvokeAllMvccTxCache() throws Exception {
- Assume.assumeTrue("https://issues.apache.org/jira/browse/IGNITE-8582",
- MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.CACHE_STORE));
-
- check(false, createCacheConfiguration(TRANSACTIONAL_SNAPSHOT));
- }
-
/**
* @throws Exception If failed.
*/
@@ -131,17 +117,6 @@ public class EntryVersionConsistencyReadThroughTest extends GridCommonAbstractTe
check(true, createCacheConfiguration(TRANSACTIONAL));
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testInvokeMvccTxCache() throws Exception {
- Assume.assumeTrue("https://issues.apache.org/jira/browse/IGNITE-8582",
- MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.CACHE_STORE));
-
- check(true, createCacheConfiguration(TRANSACTIONAL_SNAPSHOT));
- }
-
/**
* Tests entry's versions consistency after invokeAll.
*
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 499c48b8a1e..79185837f18 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -97,15 +97,13 @@ import org.apache.ignite.services.ServiceContext;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.jetbrains.annotations.Nullable;
-import org.junit.Assume;
-import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
+
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -181,12 +179,6 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
/** */
private static Map<String, CacheConfiguration[]> cacheCfgMap;
- /** */
- @Before
- public void beforeGridCacheAbstractFullApiSelfTest() {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9543", MvccFeatureChecker.forcedMvcc());
- }
-
/** {@inheritDoc} */
@Override protected long getTestTimeout() {
return TEST_TIMEOUT;
@@ -204,8 +196,6 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9543", MvccFeatureChecker.forcedMvcc());
-
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
index afd38e0d9fe..ce80aeb6038 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
@@ -23,8 +23,6 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.util.typedef.CA;
import org.apache.ignite.internal.util.typedef.CAX;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.junit.Assume;
import org.junit.Test;
/**
@@ -98,8 +96,6 @@ public abstract class GridCacheAbstractIteratorsSelfTest extends GridCacheAbstra
/** */
@Test
public void testEntrySetIterator() {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10082", MvccFeatureChecker.forcedMvcc());
-
assert jcache().localSize(CachePeekMode.ALL) == entryCount();
int cnt = 0;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index 2e64c525851..346e9f922f6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -53,7 +53,6 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.jetbrains.annotations.Nullable;
@@ -93,8 +92,7 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
assert cnt >= 1 : "At least one grid must be started";
- if (!MvccFeatureChecker.forcedMvcc() || MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.CACHE_STORE))
- initStoreStrategy();
+ initStoreStrategy();
startGrids(cnt);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java
index eb09236c43e..b5687a064f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicApiAbstractTest.java
@@ -39,7 +39,6 @@ import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.GridTestThread;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -95,8 +94,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testBasicLock() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
Lock lock = cache.lock(1);
@@ -115,8 +112,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testSingleLockReentry() throws IgniteCheckedException {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
Lock lock = cache.lock(1);
@@ -146,8 +141,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testReentry() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
Lock lock = cache.lock(1);
@@ -188,8 +181,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testInterruptLock() throws InterruptedException {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
final IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
final Lock lock = cache.lock(1);
@@ -235,8 +226,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testInterruptLockWithTimeout() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
final IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
startGrid(1);
@@ -297,8 +286,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testManyLockReentries() throws IgniteCheckedException {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
Integer key = 1;
@@ -343,8 +330,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testLockMultithreaded() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
final IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
final CountDownLatch l1 = new CountDownLatch(1);
@@ -464,9 +449,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testBasicOps() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_EVENTS);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
CountDownLatch latch = new CountDownLatch(1);
@@ -529,9 +511,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testBasicOpsWithReentry() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_EVENTS);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
int key = (int)System.currentTimeMillis();
@@ -605,8 +584,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testMultiLocks() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
Collection<Integer> keys = Arrays.asList(1, 2, 3);
@@ -664,10 +641,6 @@ public abstract class GridCacheBasicApiAbstractTest extends GridCommonAbstractTe
*/
@Test
public void testPutWithExpiration() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.EXPIRATION);
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_EVENTS);
-
IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
CacheEventListener lsnr = new CacheEventListener(new CountDownLatch(1));
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java
index 325413b9f86..69880be325c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java
@@ -30,11 +30,9 @@ import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.typedef.P2;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.jetbrains.annotations.Nullable;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -50,12 +48,6 @@ public abstract class GridCacheBasicStoreAbstractTest extends GridCommonAbstract
/** Cache store. */
private static final GridCacheTestStore store = new GridCacheTestStore();
- /** */
- @Before
- public void beforeGridCacheBasicStoreAbstractTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/**
*
*/
@@ -81,8 +73,6 @@ public abstract class GridCacheBasicStoreAbstractTest extends GridCommonAbstract
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
CacheConfiguration cc = defaultCacheConfiguration();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearAllSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearAllSelfTest.java
index a824d9cbf84..f9b59a987fc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearAllSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearAllSelfTest.java
@@ -25,9 +25,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Assume;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -65,8 +63,6 @@ public class GridCacheClearAllSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-7952", MvccFeatureChecker.forcedMvcc());
-
super.beforeTestsStarted();
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java
index 5865f53fbb5..eff2d2624bf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheClearLocallySelfTest.java
@@ -31,12 +31,12 @@ import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.junit.Test;
+
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.internal.processors.cache.GridCacheAdapter.CLEAR_ALL_SPLIT_THRESHOLD;
-import static org.apache.ignite.testframework.MvccFeatureChecker.forcedMvcc;
/**
* Test {@link IgniteCache#localClearAll(java.util.Set)} operations in multinode environment with nodes having caches with different names.
@@ -206,9 +206,6 @@ public class GridCacheClearLocallySelfTest extends GridCommonAbstractTest {
* @throws Exception In case of exception.
*/
private void test(Mode mode, int keysCnt) throws Exception {
- if (forcedMvcc())
- return;
-
startUp();
// Take in count special case for near-only cache as well.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
index 10817667008..4e6964e4893 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
@@ -46,9 +46,9 @@ import org.apache.ignite.testframework.GridStringLogger;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
+
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.apache.ignite.cache.CacheRebalanceMode.ASYNC;
@@ -512,33 +512,6 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
);
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testDifferentTxAtomicity() throws Exception {
- cacheMode = PARTITIONED;
-
- checkSecondGridStartFails(
- new C1<CacheConfiguration, Void>() {
- /** {@inheritDoc} */
- @Override public Void apply(CacheConfiguration cfg) {
- cfg.setNearConfiguration(null);
- cfg.setAtomicityMode(TRANSACTIONAL);
- return null;
- }
- },
- new C1<CacheConfiguration, Void>() {
- /** {@inheritDoc} */
- @Override public Void apply(CacheConfiguration cfg) {
- cfg.setNearConfiguration(null);
- cfg.setAtomicityMode(TRANSACTIONAL_SNAPSHOT);
- return null;
- }
- }
- );
- }
-
/**
* @throws Exception If failed.
*/
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
index 414ff1caf81..c5ab1798ee7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
@@ -35,10 +35,10 @@ import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.marshaller.MarshallerContext;
import org.apache.ignite.marshaller.jdk.JdkMarshaller;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Ignore;
import org.junit.Test;
+
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -204,8 +204,6 @@ public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
/** @throws Exception If failed. */
@Test
public void testPartitionedNearEnabled() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
-
IgniteCache<Integer, Value> cache = createCache(true, PARTITIONED);
try {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
index 4b4f5d80474..1828d48833e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
@@ -29,7 +29,6 @@ import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager.TOP_VER_BASE_TIME;
@@ -77,16 +76,6 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
checkVersion();
}
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testVersionMvccTx() throws Exception {
- atomicityMode = TRANSACTIONAL_SNAPSHOT;
-
- checkVersion();
- }
-
/**
* @throws Exception If failed.
*/
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
index 179eae584c5..7e328954a40 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
@@ -32,9 +32,7 @@ import org.apache.ignite.events.CacheEvent;
import org.apache.ignite.events.Event;
import org.apache.ignite.events.EventType;
import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.events.EventType.EVT_CACHE_ENTRY_EVICTED;
@@ -46,13 +44,6 @@ import static org.apache.ignite.events.EventType.EVT_TASK_FINISHED;
* Eviction event self test.
*/
public abstract class GridCacheEvictionEventAbstractTest extends GridCommonAbstractTest {
- /** */
- @Before
- public void beforeGridCacheEvictionEventAbstractTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.EVICTION);
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_EVENTS);
- }
-
/**
*
*/
@@ -62,9 +53,6 @@ public abstract class GridCacheEvictionEventAbstractTest extends GridCommonAbstr
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.EVICTION);
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_EVENTS);
-
IgniteConfiguration c = super.getConfiguration();
CacheConfiguration cc = defaultCacheConfiguration();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFastNodeLeftForTransactionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFastNodeLeftForTransactionTest.java
index 5a2f5dc06a1..7ffb5f09625 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFastNodeLeftForTransactionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFastNodeLeftForTransactionTest.java
@@ -97,7 +97,6 @@ public class GridCacheFastNodeLeftForTransactionTest extends GridCommonAbstractT
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
return super.getConfiguration(igniteInstanceName)
- .setMvccVacuumFrequency(1000)
.setCacheConfiguration(createCacheConfigs())
.setGridLogger(listeningLog)
.setConnectorConfiguration(new ConnectorConfiguration());
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
index 7a9298dbf73..3a6a43112ab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
@@ -34,9 +34,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -59,12 +57,6 @@ public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest
return GRID_CNT;
}
- /** */
- @Before
- public void beforeGridCacheFinishPartitionsSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
- }
-
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
grid = (IgniteKernal)grid(0);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java
index 44ee0fd32b2..894e9d4e60c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java
@@ -29,9 +29,7 @@ import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -52,12 +50,6 @@ public abstract class GridCacheGetAndTransformStoreAbstractTest extends GridComm
super(true /*start grid. */);
}
- /** */
- @Before
- public void beforeGridCacheGetAndTransformStoreAbstractTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
store.resetTimestamp();
@@ -76,8 +68,6 @@ public abstract class GridCacheGetAndTransformStoreAbstractTest extends GridComm
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
CacheConfiguration cc = defaultCacheConfiguration();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
index e2b5ade6b40..d823a490daf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAbstractSelfTest.java
@@ -40,13 +40,12 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.jetbrains.annotations.Nullable;
-import org.junit.Before;
import org.junit.Test;
+
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -77,18 +76,6 @@ public abstract class GridCacheInterceptorAbstractSelfTest extends GridCacheAbst
awaitPartitionMapExchange();
}
- /** */
- @Before
- public void beforeGridCacheInterceptorAbstractSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.INTERCEPTOR);
-
- if (nearEnabled())
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
-
- if (storeEnabled())
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
// No-op.
@@ -118,14 +105,6 @@ public abstract class GridCacheInterceptorAbstractSelfTest extends GridCacheAbst
/** {@inheritDoc} */
@Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.INTERCEPTOR);
-
- if (nearEnabled())
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
-
- if (storeEnabled())
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName);
if (!storeEnabled()) {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorTransactionalRebalanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorTransactionalRebalanceTest.java
index 682fbf1b933..87c3f32e7ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorTransactionalRebalanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorTransactionalRebalanceTest.java
@@ -18,17 +18,11 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.testframework.MvccFeatureChecker;
/**
*
*/
public class GridCacheInterceptorTransactionalRebalanceTest extends GridAbstractCacheInterceptorRebalanceTest {
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.INTERCEPTOR);
- }
-
/** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return CacheAtomicityMode.TRANSACTIONAL;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java
index 563f71a0dbc..e5c94f79dc6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMarshallingNodeJoinSelfTest.java
@@ -36,10 +36,8 @@ import org.apache.ignite.events.Event;
import org.apache.ignite.events.EventType;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.util.typedef.PE;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Before;
import org.junit.Test;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
@@ -48,16 +46,8 @@ import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_REA
/**
*/
public class GridCacheMarshallingNodeJoinSelfTest extends GridCommonAbstractTest {
- /** */
- @Before
- public void beforeGridCacheMarshallingNodeJoinSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration<Integer, TestObject> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
@@ -76,8 +66,6 @@ public class GridCacheMarshallingNodeJoinSelfTest extends GridCommonAbstractTest
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);
-
startGridsMultiThreaded(2);
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
index b9b6bb7162b..090bc175871 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
@@ -30,7 +30,6 @@ import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.lang.IgniteCallable;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.junit.Test;
@@ -115,7 +114,7 @@ public class GridCacheMixedPartitionExchangeSelfTest extends GridCommonAbstractT
}
catch (Exception e) {
if (!X.hasCause(e, ClusterTopologyCheckedException.class))
- MvccFeatureChecker.assertMvccWriteConflict(e);
+ throw e;
}
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
index cb50c9ef1a7..c0908f6f005 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.testframework.GridTestUtils;
import org.junit.Test;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-import static org.apache.ignite.testframework.MvccFeatureChecker.assertMvccWriteConflict;
/**
* Multinode update test.
@@ -103,20 +102,8 @@ public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCache
final IgniteCache<Integer, Integer> cache = grid(idx).cache(DEFAULT_CACHE_NAME);
- for (int i = 0; i < ITERATIONS_PER_THREAD && !failed; i++) {
- boolean updated = false;
-
- while (!updated) {
- try {
- cache.invoke(key, new IncProcessor());
-
- updated = true;
- }
- catch (Exception e) {
- assertMvccWriteConflict(e);
- }
- }
- }
+ for (int i = 0; i < ITERATIONS_PER_THREAD && !failed; i++)
+ cache.invoke(key, new IncProcessor());
return null;
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java
index 0eaedabd20e..c7288eaf072 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java
@@ -18,9 +18,6 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.junit.Assume;
-import org.junit.Test;
/**
*
@@ -39,12 +36,4 @@ public class GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest extends GridCa
return ccfg;
}
-
- /** {@inheritDoc} */
- @Test
- @Override public void testInvoke() throws Exception {
- Assume.assumeTrue("https://issues.apache.org/jira/browse/IGNITE-809", MvccFeatureChecker.forcedMvcc());
-
- super.testInvoke();
- }
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java
index 627a9369923..cbfc9e360b9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java
@@ -19,9 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.configuration.NearCacheConfiguration;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.junit.Assume;
-import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -30,12 +28,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
* TODO: IGNITE-809.
*/
public class GridCacheMultinodeUpdateNearEnabledSelfTest extends GridCacheMultinodeUpdateAbstractSelfTest {
- /** */
- @Before
- public void beforeGridCacheMultinodeUpdateNearEnabledSelfTest() {
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
- }
-
/** {@inheritDoc} */
@Override protected NearCacheConfiguration nearConfiguration() {
return new NearCacheConfiguration();
@@ -48,9 +40,8 @@ public class GridCacheMultinodeUpdateNearEnabledSelfTest extends GridCacheMultin
/** {@inheritDoc} */
@Test
+ @Ignore("https://issues.apache.org/jira/browse/IGNITE-809")
@Override public void testInvoke() throws Exception {
- Assume.assumeTrue("https://issues.apache.org/jira/browse/IGNITE-809", MvccFeatureChecker.forcedMvcc());
-
- super.testInvoke();
+ // No-op.
}
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java
deleted file mode 100644
index c9e84582fe9..00000000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccFlagsTest.java
+++ /dev/null
@@ -1,147 +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;
-
-import java.util.UUID;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Test;
-
-import static org.apache.ignite.cache.CacheMode.REPLICATED;
-
-/**
- * Tests flags correctness.
- */
-public class GridCacheMvccFlagsTest extends GridCommonAbstractTest {
- /** Grid. */
- private IgniteKernal grid;
-
- /**
- *
- */
- public GridCacheMvccFlagsTest() {
- super(true /*start grid. */);
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- grid = (IgniteKernal)grid();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- grid = null;
- }
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration() throws Exception {
- IgniteConfiguration cfg = super.getConfiguration();
-
- CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
- cacheCfg.setCacheMode(REPLICATED);
-
- cfg.setCacheConfiguration(cacheCfg);
-
- return cfg;
- }
-
- /**
- *
- */
- @Test
- public void testAllTrueFlags() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID id = UUID.randomUUID();
-
- GridCacheVersion ver = new GridCacheVersion(1, 0, 0, 0);
-
- GridCacheMvccCandidate c = new GridCacheMvccCandidate(
- entry,
- id,
- id,
- ver,
- 1,
- ver,
- true,
- true,
- true,
- true,
- true,
- true,
- null,
- true
- );
-
- c.setOwner();
- c.setReady();
- c.setUsed();
- c.setRemoved();
-
- short flags = c.flags();
-
- info("Candidate: " + c);
-
- for (GridCacheMvccCandidate.Mask mask : GridCacheMvccCandidate.Mask.values())
- assertTrue("Candidate: " + c, mask.get(flags));
- }
-
- /**
- *
- */
- @Test
- public void testAllFalseFlags() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID id = UUID.randomUUID();
-
- GridCacheVersion ver = new GridCacheVersion(1, 0, 0, 0);
-
- GridCacheMvccCandidate c = new GridCacheMvccCandidate(
- entry,
- id,
- id,
- ver,
- 1,
- ver,
- false,
- false,
- false,
- false,
- false,
- false,
- null,
- false
- );
-
- short flags = c.flags();
-
- info("Candidate: " + c);
-
- for (GridCacheMvccCandidate.Mask mask : GridCacheMvccCandidate.Mask.values())
- assertFalse("Mask check failed [mask=" + mask + ", c=" + c + ']', mask.get(flags));
- }
-}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java
deleted file mode 100644
index b3221193469..00000000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManagerSelfTest.java
+++ /dev/null
@@ -1,102 +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;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.apache.ignite.transactions.Transaction;
-import org.junit.Test;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-import static org.apache.ignite.cache.CacheMode.REPLICATED;
-
-/**
- * Tests for {@link GridCacheMvccManager}.
- */
-public class GridCacheMvccManagerSelfTest extends GridCommonAbstractTest {
- /** Cache mode. */
- private CacheMode mode;
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
- cfg.setCacheConfiguration(cacheConfiguration());
-
- return cfg;
- }
-
- /** @return Cache configuration. */
- protected CacheConfiguration cacheConfiguration() {
- CacheConfiguration cfg = defaultCacheConfiguration();
-
- cfg.setCacheMode(mode);
- cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
- cfg.setAtomicityMode(TRANSACTIONAL);
-
- return cfg;
- }
-
- /** @throws Exception If failed. */
- @Test
- public void testReplicatedCache() throws Exception {
- mode = REPLICATED;
-
- testCandidates(3);
- }
-
- /** @throws Exception If failed. */
- @Test
- public void testPartitionedCache() throws Exception {
- mode = PARTITIONED;
-
- testCandidates(3);
- }
-
- /**
- * @param gridCnt Grid count.
- * @throws Exception If failed.
- */
- private void testCandidates(int gridCnt) throws Exception {
- try {
- Ignite ignite = startGridsMultiThreaded(gridCnt);
-
- IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME);
-
- Transaction tx = ignite.transactions().txStart();
-
- cache.put(1, 1);
-
- tx.commit();
-
- for (int i = 0; i < gridCnt; i++) {
- assert ((IgniteKernal)grid(i)).internalCache(DEFAULT_CACHE_NAME).context().mvcc().localCandidates().isEmpty();
- assert ((IgniteKernal)grid(i)).internalCache(DEFAULT_CACHE_NAME).context().mvcc().remoteCandidates().isEmpty();
- }
- }
- finally {
- stopAllGrids();
- }
- }
-}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccMultiThreadedUpdateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccMultiThreadedUpdateSelfTest.java
deleted file mode 100644
index f48300dac12..00000000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccMultiThreadedUpdateSelfTest.java
+++ /dev/null
@@ -1,218 +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;
-
-import java.util.concurrent.Callable;
-import java.util.function.Supplier;
-import javax.cache.CacheException;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteTransactions;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
-import org.apache.ignite.transactions.Transaction;
-import org.junit.Test;
-
-import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
-import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
-
-/**
- * Multithreaded update test.
- */
-public class GridCacheMvccMultiThreadedUpdateSelfTest extends GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest {
- /** */
- public static final int THREADS = 5;
-
- /** {@inheritDoc} */
- @Override protected long getTestTimeout() {
- return 5 * 60_000;
- }
-
- /** {@inheritDoc} */
- @Override protected CacheAtomicityMode atomicityMode() {
- return CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testTransformTx() throws Exception {
- testTransformTx(keyForNode(0));
-
- if (gridCount() > 1)
- testTransformTx(keyForNode(1));
- }
-
- /**
- * @param key Key.
- * @throws Exception If failed.
- */
- private void testTransformTx(final Integer key) throws Exception {
- final IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
-
- cache.put(key, 0);
-
- final int ITERATIONS_PER_THREAD = iterations();
-
- GridTestUtils.runMultiThreaded(new Callable<Void>() {
- @Override public Void call() throws Exception {
- IgniteTransactions txs = ignite(0).transactions();
-
- for (int i = 0; i < ITERATIONS_PER_THREAD && !failed; i++) {
- if (i % 500 == 0)
- log.info("Iteration " + i);
-
- doOperation(() -> {
- try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.invoke(key, new IncProcessor());
-
- tx.commit();
- }
- });
- }
-
- return null;
- }
- }, THREADS, "transform");
-
- for (int i = 0; i < gridCount(); i++) {
- Integer val = (Integer)grid(i).cache(DEFAULT_CACHE_NAME).get(key);
-
- assertEquals("Unexpected value for grid " + i, (Integer)(ITERATIONS_PER_THREAD * THREADS), val);
- }
-
- if (failed) {
- for (int g = 0; g < gridCount(); g++)
- info("Value for cache [g=" + g + ", val=" + grid(g).cache(DEFAULT_CACHE_NAME).get(key) + ']');
-
- assertFalse(failed);
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testPutTxPessimistic() throws Exception {
- testPutTx(keyForNode(0));
-
- if (gridCount() > 1)
- testPutTx(keyForNode(1));
- }
-
- /**
- * @param key Key.
- * @throws Exception If failed.
- */
- private void testPutTx(final Integer key) throws Exception {
- final IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
-
- cache.put(key, 0);
-
- final int ITERATIONS_PER_THREAD = iterations();
-
- GridTestUtils.runMultiThreaded(new Callable<Void>() {
- @Override public Void call() throws Exception {
- for (int i = 0; i < ITERATIONS_PER_THREAD; i++) {
- if (i % 500 == 0)
- log.info("Iteration " + i);
-
- int val0 = i;
- doOperation(() -> {
- try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- Integer val = cache.getAndPut(key, val0);
-
- assertNotNull(val);
-
- tx.commit();
- }
- });
- }
-
- return null;
- }
- }, THREADS, "put");
-
- for (int i = 0; i < gridCount(); i++) {
- Integer val = (Integer)grid(i).cache(DEFAULT_CACHE_NAME).get(key);
-
- assertNotNull("Unexpected value for grid " + i, val);
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testPutxIfAbsentTxPessimistic() throws Exception {
- testPutxIfAbsentTx(keyForNode(0));
-
- if (gridCount() > 1)
- testPutxIfAbsentTx(keyForNode(1));
- }
-
- /**
- * @param key Key.
- * @throws Exception If failed.
- */
- private void testPutxIfAbsentTx(final Integer key) throws Exception {
- final IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
-
- cache.put(key, 0);
-
- final int ITERATIONS_PER_THREAD = iterations();
-
- GridTestUtils.runMultiThreaded(new Callable<Void>() {
- @Override public Void call() throws Exception {
- for (int i = 0; i < ITERATIONS_PER_THREAD && !failed; i++) {
- if (i % 500 == 0)
- log.info("Iteration " + i);
-
- try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.putIfAbsent(key, 100);
-
- tx.commit();
- }
- }
-
- return null;
- }
- }, THREADS, "putxIfAbsent");
-
- for (int i = 0; i < gridCount(); i++) {
- Integer val = (Integer)grid(i).cache(DEFAULT_CACHE_NAME).get(key);
-
- assertEquals("Unexpected value for grid " + i, (Integer)0, val);
- }
-
- assertFalse(failed);
- }
-
- /** {@inheritDoc} */
- @Override protected <T> T doOperation(Supplier<T> op) {
- while (true) {
- try {
- return super.doOperation(op);
- }
- catch (CacheException e) {
- MvccFeatureChecker.assertMvccWriteConflict(e);
- }
- }
- }
-}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
deleted file mode 100644
index 58b5966e9cf..00000000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccPartitionedSelfTest.java
+++ /dev/null
@@ -1,1083 +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;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.UUID;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.jetbrains.annotations.Nullable;
-import org.junit.Test;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
-/**
- * Test cases for multi-threaded tests in partitioned cache.
- */
-public class GridCacheMvccPartitionedSelfTest extends GridCommonAbstractTest {
- /** */
- private static final UUID nodeId = UUID.randomUUID();
-
- /** Grid. */
- private IgniteKernal grid;
-
- /**
- *
- */
- public GridCacheMvccPartitionedSelfTest() {
- super(true /*start grid. */);
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- grid = (IgniteKernal)grid();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- grid = null;
- }
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration() throws Exception {
- IgniteConfiguration cfg = super.getConfiguration();
-
- CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
- cacheCfg.setCacheMode(PARTITIONED);
- cacheCfg.setBackups(1);
- cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
- cfg.setCacheConfiguration(cacheCfg);
-
- return cfg;
- }
-
- /**
- * Tests remote candidates.
- */
- @Test
- public void testNearLocalsWithPending() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
-
- GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addNearLocal(node1, 1, ver2, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(ver2, nearLocCands.iterator().next().version());
-
- assertEquals(1, rmtCands.size());
- assertEquals(ver1, rmtCands.iterator().next().version());
-
- entry.readyNearLocal(ver2, ver2, empty(), empty(), Arrays.asList(ver1));
-
- checkLocalOwner(c2, ver2, false);
- checkRemote(c1, ver1, false, false);
-
- assertNotNull(entry.anyOwner());
- assertEquals(ver2, entry.anyOwner().version());
- }
-
- /**
- * Tests remote candidates.
- */
- @Test
- public void testNearLocalsWithCommitted() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
-
- GridCacheMvccCandidate c1 = entry.addNearLocal(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(ver1, nearLocCands.iterator().next().version());
-
- assertEquals(1, rmtCands.size());
- assertEquals(ver2, rmtCands.iterator().next().version());
-
- entry.readyNearLocal(ver1, ver1, Arrays.asList(ver2), empty(), empty());
-
- checkLocal(c1, ver1, true, false, false);
- checkRemote(c2, ver2, true, false);
-
- assertNull(entry.anyOwner());
- }
-
- /**
- * Tests remote candidates.
- */
- @Test
- public void testNearLocalsWithRolledback() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
-
- GridCacheMvccCandidate c1 = entry.addNearLocal(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(ver1, nearLocCands.iterator().next().version());
-
- assertEquals(1, rmtCands.size());
- assertEquals(ver2, rmtCands.iterator().next().version());
-
- entry.readyNearLocal(ver1, ver1, empty(), Arrays.asList(ver2), empty());
-
- checkLocal(c1, ver1, true, false, false);
- checkRemote(c2, ver2, true, false);
-
- assertNull(entry.anyOwner());
- }
-
- /**
- * Tests remote candidates.
- */
- @Test
- public void testNearLocals() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
-
- GridCacheMvccCandidate c1 = entry.addNearLocal(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addNearLocal(node1, 1, ver2, true);
-
- entry.readyNearLocal(ver2, ver2, empty(), empty(), empty());
-
- checkLocalOwner(c2, ver2, false);
- checkLocal(c1, ver1, false, false, false);
-
- Collection<GridCacheMvccCandidate> cands = entry.localCandidates();
-
- assert cands.size() == 2;
- assert cands.iterator().next().version().equals(ver2);
-
- checkLocalOwner(c2, ver2, false);
- checkLocal(c1, ver1, false, false, false);
- }
-
- /**
- * Tests remote candidates.
- */
- @Test
- public void testNearLocalsWithOwned() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
-
- GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addNearLocal(node1, 1, ver2, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(ver2, nearLocCands.iterator().next().version());
-
- assertEquals(1, rmtCands.size());
- assertEquals(ver1, rmtCands.iterator().next().version());
-
- entry.orderOwned(ver1, ver2);
-
- entry.readyNearLocal(ver2, ver2, empty(), empty(), empty());
-
- checkRemote(c1, ver1, false, false);
-
- assertFalse(c1.owner());
-
- checkLocalOwner(c2, ver2, false);
-
- assertNotNull(entry.anyOwner());
- assertEquals(ver2, entry.anyOwner().version());
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testAddPendingRemote0() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver0 = version(0);
- GridCacheVersion ver1 = version(1);
-
- entry.addNearLocal(node1, 1, ver1, true);
-
- entry.readyNearLocal(ver1, ver1, empty(), empty(), Collections.singletonList(ver0));
-
- entry.addRemote(node1, 1, ver0, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(ver1, nearLocCands.iterator().next().version());
-
- assertEquals(1, rmtCands.size());
- assertEquals(ver0, rmtCands.iterator().next().version());
-
- assertNotNull(entry.anyOwner());
- assertEquals(ver1, entry.anyOwner().version());
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testAddPendingRemote1() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver0 = version(0);
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
-
- GridCacheMvccCandidate c3 = entry.addNearLocal(node1, 1, ver3, true);
-
- entry.readyNearLocal(ver3, ver3, empty(), empty(), Arrays.asList(ver0, ver1, ver2));
-
- GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, true);
- GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, true);
- GridCacheMvccCandidate c0 = entry.addRemote(node1, 1, ver0, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
-
- assert rmtCands.size() == 3;
-
- // DHT remote candidates are not reordered and sorted.
- GridCacheMvccCandidate[] candArr = new GridCacheMvccCandidate[] {c2, c1, c0};
-
- rmtCands = entry.remoteMvccSnapshot();
-
- int i = 0;
-
- for (GridCacheMvccCandidate cand : rmtCands) {
- assert cand == candArr[i] : "Invalid candidate in position " + i;
-
- i++;
- }
-
- assertEquals(c3, entry.anyOwner());
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testAddPendingRemote2() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver0 = version(0);
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
-
- GridCacheMvccCandidate c3 = entry.addNearLocal(node1, 1, ver3, true);
- entry.addNearLocal(node1, 1, ver2, true);
-
- entry.readyNearLocal(ver3, ver3, empty(), empty(), Arrays.asList(ver0, ver1, ver2));
-
- GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, true);
- GridCacheMvccCandidate c0 = entry.addRemote(node1, 1, ver0, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
-
- assertEquals(2, rmtCands.size());
-
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(2, nearLocCands.size());
-
- GridCacheMvccCandidate[] candArr = new GridCacheMvccCandidate[] {c1, c0};
-
- int i = 0;
-
- for (GridCacheMvccCandidate cand : rmtCands) {
- assert cand == candArr[i] : "Invalid candidate in position " + i;
-
- i++;
- }
-
- assertEquals(c3, entry.anyOwner());
- }
-
- /**
- * Tests salvageRemote method
- */
- @Test
- public void testSalvageRemote() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addRemote(node1, 1, ver2, true);
- GridCacheMvccCandidate c3 = entry.addNearLocal(node1, 1, ver3, true);
- GridCacheMvccCandidate c4 = entry.addRemote(node1, 1, ver4, true);
- entry.addRemote(node1, 1, ver5, true);
- entry.addRemote(node1, 1, ver6, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
-
- assertEquals(5, rmtCands.size());
- assertEquals(ver1, rmtCands.iterator().next().version());
-
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(ver3, nearLocCands.iterator().next().version());
-
- entry.salvageRemote(ver4);
-
- rmtCands = entry.remoteMvccSnapshot();
-
- boolean before = true;
-
- for (GridCacheMvccCandidate cand : rmtCands) {
- if (cand == c4) {
- before = false;
-
- continue;
- }
-
- if (before && cand != c3) {
- assertTrue(cand.owner());
- assertTrue(cand.used());
- }
- else {
- assertFalse(cand.owner());
- assertFalse(cand.used());
- }
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testNearRemoteConsistentOrdering0() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(10);
- GridCacheVersion nearVer2 = version(5);
- GridCacheVersion ver2 = version(20);
- GridCacheVersion ver3 = version(30);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addNearLocal(node1, 1, nearVer2, true);
- entry.addRemote(node1, 1, ver3, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(nearVer2, nearLocCands.iterator().next().version());
-
- assertEquals(2, rmtCands.size());
- assertEquals(ver1, rmtCands.iterator().next().version());
-
- entry.readyNearLocal(nearVer2, ver2, empty(), empty(), empty());
-
- assertNull(entry.anyOwner());
-
- rmtCands = entry.remoteMvccSnapshot();
-
- assertEquals(ver1, rmtCands.iterator().next().version());
- assertTrue(rmtCands.iterator().next().owner());
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testNearRemoteConsistentOrdering1() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(10);
- GridCacheVersion nearVer2 = version(5);
- GridCacheVersion ver2 = version(20);
- GridCacheVersion ver3 = version(30);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addNearLocal(node1, 1, nearVer2, true);
- entry.addRemote(node1, 1, ver3, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(nearVer2, nearLocCands.iterator().next().version());
-
- assertEquals(2, rmtCands.size());
- assertEquals(ver1, rmtCands.iterator().next().version());
-
- entry.orderCompleted(nearVer2, Arrays.asList(ver3), empty());
- entry.readyNearLocal(nearVer2, ver2, empty(), empty(), Arrays.asList(ver1));
-
- nearLocCands = entry.localCandidates();
- rmtCands = entry.remoteMvccSnapshot();
-
- assertNull(entry.anyOwner());
- assertEquals(ver3, rmtCands.iterator().next().version());
- assertTrue(rmtCands.iterator().next().owner());
-
- GridCacheMvccCandidate cand = nearLocCands.iterator().next();
-
- assertTrue(cand.ready());
- assertFalse(cand.owner());
- assertFalse(cand.used());
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testNearRemoteConsistentOrdering2() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(10);
- GridCacheVersion nearVer2 = version(5);
- GridCacheVersion ver2 = version(20);
- GridCacheVersion ver3 = version(30);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addNearLocal(node1, 1, nearVer2, true);
- entry.addRemote(node1, 1, ver3, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(nearVer2, nearLocCands.iterator().next().version());
-
- assertEquals(2, rmtCands.size());
- assertEquals(ver1, rmtCands.iterator().next().version());
-
- entry.orderCompleted(nearVer2, empty(), empty());
- entry.readyNearLocal(nearVer2, ver2, empty(), empty(), empty());
-
- nearLocCands = entry.localCandidates();
- rmtCands = entry.remoteMvccSnapshot();
-
- assertNull(entry.anyOwner());
- assertEquals(ver1, rmtCands.iterator().next().version());
- assertTrue(rmtCands.iterator().next().owner());
-
- GridCacheMvccCandidate cand = nearLocCands.iterator().next();
-
- assertTrue(cand.ready());
- assertFalse(cand.used());
- assertFalse(cand.owner());
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testNearRemoteConsistentOrdering3() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(10);
- GridCacheVersion nearVer2 = version(5);
- GridCacheVersion ver2 = version(20);
- GridCacheVersion ver3 = version(30);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addNearLocal(node1, 1, nearVer2, true);
- entry.addRemote(node1, 1, ver3, true);
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
- Collection<GridCacheMvccCandidate> nearLocCands = entry.localCandidates();
-
- assertEquals(1, nearLocCands.size());
- assertEquals(nearVer2, nearLocCands.iterator().next().version());
-
- assertEquals(2, rmtCands.size());
- assertEquals(ver1, rmtCands.iterator().next().version());
-
- entry.orderCompleted(nearVer2, empty(), empty());
- entry.readyNearLocal(nearVer2, ver2, empty(), empty(), Arrays.asList(ver1));
-
- rmtCands = entry.remoteMvccSnapshot();
-
- assertNotNull(entry.anyOwner());
- checkLocalOwner(entry.anyOwner(), nearVer2, false);
-
- assertEquals(ver1, rmtCands.iterator().next().version());
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testSerializableReadLocksAdd() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1);
- GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1);
- GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1);
-
- {
- GridCacheMvcc mvcc = new GridCacheMvcc(cache.context());
-
- GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheMvccCandidate cand1 = addLocal(mvcc, e, version(1), serOrder1, true);
-
- assertNotNull(cand1);
-
- GridCacheMvccCandidate cand2 = addLocal(mvcc, e, version(2), serOrder2, true);
-
- assertNotNull(cand2);
-
- GridCacheMvccCandidate cand3 = addLocal(mvcc, e, version(3), serOrder3, false);
-
- assertNull(cand3);
-
- cand3 = addLocal(mvcc, e, version(3), serOrder3, true);
-
- assertNotNull(cand3);
- }
-
- {
- GridCacheMvcc mvcc = new GridCacheMvcc(cache.context());
-
- GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheMvccCandidate cand1 = addLocal(mvcc, e, version(1), serOrder2, true);
-
- assertNotNull(cand1);
-
- GridCacheMvccCandidate cand2 = addLocal(mvcc, e, version(2), serOrder1, true);
-
- assertNotNull(cand2);
-
- GridCacheMvccCandidate cand3 = addLocal(mvcc, e, version(3), serOrder3, false);
-
- assertNull(cand3);
-
- cand3 = addLocal(mvcc, e, version(3), serOrder3, true);
-
- assertNotNull(cand3);
- }
-
- {
- GridCacheMvcc mvcc = new GridCacheMvcc(cache.context());
-
- GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheMvccCandidate cand1 = addLocal(mvcc, e, version(1), serOrder3, false);
-
- assertNotNull(cand1);
-
- GridCacheMvccCandidate cand2 = addLocal(mvcc, e, version(2), serOrder2, true);
-
- assertNotNull(cand2);
-
- GridCacheMvccCandidate cand3 = addLocal(mvcc, e, version(3), serOrder1, true);
-
- assertNull(cand3);
-
- cand3 = addLocal(mvcc, e, version(3), serOrder1, false);
-
- assertNull(cand3);
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testSerializableReadLocksAssign() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1);
- GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1);
- GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1);
-
- {
- GridCacheMvcc mvcc = new GridCacheMvcc(cache.context());
-
- GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheMvccCandidate cand1 = addLocal(mvcc, e, version(1), serOrder1, true);
-
- assertNotNull(cand1);
-
- GridCacheMvccCandidate cand2 = addLocal(mvcc, e, version(2), serOrder2, true);
-
- assertNotNull(cand2);
-
- GridCacheMvccCandidate cand3 = addLocal(mvcc, e, version(3), serOrder3, false);
-
- assertNull(cand3);
-
- cand3 = addLocal(mvcc, e, version(3), serOrder3, true);
-
- assertNotNull(cand3);
-
- CacheLockCandidates owners = mvcc.recheck();
-
- assertNull(owners);
-
- cand1.setReady();
-
- owners = mvcc.recheck();
-
- assertSame(cand1, owners);
- checkCandidates(owners, cand1.version());
-
- cand2.setReady();
-
- owners = mvcc.recheck();
- checkCandidates(owners, cand1.version(), cand2.version());
-
- mvcc.remove(cand1.version());
-
- owners = mvcc.recheck();
- assertSame(cand2, owners);
- checkCandidates(owners, cand2.version());
- }
-
- {
- GridCacheMvcc mvcc = new GridCacheMvcc(cache.context());
-
- GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheMvccCandidate cand1 = addLocal(mvcc, e, version(1), serOrder1, true);
-
- assertNotNull(cand1);
-
- GridCacheMvccCandidate cand2 = addLocal(mvcc, e, version(2), serOrder2, true);
-
- assertNotNull(cand2);
-
- GridCacheMvccCandidate cand3 = addLocal(mvcc, e, version(3), serOrder3, false);
-
- assertNull(cand3);
-
- cand3 = addLocal(mvcc, e, version(3), serOrder3, true);
-
- assertNotNull(cand3);
-
- CacheLockCandidates owners = mvcc.recheck();
-
- assertNull(owners);
-
- cand2.setReady();
-
- owners = mvcc.recheck();
-
- assertSame(cand2, owners);
- checkCandidates(owners, cand2.version());
-
- cand1.setReady();
-
- owners = mvcc.recheck();
- checkCandidates(owners, cand1.version(), cand2.version());
-
- mvcc.remove(cand2.version());
-
- owners = mvcc.recheck();
- assertSame(cand1, owners);
- checkCandidates(owners, cand1.version());
- }
- }
-
- /**
- * @param all Candidates list.
- * @param vers Expected candidates.
- */
- private void checkCandidates(CacheLockCandidates all, GridCacheVersion...vers) {
- assertNotNull(all);
- assertEquals(vers.length, all.size());
-
- for (GridCacheVersion ver : vers)
- assertTrue(all.hasCandidate(ver));
- }
-
- /**
- * @param mvcc Mvcc.
- * @param e Entry.
- * @param ver Version.
- * @param serOrder Serializable tx version.
- * @param read Read lock flag.
- * @return Candidate.
- */
- @Nullable private GridCacheMvccCandidate addLocal(GridCacheMvcc mvcc,
- GridCacheEntryEx e,
- GridCacheVersion ver,
- GridCacheVersion serOrder,
- boolean read) {
- return mvcc.addLocal(e,
- nodeId,
- null,
- 1,
- ver,
- 0,
- serOrder,
- false,
- true,
- false,
- true,
- read
- );
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testSerializableLocks() throws Exception {
- checkSerializableAdd(false);
-
- checkSerializableAdd(true);
-
- checkNonSerializableConflict();
- }
-
- /**
- * @throws Exception If failed.
- */
- private void checkNonSerializableConflict() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- UUID nodeId = UUID.randomUUID();
-
- GridCacheMvcc mvcc = new GridCacheMvcc(cache.context());
-
- GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheMvccCandidate cand1 = mvcc.addLocal(e,
- nodeId,
- null,
- 1,
- version(1),
- 0,
- null,
- false,
- true,
- false,
- true,
- false
- );
-
- assertNotNull(cand1);
-
- GridCacheMvccCandidate cand2 = mvcc.addLocal(e,
- nodeId,
- null,
- 1,
- version(2),
- 0,
- new GridCacheVersion(0, 0, 1),
- false,
- true,
- false,
- true,
- false
- );
-
- assertNull(cand2);
- }
-
- /**
- * @param incVer If {@code true} lock version is incremented.
- * @throws Exception If failed.
- */
- private void checkSerializableAdd(boolean incVer) throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- UUID nodeId = UUID.randomUUID();
-
- GridCacheMvcc mvcc = new GridCacheMvcc(cache.context());
-
- GridCacheTestEntryEx e = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheVersion serOrder1 = new GridCacheVersion(0, 10, 1);
- GridCacheVersion serOrder2 = new GridCacheVersion(0, 20, 1);
- GridCacheVersion serOrder3 = new GridCacheVersion(0, 15, 1);
- GridCacheVersion serOrder4 = new GridCacheVersion(0, 30, 1);
-
- GridCacheVersion ver1 = incVer ? version(1) : version(4);
- GridCacheVersion ver2 = incVer ? version(2) : version(3);
- GridCacheVersion ver3 = incVer ? version(3) : version(2);
- GridCacheVersion ver4 = incVer ? version(4) : version(1);
-
- GridCacheMvccCandidate cand1 = mvcc.addLocal(e,
- nodeId,
- null,
- 1,
- ver1,
- 0,
- serOrder1,
- false,
- true,
- false,
- true,
- false
- );
-
- assertNotNull(cand1);
-
- GridCacheMvccCandidate cand2 = mvcc.addLocal(e,
- nodeId,
- null,
- 2,
- ver2,
- 0,
- serOrder2,
- false,
- true,
- false,
- true,
- false
- );
-
- assertNotNull(cand2);
-
- GridCacheMvccCandidate cand3 = mvcc.addLocal(e,
- nodeId,
- null,
- 3,
- ver3,
- 0,
- serOrder3,
- false,
- true,
- false,
- true,
- false
- );
-
- assertNull(cand3);
-
- GridCacheMvccCandidate cand4 = mvcc.addLocal(e,
- nodeId,
- null,
- 4,
- ver4,
- 0,
- serOrder4,
- false,
- true,
- false,
- true,
- false
- );
-
- assertNotNull(cand4);
-
- CacheLockCandidates owners = mvcc.recheck();
-
- assertNull(owners);
-
- cand2.setReady();
-
- owners = mvcc.recheck();
-
- assertNull(owners);
-
- cand1.setReady();
-
- owners = mvcc.recheck();
-
- assertSame(cand1, owners);
-
- owners = mvcc.recheck();
-
- assertSame(cand1, owners);
-
- mvcc.remove(cand1.version());
-
- owners = mvcc.recheck();
-
- assertSame(cand2, owners);
- }
-
- /**
- * Gets version based on order.
- *
- * @param order Order.
- * @return Version.
- */
- private GridCacheVersion version(int order) {
- return new GridCacheVersion(1, order, order, 0);
- }
-
- /**
- * Creates an empty list of {@code GridCacheVersion}.
- *
- * @return Empty list.
- */
- private Collection<GridCacheVersion> empty() {
- return Collections.emptyList();
- }
-
- /**
- * Checks flags on local owner candidate.
- *
- * @param cand Candidate to check.
- * @param ver Cache version.
- * @param reentry Reentry flag.
- */
- private void checkLocalOwner(GridCacheMvccCandidate cand, GridCacheVersion ver, boolean reentry) {
- assert cand != null;
-
- info("Done candidate: " + cand);
-
- assert cand.version().equals(ver);
-
- // Check flags.
- assert cand.reentry() == reentry;
-
- assert !cand.used();
-
- assert cand.ready();
- assert cand.owner();
- assert cand.local();
- }
-
- /**
- * @param cand Candidate to check.
- * @param ver Version.
- * @param owner Owner flag.
- * @param used Done flag.
- */
- private void checkRemote(GridCacheMvccCandidate cand, GridCacheVersion ver, boolean owner, boolean used) {
- assert cand != null;
-
- info("Done candidate: " + cand);
-
- assert cand.version().equals(ver);
-
- // Check flags.
- assert cand.used() == used;
- assert cand.owner() == owner;
-
- assert !cand.ready();
- assert !cand.reentry();
- assert !cand.local();
- }
-
- /**
- * Checks flags on local candidate.
- *
- * @param cand Candidate to check.
- * @param ver Cache version.
- * @param ready Ready flag.
- * @param owner Lock owner.
- * @param reentry Reentry flag.
- */
- private void checkLocal(GridCacheMvccCandidate cand, GridCacheVersion ver, boolean ready,
- boolean owner, boolean reentry) {
- assert cand != null;
-
- info("Done candidate: " + cand);
-
- assert cand.version().equals(ver);
-
- // Check flags.
- assert cand.ready() == ready;
- assert cand.owner() == owner;
- assert cand.reentry() == reentry;
-
- assert !cand.used();
-
- assert cand.local();
- }
-}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccSelfTest.java
deleted file mode 100644
index ba55d0db3f3..00000000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccSelfTest.java
+++ /dev/null
@@ -1,1864 +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;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.UUID;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import static org.apache.ignite.cache.CacheMode.REPLICATED;
-
-/**
- * Test cases for multi-threaded tests.
- */
-// Tests that are not ready to be used with BinaryMarshaller.
-@Ignore("https://issues.apache.org/jira/browse/IGNITE-9214")
-public class GridCacheMvccSelfTest extends GridCommonAbstractTest {
- /** Grid. */
- private IgniteKernal grid;
-
- /**
- *
- */
- public GridCacheMvccSelfTest() {
- super(true /*start grid. */);
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- grid = (IgniteKernal)grid();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- grid = null;
- }
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration() throws Exception {
- IgniteConfiguration cfg = super.getConfiguration();
-
- CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
- cacheCfg.setCacheMode(REPLICATED);
-
- cfg.setCacheConfiguration(cacheCfg);
-
- return cfg;
- }
-
- /**
- * @throws Exception If failed.
- */
- @Test
- public void testMarshalUnmarshalCandidate() throws Exception {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx parent = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheMvccCandidate cand = new GridCacheMvccCandidate(
- parent,
- UUID.randomUUID(),
- UUID.randomUUID(),
- version(1),
- 123,
- version(2),
- /*local*/false,
- /*reentry*/false,
- true,
- false,
- false,
- false,
- null,
- false
- );
-
- Marshaller marshaller = getTestResources().getMarshaller();
-
- GridCacheMvccCandidate unmarshalled = marshaller.unmarshal(marshaller.marshal(cand), null);
-
- info(unmarshalled.toString());
- }
-
- /**
- * Tests remote candidates.
- */
- @Test
- public void testRemotes() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
-
- entry.addRemote(node1, 1, ver1, true);
-
- Collection<GridCacheMvccCandidate> cands = entry.remoteMvccSnapshot();
-
- assert cands.size() == 1;
- assert cands.iterator().next().version().equals(ver1);
-
- entry.addRemote(node2, 5, ver5, true);
-
- cands = entry.remoteMvccSnapshot();
-
- assert cands.size() == 2;
-
- info(cands);
-
- // Check order.
- checkOrder(cands, ver1, ver5);
-
- entry.addRemote(node1, 3, ver3, true);
-
- cands = entry.remoteMvccSnapshot();
-
- info(cands);
-
- assert cands.size() == 3;
-
- // No reordering happens.
- checkOrder(cands, ver1, ver5, ver3);
-
- entry.doneRemote(ver3);
-
- checkDone(entry.candidate(ver3));
-
- entry.addRemote(node1, 2, ver2, true);
-
- cands = entry.remoteMvccSnapshot();
-
- info(cands);
-
- assert cands.size() == 4;
-
- // Check order.
- checkOrder(cands, ver1, ver5, ver3, ver2);
-
- entry.orderCompleted(
- new GridCacheVersion(1, 2, 0, 0),
- Arrays.asList(new GridCacheVersion(1, 3, 4, 0), ver2, new GridCacheVersion(1, 5, 6, 0)),
- Collections.<GridCacheVersion>emptyList()
- );
-
- cands = entry.remoteMvccSnapshot();
-
- info(cands);
-
- assert cands.size() == 4;
-
- // Done ver 2.
- checkOrder(cands, ver1, ver2, ver5, ver3);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, true, false);
- checkRemote(entry.candidate(ver3), ver3, true, true);
- checkRemote(entry.candidate(ver5), ver5, false, false);
-
- entry.doneRemote(ver5);
-
- checkDone(entry.candidate(ver5));
-
- entry.addRemote(node1, 4, ver4, true);
-
- cands = entry.remoteMvccSnapshot();
-
- info(cands);
-
- assert cands.size() == 5;
-
- // Check order.
- checkOrder(cands, ver1, ver2, ver5, ver3, ver4);
-
- entry.orderCompleted(ver3, Arrays.asList(ver2, ver5), Collections.<GridCacheVersion>emptyList());
-
- cands = entry.remoteMvccSnapshot();
-
- info(cands);
-
- assert cands.size() == 5;
-
- checkOrder(cands, ver1, ver2, ver5, ver3, ver4);
-
- assert entry.anyOwner() == null;
-
- entry.doneRemote(ver1);
-
- checkRemoteOwner(entry.anyOwner(), ver1);
-
- entry.removeLock(ver1);
-
- assert entry.remoteMvccSnapshot().size() == 4;
-
- assert entry.anyOwner() == null;
-
- entry.doneRemote(ver2);
-
- checkRemoteOwner(entry.anyOwner(), ver2);
-
- entry.removeLock(ver2);
-
- assert entry.remoteMvccSnapshot().size() == 3;
-
- checkRemoteOwner(entry.anyOwner(), ver5);
-
- entry.removeLock(ver3);
-
- assert entry.remoteMvccSnapshot().size() == 2;
-
- checkRemoteOwner(entry.anyOwner(), ver5);
-
- entry.removeLock(ver5);
-
- assert entry.remoteMvccSnapshot().size() == 1;
-
- assert entry.anyOwner() == null;
-
- entry.doneRemote(ver4);
-
- checkRemoteOwner(entry.anyOwner(), ver4);
-
- entry.removeLock(ver4);
-
- assert entry.remoteMvccSnapshot().isEmpty();
-
- assert entry.anyOwner() == null;
- }
-
- /**
- * Tests that orderOwned does not reorder owned locks.
- */
- @Test
- public void testNearRemoteWithOwned() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
-
- GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, true);
- GridCacheMvccCandidate c3 = entry.addRemote(node1, 1, ver3, true);
- GridCacheMvccCandidate c4 = entry.addRemote(node1, 1, ver4, true);
-
- GridCacheMvccCandidate[] candArr = new GridCacheMvccCandidate[] {c1, c2, c3, c4};
-
- Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
-
- assert rmtCands.size() == 4;
- assert rmtCands.iterator().next().version().equals(ver1);
-
- entry.orderOwned(ver1, ver2);
-
- rmtCands = entry.remoteMvccSnapshot();
-
- int i = 0;
-
- for (GridCacheMvccCandidate cand : rmtCands) {
- assertTrue(cand == candArr[i]);
-
- assertTrue(ver2.equals(cand.ownerVersion()) || cand != c1);
-
- i++;
- }
- }
-
- /**
- * Tests that orderOwned does not reorder owned locks.
- */
- @Test
- public void testNearRemoteWithOwned1() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
-
- GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, true);
- GridCacheMvccCandidate c3 = entry.addRemote(node1, 1, ver3, true);
- GridCacheMvccCandidate c4 = entry.addRemote(node1, 1, ver4, true);
- GridCacheMvccCandidate c5 = entry.addRemote(node1, 1, ver5, true);
- GridCacheMvccCandidate c6 = entry.addRemote(node1, 1, ver6, true);
-
- GridCacheMvccCandidate[] candArr = new GridCacheMvccCandidate[] {c1, c2, c3, c4, c5, c6};
-
- Collection<GridCacheMvccCandidate> cands = entry.remoteMvccSnapshot();
-
- assert cands.size() == 6;
- assert cands.iterator().next().version().equals(ver1);
-
- entry.orderOwned(ver1, ver3);
-
- cands = entry.remoteMvccSnapshot();
-
- int i = 0;
-
- for (GridCacheMvccCandidate cand : cands) {
- assert cand == candArr[i];
-
- assertTrue(ver3.equals(cand.ownerVersion()) || cand != c1);
-
- i++;
- }
- }
-
- /**
- * Tests that orderOwned does not reorder owned locks.
- */
- @Test
- public void testNearRemoteWithOwned2() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
-
- GridCacheVersion ver0 = version(0);
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
-
- GridCacheMvccCandidate c0 = entry.addRemote(node1, 1, ver0, true);
- GridCacheMvccCandidate c1 = entry.addRemote(node1, 1, ver1, true);
- GridCacheMvccCandidate c2 = entry.addRemote(node1, 1, ver2, true);
- GridCacheMvccCandidate c3 = entry.addRemote(node1, 1, ver3, true);
- GridCacheMvccCandidate c4 = entry.addRemote(node1, 1, ver4, true);
- GridCacheMvccCandidate c5 = entry.addRemote(node1, 1, ver5, true);
- GridCacheMvccCandidate c6 = entry.addRemote(node1, 1, ver6, true);
-
- GridCacheMvccCandidate[] candArr = new GridCacheMvccCandidate[] {c0, c1, c2, c3, c4, c5, c6};
-
- Collection<GridCacheMvccCandidate> cands = entry.remoteMvccSnapshot();
-
- assert cands.size() == 7;
- assert cands.iterator().next().version().equals(ver0);
-
- entry.orderOwned(ver1, ver2);
-
- cands = entry.remoteMvccSnapshot();
-
- int i = 0;
-
- for (GridCacheMvccCandidate cand : cands) {
- assert cand == candArr[i];
-
- assertTrue(ver2.equals(cand.ownerVersion()) || cand != c1);
-
- i++;
- }
- }
-
- /**
- * Tests remote candidates.
- */
- @Test
- public void testLocal() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
-
- entry.addLocal(3, ver3, 0, true, true);
-
- Collection<GridCacheMvccCandidate> cands = entry.localCandidates();
-
- assert cands.size() == 1;
-
- assert cands.iterator().next().version().equals(ver3);
-
- entry.addLocal(5, ver5, 0, true, true);
-
- cands = entry.localCandidates();
-
- assert cands.size() == 2;
-
- info(cands);
-
- // Check order.
- checkOrder(cands, ver3, ver5);
-
- assert entry.anyOwner() == null;
-
- entry.readyLocal(ver3);
-
- checkLocalOwner(entry.anyOwner(), ver3, false);
-
- // Reentry.
- entry.addLocal(3, ver4, 0, true, true);
-
- checkLocalOwner(entry.anyOwner(), ver4, true);
-
- assert entry.localCandidates().size() == 2;
- assert entry.localCandidates(true).size() == 3;
-
- // Check order.
- checkOrder(entry.localCandidates(true), ver4, ver3, ver5);
-
- entry.removeLock(ver4);
-
- assert entry.localCandidates(true).size() == 2;
-
- entry.readyLocal(ver5);
-
- checkLocalOwner(entry.anyOwner(), ver3, false);
-
- // Check order.
- checkOrder(entry.localCandidates(true), ver3, ver5);
-
- entry.removeLock(ver3);
-
- assert entry.localCandidates(true).size() == 1;
-
- checkLocalOwner(entry.anyOwner(), ver5, false);
-
- assert !entry.lockedByAny(ver5);
-
- entry.removeLock(ver5);
-
- assert !entry.lockedByAny();
- assert entry.anyOwner() == null;
- assert entry.localCandidates(true).isEmpty();
- }
-
- /**
- * Tests assignment of local candidates when remote exist.
- */
- @Test
- public void testLocalWithRemote() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID nodeId = UUID.randomUUID();
-
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
-
- entry.addRemote(nodeId, 1, ver2, true);
-
- entry.addLocal(3, ver3, 0, false, true);
-
- assert entry.anyOwner() == null;
-
- entry.readyLocal(ver3);
-
- assert entry.anyOwner() == null;
-
- entry.removeLock(ver2);
-
- assert entry.localCandidates().size() == 1;
-
- checkLocalOwner(entry.anyOwner(), ver3, false);
-
- entry.removeLock(ver3);
-
- assert !entry.lockedByAny();
- assert entry.anyOwner() == null;
- assert entry.localCandidates(true).isEmpty();
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseInTheMiddle() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
- GridCacheVersion ver8 = version(8);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addRemote(node2, 2, ver2, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
- entry.addRemote(node1, 5, ver5, true);
- entry.addRemote(node2, 7, ver7, true);
- entry.addRemote(node2, 8, ver8, true);
-
- GridCacheMvccCandidate doomed = entry.addRemote(node2, 6, ver6, true);
-
- // No reordering happens.
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver2, ver3, ver4, ver5, ver7, ver8, ver6);
-
- List<GridCacheVersion> committed = Arrays.asList(ver4, ver7);
- List<GridCacheVersion> rolledback = Arrays.asList(ver6);
-
- entry.orderCompleted(ver2, committed, rolledback);
-
- assert !entry.lockedBy(ver6);
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver4, ver7, ver2, ver3, ver5, ver8);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, true, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- checkRemote(entry.candidate(ver7), ver7, true, false);
- checkRemote(entry.candidate(ver8), ver8, false, false);
-
- checkRemote(doomed, ver6, false, true);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithCompletedBaseInTheMiddle() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addRemote(node2, 2, ver2, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
- entry.addRemote(node1, 5, ver5, true);
- entry.addRemote(node2, 6, ver6, true);
- entry.addRemote(node2, 7, ver7, true);
-
- List<GridCacheVersion> committed = Arrays.asList(ver4, ver6, ver2);
-
- entry.orderCompleted(ver2, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver4, ver6, ver2, ver3, ver5, ver7);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, true, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, true, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- checkRemote(entry.candidate(ver6), ver6, true, false);
- checkRemote(entry.candidate(ver7), ver7, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedTwiceWithBaseInTheMiddle() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- entry.addRemote(node1, 1, ver1, true);
- entry.addRemote(node2, 2, ver2, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
- entry.addRemote(node1, 5, ver5, true);
- entry.addRemote(node2, 6, ver6, true);
- entry.addRemote(node2, 7, ver7, true);
-
- List<GridCacheVersion> completed = Arrays.asList(ver4, ver6);
-
- entry.orderCompleted(ver2, completed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver4, ver6, ver2, ver3, ver5, ver7);
-
- entry.orderCompleted(ver4, completed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver6, ver4, ver2, ver3, ver5, ver7);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, true, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- checkRemote(entry.candidate(ver6), ver6, true, false);
- checkRemote(entry.candidate(ver7), ver7, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseInTheMiddleNoChange() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- entry.addRemote(node1, 1, ver1, false);
- entry.addRemote(node2, 2, ver2, false);
- entry.addRemote(node1, 3, ver3, false);
- entry.addRemote(node2, 4, ver4, false);
- entry.addRemote(node1, 5, ver5, false);
-
- List<GridCacheVersion> committed = Arrays.asList(ver6, ver7);
-
- entry.orderCompleted(ver4, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver2, ver3, ver4, ver5);
-
- // Nothing set to owner since there is no change.
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, false, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseInTheBeginning() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- entry.addRemote(node1, 1, ver1, false);
- entry.addRemote(node2, 2, ver2, false);
- entry.addRemote(node1, 3, ver3, false);
- entry.addRemote(node2, 4, ver4, false);
- entry.addRemote(node1, 5, ver5, false);
- entry.addRemote(node2, 6, ver6, false);
- entry.addRemote(node2, 7, ver7, false);
-
- List<GridCacheVersion> committed = Arrays.asList(ver4, ver6, ver3);
-
- entry.orderCompleted(ver1, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver3, ver4, ver6, ver1, ver2, ver5, ver7);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, true, false);
- checkRemote(entry.candidate(ver4), ver4, true, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- checkRemote(entry.candidate(ver6), ver6, true, false);
- checkRemote(entry.candidate(ver7), ver7, false, false);
- }
-
- /**
- * This case should never happen, nevertheless we need to test for it.
- */
- @Test
- public void testCompletedWithBaseInTheBeginningNoChange() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- entry.addRemote(node1, 1, ver1, false);
- entry.addRemote(node2, 2, ver2, false);
- entry.addRemote(node1, 3, ver3, false);
- entry.addRemote(node2, 4, ver4, false);
- entry.addRemote(node1, 5, ver5, false);
-
- List<GridCacheVersion> committed = Arrays.asList(ver6, ver7);
-
- entry.orderCompleted(ver1, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver2, ver3, ver4, ver5);
-
- // Nothing set to owner since there is no change.
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, false, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- }
-
- /**
- * This case should never happen, nevertheless we need to test for it.
- */
- @Test
- public void testCompletedWithBaseInTheEndNoChange() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- entry.addRemote(node1, 1, ver1, false);
- entry.addRemote(node2, 2, ver2, false);
- entry.addRemote(node1, 3, ver3, false);
- entry.addRemote(node2, 4, ver4, false);
- entry.addRemote(node1, 5, ver5, false);
-
- List<GridCacheVersion> committed = Arrays.asList(ver6, ver7);
-
- entry.orderCompleted(ver5, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver2, ver3, ver4, ver5);
-
- // Nothing set to owner since there is no change.
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, false, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseNotPresentInTheMiddle() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- // Don't add version 2.
- entry.addRemote(node1, 1, ver1, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
- entry.addRemote(node1, 5, ver5, true);
- entry.addRemote(node2, 6, ver6, true);
- entry.addRemote(node2, 7, ver7, true);
-
- List<GridCacheVersion> committed = Arrays.asList(ver6, ver4);
-
- entry.orderCompleted(ver2, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver4, ver6, ver3, ver5, ver7);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, true, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- checkRemote(entry.candidate(ver6), ver6, true, false);
- checkRemote(entry.candidate(ver7), ver7, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseNotPresentInTheMiddleNoChange() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- // Don't add versions 2, 5, 6, 7.
- entry.addRemote(node1, 1, ver1, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
-
- List<GridCacheVersion> committed = Arrays.asList(ver6, ver5, ver7);
-
- entry.orderCompleted(ver2, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver3, ver4);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseNotPresentInTheBeginning() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- // Don't add version 1.
- entry.addRemote(node1, 2, ver2, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
- entry.addRemote(node1, 5, ver5, true);
- entry.addRemote(node2, 6, ver6, true);
- entry.addRemote(node2, 7, ver7, true);
-
- List<GridCacheVersion> committed = Arrays.asList(ver4, ver6, ver3);
-
- entry.orderCompleted(ver1, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver3, ver4, ver6, ver2, ver5, ver7);
-
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, true, false);
- checkRemote(entry.candidate(ver4), ver4, true, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- checkRemote(entry.candidate(ver6), ver6, true, false);
- checkRemote(entry.candidate(ver7), ver7, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseNotPresentInTheBeginningNoChange() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- // Don't add version 6, 7
- entry.addRemote(node1, 2, ver2, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
- entry.addRemote(node1, 5, ver5, true);
- entry.addRemote(node1, 6, ver6, true);
- entry.addRemote(node1, 7, ver7, true);
-
- List<GridCacheVersion> committed = Arrays.asList(ver2, ver3);
-
- entry.orderCompleted(ver1, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver2, ver3, ver4, ver5, ver6, ver7);
-
- checkRemote(entry.candidate(ver2), ver2, true, false);
- checkRemote(entry.candidate(ver3), ver3, true, false);
- checkRemote(entry.candidate(ver4), ver4, false, false);
- checkRemote(entry.candidate(ver5), ver5, false, false);
- checkRemote(entry.candidate(ver6), ver6, false, false);
- checkRemote(entry.candidate(ver7), ver7, false, false);
- }
-
- /**
- *
- */
- @Test
- public void testCompletedWithBaseNotPresentInTheEndNoChange() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
- GridCacheVersion ver6 = version(6);
- GridCacheVersion ver7 = version(7);
-
- // Don't add version 5, 6, 7
- entry.addRemote(node1, 1, ver1, true);
- entry.addRemote(node1, 2, ver2, true);
- entry.addRemote(node1, 3, ver3, true);
- entry.addRemote(node2, 4, ver4, true);
-
- List<GridCacheVersion> committed = Arrays.asList(ver6, ver7);
-
- entry.orderCompleted(ver5, committed, Collections.<GridCacheVersion>emptyList());
-
- checkOrder(entry.remoteMvccSnapshot(), ver1, ver2, ver3, ver4);
-
- checkRemote(entry.candidate(ver1), ver1, false, false);
- checkRemote(entry.candidate(ver2), ver2, false, false);
- checkRemote(entry.candidate(ver3), ver3, false, false);
- checkRemote(entry.candidate(ver4), ver4, false, false);
- }
-
- /**
- * Test local and remote candidates together.
- */
- @Test
- public void testLocalAndRemote() {
- GridCacheAdapter<String, String> cache = grid.internalCache(DEFAULT_CACHE_NAME);
-
- GridCacheTestEntryEx entry = new GridCacheTestEntryEx(cache.context(), "1");
-
- UUID node1 = UUID.randomUUID();
- UUID node2 = UUID.randomUUID();
-
- GridCacheVersion ver1 = version(1);
- GridCacheVersion ver2 = version(2);
- GridCacheVersion ver3 = version(3);
- GridCacheVersion ver4 = version(4);
- GridCacheVersion ver5 = version(5);
-
- entry.addRemote(node1, 1, ver1, false);
- entry.addLocal(2, ver2, 0, true, true);
-
- Collection<GridCacheMvccCandidate> cands = entry.remoteMvccSnapshot();
-
- assert cands.size() == 1;
... 43858 lines suppressed ...