@ -2367,10 +2367,11 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_Success) {
new FaultInjectionTestEnv ( env_ ) ) ;
new FaultInjectionTestEnv ( env_ ) ) ;
Options options = CurrentOptions ( ) ;
Options options = CurrentOptions ( ) ;
options . env = fault_injection_env . get ( ) ;
options . env = fault_injection_env . get ( ) ;
CreateAndReopenWithCF ( { " pikachu " } , options ) ;
CreateAndReopenWithCF ( { " pikachu " , " eevee " } , options ) ;
std : : vector < ColumnFamilyHandle * > column_families ;
std : : vector < ColumnFamilyHandle * > column_families ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 2 ] ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
for ( auto & ifo : ifos ) {
for ( auto & ifo : ifos ) {
ifo . allow_global_seqno = true ; // Always allow global_seqno
ifo . allow_global_seqno = true ; // Always allow global_seqno
@ -2384,6 +2385,9 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_Success) {
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
data . push_back (
data . push_back (
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
data . push_back (
{ std : : make_pair ( " bar3 " , " bv3 " ) , std : : make_pair ( " bar4 " , " bv4 " ) } ) ;
// Resize the true_data vector upon construction to avoid re-alloc
// Resize the true_data vector upon construction to avoid re-alloc
std : : vector < std : : map < std : : string , std : : string > > true_data (
std : : vector < std : : map < std : : string , std : : string > > true_data (
column_families . size ( ) ) ;
column_families . size ( ) ) ;
@ -2391,8 +2395,9 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_Success) {
- 1 , true , true_data ) ;
- 1 , true , true_data ) ;
ASSERT_OK ( s ) ;
ASSERT_OK ( s ) ;
Close ( ) ;
Close ( ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " } , options ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " , " eevee " } ,
ASSERT_EQ ( 2 , handles_ . size ( ) ) ;
options ) ;
ASSERT_EQ ( 3 , handles_ . size ( ) ) ;
int cf = 0 ;
int cf = 0 ;
for ( const auto & verify_map : true_data ) {
for ( const auto & verify_map : true_data ) {
for ( const auto & elem : verify_map ) {
for ( const auto & elem : verify_map ) {
@ -2424,10 +2429,11 @@ TEST_P(ExternalSSTFileTest,
Options options = CurrentOptions ( ) ;
Options options = CurrentOptions ( ) ;
options . env = fault_injection_env . get ( ) ;
options . env = fault_injection_env . get ( ) ;
CreateAndReopenWithCF ( { " pikachu " } , options ) ;
CreateAndReopenWithCF ( { " pikachu " , " eevee " } , options ) ;
const std : : vector < std : : map < std : : string , std : : string > > data_before_ingestion =
const std : : vector < std : : map < std : : string , std : : string > > data_before_ingestion =
{ { { " foo1 " , " fv1_0 " } , { " foo2 " , " fv2_0 " } , { " foo3 " , " fv3_0 " } } ,
{ { { " foo1 " , " fv1_0 " } , { " foo2 " , " fv2_0 " } , { " foo3 " , " fv3_0 " } } ,
{ { " bar1 " , " bv1_0 " } , { " bar2 " , " bv2_0 " } , { " bar3 " , " bv3_0 " } } } ;
{ { " bar1 " , " bv1_0 " } , { " bar2 " , " bv2_0 " } , { " bar3 " , " bv3_0 " } } ,
{ { " bar4 " , " bv4_0 " } , { " bar5 " , " bv5_0 " } , { " bar6 " , " bv6_0 " } } } ;
for ( size_t i = 0 ; i ! = handles_ . size ( ) ; + + i ) {
for ( size_t i = 0 ; i ! = handles_ . size ( ) ; + + i ) {
int cf = static_cast < int > ( i ) ;
int cf = static_cast < int > ( i ) ;
const auto & orig_data = data_before_ingestion [ i ] ;
const auto & orig_data = data_before_ingestion [ i ] ;
@ -2440,6 +2446,7 @@ TEST_P(ExternalSSTFileTest,
std : : vector < ColumnFamilyHandle * > column_families ;
std : : vector < ColumnFamilyHandle * > column_families ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 2 ] ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
for ( auto & ifo : ifos ) {
for ( auto & ifo : ifos ) {
ifo . allow_global_seqno = true ; // Always allow global_seqno
ifo . allow_global_seqno = true ; // Always allow global_seqno
@ -2453,6 +2460,8 @@ TEST_P(ExternalSSTFileTest,
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
data . push_back (
data . push_back (
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
data . push_back (
{ std : : make_pair ( " bar3 " , " bv3 " ) , std : : make_pair ( " bar4 " , " bv4 " ) } ) ;
// Resize the true_data vector upon construction to avoid re-alloc
// Resize the true_data vector upon construction to avoid re-alloc
std : : vector < std : : map < std : : string , std : : string > > true_data (
std : : vector < std : : map < std : : string , std : : string > > true_data (
column_families . size ( ) ) ;
column_families . size ( ) ) ;
@ -2506,10 +2515,11 @@ TEST_P(ExternalSSTFileTest,
dbfull ( ) - > ReleaseSnapshot ( read_opts . snapshot ) ;
dbfull ( ) - > ReleaseSnapshot ( read_opts . snapshot ) ;
Close ( ) ;
Close ( ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " } , options ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " , " eevee " } ,
options ) ;
// Should see consistent state after ingestion for all column families even
// Should see consistent state after ingestion for all column families even
// without snapshot.
// without snapshot.
ASSERT_EQ ( 2 , handles_ . size ( ) ) ;
ASSERT_EQ ( 3 , handles_ . size ( ) ) ;
int cf = 0 ;
int cf = 0 ;
for ( const auto & verify_map : true_data ) {
for ( const auto & verify_map : true_data ) {
for ( const auto & elem : verify_map ) {
for ( const auto & elem : verify_map ) {
@ -2539,10 +2549,11 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_PrepareFail) {
" DBImpl::IngestExternalFiles:BeforeLastJobPrepare:1 " } ,
" DBImpl::IngestExternalFiles:BeforeLastJobPrepare:1 " } ,
} ) ;
} ) ;
SyncPoint : : GetInstance ( ) - > EnableProcessing ( ) ;
SyncPoint : : GetInstance ( ) - > EnableProcessing ( ) ;
CreateAndReopenWithCF ( { " pikachu " } , options ) ;
CreateAndReopenWithCF ( { " pikachu " , " eevee " } , options ) ;
std : : vector < ColumnFamilyHandle * > column_families ;
std : : vector < ColumnFamilyHandle * > column_families ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 2 ] ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
for ( auto & ifo : ifos ) {
for ( auto & ifo : ifos ) {
ifo . allow_global_seqno = true ; // Always allow global_seqno
ifo . allow_global_seqno = true ; // Always allow global_seqno
@ -2556,6 +2567,9 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_PrepareFail) {
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
data . push_back (
data . push_back (
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
data . push_back (
{ std : : make_pair ( " bar3 " , " bv3 " ) , std : : make_pair ( " bar4 " , " bv4 " ) } ) ;
// Resize the true_data vector upon construction to avoid re-alloc
// Resize the true_data vector upon construction to avoid re-alloc
std : : vector < std : : map < std : : string , std : : string > > true_data (
std : : vector < std : : map < std : : string , std : : string > > true_data (
column_families . size ( ) ) ;
column_families . size ( ) ) ;
@ -2575,8 +2589,9 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_PrepareFail) {
fault_injection_env - > SetFilesystemActive ( true ) ;
fault_injection_env - > SetFilesystemActive ( true ) ;
Close ( ) ;
Close ( ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " } , options ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " , " eevee " } ,
ASSERT_EQ ( 2 , handles_ . size ( ) ) ;
options ) ;
ASSERT_EQ ( 3 , handles_ . size ( ) ) ;
int cf = 0 ;
int cf = 0 ;
for ( const auto & verify_map : true_data ) {
for ( const auto & verify_map : true_data ) {
for ( const auto & elem : verify_map ) {
for ( const auto & elem : verify_map ) {
@ -2605,10 +2620,11 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_CommitFail) {
" DBImpl::IngestExternalFiles:BeforeJobsRun:1 " } ,
" DBImpl::IngestExternalFiles:BeforeJobsRun:1 " } ,
} ) ;
} ) ;
SyncPoint : : GetInstance ( ) - > EnableProcessing ( ) ;
SyncPoint : : GetInstance ( ) - > EnableProcessing ( ) ;
CreateAndReopenWithCF ( { " pikachu " } , options ) ;
CreateAndReopenWithCF ( { " pikachu " , " eevee " } , options ) ;
std : : vector < ColumnFamilyHandle * > column_families ;
std : : vector < ColumnFamilyHandle * > column_families ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 2 ] ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
for ( auto & ifo : ifos ) {
for ( auto & ifo : ifos ) {
ifo . allow_global_seqno = true ; // Always allow global_seqno
ifo . allow_global_seqno = true ; // Always allow global_seqno
@ -2622,6 +2638,8 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_CommitFail) {
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
data . push_back (
data . push_back (
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
data . push_back (
{ std : : make_pair ( " bar3 " , " bv3 " ) , std : : make_pair ( " bar4 " , " bv4 " ) } ) ;
// Resize the true_data vector upon construction to avoid re-alloc
// Resize the true_data vector upon construction to avoid re-alloc
std : : vector < std : : map < std : : string , std : : string > > true_data (
std : : vector < std : : map < std : : string , std : : string > > true_data (
column_families . size ( ) ) ;
column_families . size ( ) ) ;
@ -2641,8 +2659,9 @@ TEST_P(ExternalSSTFileTest, IngestFilesIntoMultipleColumnFamilies_CommitFail) {
fault_injection_env - > SetFilesystemActive ( true ) ;
fault_injection_env - > SetFilesystemActive ( true ) ;
Close ( ) ;
Close ( ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " } , options ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " , " eevee " } ,
ASSERT_EQ ( 2 , handles_ . size ( ) ) ;
options ) ;
ASSERT_EQ ( 3 , handles_ . size ( ) ) ;
int cf = 0 ;
int cf = 0 ;
for ( const auto & verify_map : true_data ) {
for ( const auto & verify_map : true_data ) {
for ( const auto & elem : verify_map ) {
for ( const auto & elem : verify_map ) {
@ -2662,7 +2681,7 @@ TEST_P(ExternalSSTFileTest,
Options options = CurrentOptions ( ) ;
Options options = CurrentOptions ( ) ;
options . env = fault_injection_env . get ( ) ;
options . env = fault_injection_env . get ( ) ;
CreateAndReopenWithCF ( { " pikachu " } , options ) ;
CreateAndReopenWithCF ( { " pikachu " , " eevee " } , options ) ;
SyncPoint : : GetInstance ( ) - > ClearTrace ( ) ;
SyncPoint : : GetInstance ( ) - > ClearTrace ( ) ;
SyncPoint : : GetInstance ( ) - > DisableProcessing ( ) ;
SyncPoint : : GetInstance ( ) - > DisableProcessing ( ) ;
@ -2680,6 +2699,7 @@ TEST_P(ExternalSSTFileTest,
std : : vector < ColumnFamilyHandle * > column_families ;
std : : vector < ColumnFamilyHandle * > column_families ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 0 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 1 ] ) ;
column_families . push_back ( handles_ [ 2 ] ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
std : : vector < IngestExternalFileOptions > ifos ( column_families . size ( ) ) ;
for ( auto & ifo : ifos ) {
for ( auto & ifo : ifos ) {
ifo . allow_global_seqno = true ; // Always allow global_seqno
ifo . allow_global_seqno = true ; // Always allow global_seqno
@ -2693,6 +2713,8 @@ TEST_P(ExternalSSTFileTest,
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
{ std : : make_pair ( " foo1 " , " fv1 " ) , std : : make_pair ( " foo2 " , " fv2 " ) } ) ;
data . push_back (
data . push_back (
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
{ std : : make_pair ( " bar1 " , " bv1 " ) , std : : make_pair ( " bar2 " , " bv2 " ) } ) ;
data . push_back (
{ std : : make_pair ( " bar3 " , " bv3 " ) , std : : make_pair ( " bar4 " , " bv4 " ) } ) ;
// Resize the true_data vector upon construction to avoid re-alloc
// Resize the true_data vector upon construction to avoid re-alloc
std : : vector < std : : map < std : : string , std : : string > > true_data (
std : : vector < std : : map < std : : string , std : : string > > true_data (
column_families . size ( ) ) ;
column_families . size ( ) ) ;
@ -2713,8 +2735,9 @@ TEST_P(ExternalSSTFileTest,
fault_injection_env - > DropUnsyncedFileData ( ) ;
fault_injection_env - > DropUnsyncedFileData ( ) ;
fault_injection_env - > SetFilesystemActive ( true ) ;
fault_injection_env - > SetFilesystemActive ( true ) ;
Close ( ) ;
Close ( ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " } , options ) ;
ReopenWithColumnFamilies ( { kDefaultColumnFamilyName , " pikachu " , " eevee " } ,
ASSERT_EQ ( 2 , handles_ . size ( ) ) ;
options ) ;
ASSERT_EQ ( 3 , handles_ . size ( ) ) ;
int cf = 0 ;
int cf = 0 ;
for ( const auto & verify_map : true_data ) {
for ( const auto & verify_map : true_data ) {
for ( const auto & elem : verify_map ) {
for ( const auto & elem : verify_map ) {