From 537a233941903ac220e82eb93dfdf97e5e4cb57d Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Fri, 13 Jul 2018 13:55:13 -0700 Subject: [PATCH] Exclude StackableDB from transaction stress tests (#4132) Summary: The transactions are currently tested with and without using StackableDB. This is mostly to check that the code path is consistent with stackable db as well. Slow, stress tests however do not benefit from being run again with StackableDB. The patch excludes StackableDB from such tests. On a single core it reduced the runtime of transaction_test from 199s to 135s. Pull Request resolved: https://github.com/facebook/rocksdb/pull/4132 Differential Revision: D8841655 Pulled By: maysamyabandeh fbshipit-source-id: 7b9aaba2673b542b195439dfb306cef26bd63b19 --- Makefile | 2 +- .../transactions/pessimistic_transaction_db.h | 2 +- utilities/transactions/transaction_test.cc | 28 ++++++++++--------- utilities/transactions/transaction_test.h | 2 ++ 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index cf0a160f2..ea8069b29 100644 --- a/Makefile +++ b/Makefile @@ -813,7 +813,7 @@ check_0: | grep -E '$(tests-regexp)' \ | build_tools/gnu_parallel -j$(J) --plain --joblog=LOG $$eta --gnu '{} >& t/log-{/}' -valgrind-blacklist-regexp = InlineSkipTest.ConcurrentInsert|TransactionTest.DeadlockStress|DBCompactionTest.SuggestCompactRangeNoTwoLevel0Compactions|BackupableDBTest.RateLimiting|DBTest.CloseSpeedup|DBTest.ThreadStatusFlush|DBTest.RateLimitingTest|DBTest.EncodeDecompressedBlockSizeTest|FaultInjectionTest.UninstalledCompaction|HarnessTest.Randomized|ExternalSSTFileTest.CompactDuringAddFileRandom|ExternalSSTFileTest.IngestFileWithGlobalSeqnoRandomized|MySQLStyleTransactionTest.TransactionStressTest +valgrind-blacklist-regexp = InlineSkipTest.ConcurrentInsert|TransactionStressTest.DeadlockStress|DBCompactionTest.SuggestCompactRangeNoTwoLevel0Compactions|BackupableDBTest.RateLimiting|DBTest.CloseSpeedup|DBTest.ThreadStatusFlush|DBTest.RateLimitingTest|DBTest.EncodeDecompressedBlockSizeTest|FaultInjectionTest.UninstalledCompaction|HarnessTest.Randomized|ExternalSSTFileTest.CompactDuringAddFileRandom|ExternalSSTFileTest.IngestFileWithGlobalSeqnoRandomized|MySQLStyleTransactionTest.TransactionStressTest .PHONY: valgrind_check_0 valgrind_check_0: diff --git a/utilities/transactions/pessimistic_transaction_db.h b/utilities/transactions/pessimistic_transaction_db.h index 679cd26ff..76032699d 100644 --- a/utilities/transactions/pessimistic_transaction_db.h +++ b/utilities/transactions/pessimistic_transaction_db.h @@ -139,7 +139,7 @@ class PessimisticTransactionDB : public TransactionDB { friend class TransactionTest_DoubleEmptyWrite_Test; friend class TransactionTest_DuplicateKeys_Test; friend class TransactionTest_PersistentTwoPhaseTransactionTest_Test; - friend class TransactionTest_TwoPhaseLongPrepareTest_Test; + friend class TransactionStressTest_TwoPhaseLongPrepareTest_Test; friend class TransactionTest_TwoPhaseDoubleRecoveryTest_Test; friend class TransactionTest_TwoPhaseOutOfOrderDelete_Test; friend class WriteUnpreparedTransactionTest_RecoveryRollbackUnprepared_Test; diff --git a/utilities/transactions/transaction_test.cc b/utilities/transactions/transaction_test.cc index a4c715578..c911d17cf 100644 --- a/utilities/transactions/transaction_test.cc +++ b/utilities/transactions/transaction_test.cc @@ -48,6 +48,14 @@ INSTANTIATE_TEST_CASE_P( std::make_tuple(false, true, WRITE_PREPARED), std::make_tuple(false, false, WRITE_UNPREPARED), std::make_tuple(false, true, WRITE_UNPREPARED))); +INSTANTIATE_TEST_CASE_P( + DBAsBaseDB, TransactionStressTest, + ::testing::Values(std::make_tuple(false, false, WRITE_COMMITTED), + std::make_tuple(false, true, WRITE_COMMITTED), + std::make_tuple(false, false, WRITE_PREPARED), + std::make_tuple(false, true, WRITE_PREPARED), + std::make_tuple(false, false, WRITE_UNPREPARED), + std::make_tuple(false, true, WRITE_UNPREPARED))); INSTANTIATE_TEST_CASE_P( StackableDBAsBaseDB, TransactionTest, ::testing::Values(std::make_tuple(true, true, WRITE_COMMITTED), @@ -60,16 +68,10 @@ INSTANTIATE_TEST_CASE_P( MySQLStyleTransactionTest, MySQLStyleTransactionTest, ::testing::Values(std::make_tuple(false, false, WRITE_COMMITTED), std::make_tuple(false, true, WRITE_COMMITTED), - std::make_tuple(true, false, WRITE_COMMITTED), - std::make_tuple(true, true, WRITE_COMMITTED), std::make_tuple(false, false, WRITE_PREPARED), std::make_tuple(false, true, WRITE_PREPARED), - std::make_tuple(true, false, WRITE_PREPARED), - std::make_tuple(true, true, WRITE_PREPARED), std::make_tuple(false, false, WRITE_UNPREPARED), - std::make_tuple(false, true, WRITE_UNPREPARED), - std::make_tuple(true, false, WRITE_UNPREPARED), - std::make_tuple(true, true, WRITE_UNPREPARED))); + std::make_tuple(false, true, WRITE_UNPREPARED))); #endif // ROCKSDB_VALGRIND_RUN TEST_P(TransactionTest, DoubleEmptyWrite) { @@ -604,7 +606,7 @@ TEST_P(TransactionTest, DeadlockCycleShared) { } } -TEST_P(TransactionTest, DeadlockCycle) { +TEST_P(TransactionStressTest, DeadlockCycle) { WriteOptions write_options; ReadOptions read_options; TransactionOptions txn_options; @@ -712,7 +714,7 @@ TEST_P(TransactionTest, DeadlockCycle) { } } -TEST_P(TransactionTest, DeadlockStress) { +TEST_P(TransactionStressTest, DeadlockStress) { const uint32_t NUM_TXN_THREADS = 10; const uint32_t NUM_KEYS = 100; const uint32_t NUM_ITERS = 10000; @@ -1094,7 +1096,7 @@ TEST_P(TransactionTest, TwoPhaseEmptyWriteTest) { } } -TEST_P(TransactionTest, TwoPhaseExpirationTest) { +TEST_P(TransactionStressTest, TwoPhaseExpirationTest) { Status s; WriteOptions write_options; @@ -1413,7 +1415,7 @@ TEST_P(TransactionTest, DISABLED_TwoPhaseMultiThreadTest) { } } -TEST_P(TransactionTest, TwoPhaseLongPrepareTest) { +TEST_P(TransactionStressTest, TwoPhaseLongPrepareTest) { WriteOptions write_options; write_options.sync = true; write_options.disableWAL = false; @@ -4790,7 +4792,7 @@ TEST_P(TransactionTest, ToggleAutoCompactionTest) { } } -TEST_P(TransactionTest, ExpiredTransactionDataRace1) { +TEST_P(TransactionStressTest, ExpiredTransactionDataRace1) { // In this test, txn1 should succeed committing, // as the callback is called after txn1 starts committing. rocksdb::SyncPoint::GetInstance()->LoadDependency( @@ -4959,7 +4961,7 @@ TEST_P(TransactionTest, MemoryLimitTest) { // algorithm. It could detect mistakes in updating the code but it is not // necessarily the one acceptable way. If the algorithm is legitimately changed, // this unit test should be updated as well. -TEST_P(TransactionTest, SeqAdvanceTest) { +TEST_P(TransactionStressTest, SeqAdvanceTest) { // TODO(myabandeh): must be test with false before new releases const bool short_test = true; WriteOptions wopts; diff --git a/utilities/transactions/transaction_test.h b/utilities/transactions/transaction_test.h index 2d91f5b2e..97d169d88 100644 --- a/utilities/transactions/transaction_test.h +++ b/utilities/transactions/transaction_test.h @@ -449,6 +449,8 @@ class TransactionTest : public TransactionTestBase, std::get<2>(GetParam())){}; }; +class TransactionStressTest : public TransactionTest {}; + class MySQLStyleTransactionTest : public TransactionTest {}; } // namespace rocksdb