@ -1727,7 +1727,7 @@ TEST_P(TransactionTest, TwoPhaseLogRollingTest) {
// our log should be in the heap
ASSERT_EQ ( db_impl - > TEST_FindMinLogContainingOutstandingPrep ( ) ,
txn1 - > GetLogNumber ( ) ) ;
ASSERT_EQ ( db_impl - > TEST_LogfileNumber ( ) , txn1 - > GetLogNumber ( ) ) ;
ASSERT_EQ ( db_impl - > TEST_LogfileNumber ( ) , txn1 - > GetLastL ogNumber ( ) ) ;
// flush default cf to crate new log
s = db - > Put ( wopts , " foo " , " bar " ) ;
@ -1736,12 +1736,12 @@ TEST_P(TransactionTest, TwoPhaseLogRollingTest) {
ASSERT_OK ( s ) ;
// make sure we are on a new log
ASSERT_GT ( db_impl - > TEST_LogfileNumber ( ) , txn1 - > GetLogNumber ( ) ) ;
ASSERT_GT ( db_impl - > TEST_LogfileNumber ( ) , txn1 - > GetLastL ogNumber ( ) ) ;
// put txn2 prep section in this log
s = txn2 - > Prepare ( ) ;
ASSERT_OK ( s ) ;
ASSERT_EQ ( db_impl - > TEST_LogfileNumber ( ) , txn2 - > GetLogNumber ( ) ) ;
ASSERT_EQ ( db_impl - > TEST_LogfileNumber ( ) , txn2 - > GetLastL ogNumber ( ) ) ;
// heap should still see first log
ASSERT_EQ ( db_impl - > TEST_FindMinLogContainingOutstandingPrep ( ) ,
@ -1777,7 +1777,7 @@ TEST_P(TransactionTest, TwoPhaseLogRollingTest) {
ASSERT_OK ( s ) ;
// make sure we are on a new log
ASSERT_GT ( db_impl - > TEST_LogfileNumber ( ) , txn2 - > GetLogNumber ( ) ) ;
ASSERT_GT ( db_impl - > TEST_LogfileNumber ( ) , txn2 - > GetLastL ogNumber ( ) ) ;
// commit txn2
s = txn2 - > Commit ( ) ;
@ -1878,7 +1878,7 @@ TEST_P(TransactionTest, TwoPhaseLogRollingTest2) {
s = db - > Put ( wopts , " cats " , " dogs1 " ) ;
ASSERT_OK ( s ) ;
auto prepare_log_no = txn1 - > GetLogNumber ( ) ;
auto prepare_log_no = txn1 - > GetLastL ogNumber ( ) ;
// roll to LOG B
s = db_impl - > TEST_FlushMemTable ( true ) ;
@ -1905,7 +1905,7 @@ TEST_P(TransactionTest, TwoPhaseLogRollingTest2) {
assert ( false ) ;
}
ASSERT_EQ ( db_impl - > TEST_FindMinLogContainingOutstandingPrep ( ) ,
prepare_log_no ) ;
txn1 - > GetLogNumber ( ) ) ;
ASSERT_EQ ( db_impl - > TEST_FindMinPrepLogReferencedByMemTable ( ) , 0 ) ;
// commit in LOG B
@ -2604,10 +2604,8 @@ TEST_P(TransactionTest, ColumnFamiliesTest) {
std : : vector < ColumnFamilyHandle * > handles ;
s = TransactionDB : : Open ( options , txn_db_options , dbname , column_families ,
& handles , & db ) ;
ASSERT_OK ( ReOpenNoDelete ( column_families , & handles ) ) ;
assert ( db ! = nullptr ) ;
ASSERT_OK ( s ) ;
Transaction * txn = db - > BeginTransaction ( write_options ) ;
ASSERT_TRUE ( txn ) ;
@ -2769,10 +2767,8 @@ TEST_P(TransactionTest, MultiGetBatchedTest) {
std : : vector < ColumnFamilyHandle * > handles ;
options . merge_operator = MergeOperators : : CreateStringAppendOperator ( ) ;
s = TransactionDB : : Open ( options , txn_db_options , dbname , column_families ,
& handles , & db ) ;
ASSERT_OK ( ReOpenNoDelete ( column_families , & handles ) ) ;
assert ( db ! = nullptr ) ;
ASSERT_OK ( s ) ;
// Write some data to the db
WriteBatch batch ;
@ -3132,6 +3128,12 @@ TEST_P(TransactionTest, LostUpdate) {
}
TEST_P ( TransactionTest , UntrackedWrites ) {
if ( txn_db_options . write_policy = = WRITE_UNPREPARED ) {
// TODO(lth): For WriteUnprepared, validate that untracked writes are
// not supported.
return ;
}
WriteOptions write_options ;
ReadOptions read_options ;
std : : string value ;
@ -3376,7 +3378,7 @@ TEST_P(TransactionTest, LockLimitTest) {
// Open DB with a lock limit of 3
txn_db_options . max_num_locks = 3 ;
s = TransactionDB : : Open ( options , txn_db_options , dbname , & db ) ;
ASSERT_OK ( ReOpen ( ) ) ;
assert ( db ! = nullptr ) ;
ASSERT_OK ( s ) ;
@ -5285,6 +5287,9 @@ TEST_P(TransactionTest, MemoryLimitTest) {
TransactionOptions txn_options ;
// Header (12 bytes) + NOOP (1 byte) + 2 * 8 bytes for data.
txn_options . max_write_batch_size = 29 ;
// Set threshold to unlimited so that the write batch does not get flushed,
// and can hit the memory limit.
txn_options . write_batch_flush_threshold = 0 ;
std : : string value ;
Status s ;