@ -5609,11 +5609,18 @@ TEST(DBTest, TransactionLogIterator) {
# ifndef NDEBUG // sync point is not included with DNDEBUG build
TEST ( DBTest , TransactionLogIteratorRace ) {
static const int LOG_ITERATOR_RACE_TEST_COUNT = 2 ;
static const char * sync_points [ LOG_ITERATOR_RACE_TEST_COUNT ] [ 4 ] =
{ { " DBImpl::GetSortedWalFiles:1 " , " DBImpl::PurgeObsoleteFiles:1 " ,
" DBImpl::PurgeObsoleteFiles:2 " , " DBImpl::GetSortedWalFiles:2 " } ,
{ " DBImpl::GetSortedWalsOfType:1 " , " DBImpl::PurgeObsoleteFiles:1 " ,
" DBImpl::PurgeObsoleteFiles:2 " , " DBImpl::GetSortedWalsOfType:2 " } } ;
for ( int test = 0 ; test < LOG_ITERATOR_RACE_TEST_COUNT ; + + test ) {
// Setup sync point dependency to reproduce the race condition of
// a log file moved to archived dir, in the middle of GetSortedWalFiles
rocksdb : : SyncPoint : : GetInstance ( ) - > LoadDependency (
{ { " DBImpl::GetSortedWalFiles:1 " , " DBImpl::PurgeObsoleteFiles:1 " } ,
{ " DBImpl::PurgeObsoleteFiles:2 " , " DBImpl::GetSortedWalFiles:2 " } ,
{ { sync_points [ test ] [ 0 ] , sync_points [ test ] [ 1 ] } ,
{ sync_points [ test ] [ 2 ] , sync_points [ test ] [ 3 ] } ,
} ) ;
do {
@ -5652,6 +5659,7 @@ TEST(DBTest, TransactionLogIteratorRace) {
}
} while ( ChangeCompactOptions ( ) ) ;
}
}
# endif
TEST ( DBTest , TransactionLogIteratorMoveOverZeroFiles ) {