diff options
author | Erin Zhu <erin.zhu@mongodb.com> | 2022-08-19 13:45:44 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-19 14:33:39 +0000 |
commit | 7d7518830818fd84a13c3a408830c3c5ab01117c (patch) | |
tree | 385031d5aaecc58eea4627c9582e56b3bc85a12f /jstests | |
parent | 83ffa4f1c95242972cc0022b8872aa7486bbb95c (diff) | |
download | mongo-7d7518830818fd84a13c3a408830c3c5ab01117c.tar.gz |
SERVER-68941 Unify common functionality in BulkBuilder implementations
Diffstat (limited to 'jstests')
6 files changed, 94 insertions, 2 deletions
diff --git a/jstests/noPassthrough/restart_index_build_if_resume_fails.js b/jstests/noPassthrough/restart_index_build_if_resume_fails.js index 99b2c49d8b1..365afd1e640 100644 --- a/jstests/noPassthrough/restart_index_build_if_resume_fails.js +++ b/jstests/noPassthrough/restart_index_build_if_resume_fails.js @@ -12,6 +12,7 @@ "use strict"; load("jstests/noPassthrough/libs/index_build.js"); +load("jstests/libs/sbe_util.js"); // For checkSBEEnabled. const dbName = "test"; const collName = jsTestName(); @@ -22,6 +23,8 @@ rst.initiate(); let primary = rst.getPrimary(); let coll = primary.getDB(dbName).getCollection(collName); +const columnstoreEnabled = checkSBEEnabled( + primary.getDB(dbName), ["featureFlagColumnstoreIndexes", "featureFlagSbeFull"], true); assert.commandWorked(coll.insert({a: 1})); @@ -50,5 +53,34 @@ ResumableIndexBuildTest.runFailToResume(rst, [{a: 10}, {a: 11}], [{a: 12}, {a: 13}]); +// TODO (SERVER-65978): Add side writes to these test cases once they are supported by column store +// index builds. +if (columnstoreEnabled) { + ResumableIndexBuildTest.runFailToResume(rst, + dbName, + collName, + {"$**": "columnstore"}, + {failPointAfterStartup: "failToParseResumeIndexInfo"}, + [], + [{a: 4}, {a: 5}], + true /* failWhileParsing */); + + ResumableIndexBuildTest.runFailToResume(rst, + dbName, + collName, + {"$**": "columnstore"}, + {failPointAfterStartup: "failSetUpResumeIndexBuild"}, + [], + [{a: 8}, {a: 9}]); + + ResumableIndexBuildTest.runFailToResume(rst, + dbName, + collName, + {"$**": "columnstore"}, + {removeTempFilesBeforeStartup: true}, + [], + [{a: 12}, {a: 13}]); +} + rst.stopSet(); -})();
\ No newline at end of file +})(); diff --git a/jstests/noPassthrough/restart_index_build_if_resume_interrupted_by_shutdown.js b/jstests/noPassthrough/restart_index_build_if_resume_interrupted_by_shutdown.js index 4ae755d33e4..70b91ac5ccd 100644 --- a/jstests/noPassthrough/restart_index_build_if_resume_interrupted_by_shutdown.js +++ b/jstests/noPassthrough/restart_index_build_if_resume_interrupted_by_shutdown.js @@ -64,6 +64,18 @@ if (columnstoreEnabled) { {a: 1}, // initial doc [], [{a: 4}, {a: 5}]); + + ResumableIndexBuildTest.runResumeInterruptedByShutdown( + rst, + dbName, + collName + "_bulkload_drain_column_store", + {"$**": "columnstore"}, // index key pattern + "resumable_index_build4", // index name + {name: "hangIndexBuildDuringBulkLoadPhase", logIdWithIndexName: 4924400}, + "bulk load", + {a: [11, 22, 33]}, // initial doc + [], + [{a: 99}, {a: 100}]); } rst.stopSet(); })(); diff --git a/jstests/noPassthrough/resumable_index_build_bulk_load_phase.js b/jstests/noPassthrough/resumable_index_build_bulk_load_phase.js index beb88681d00..2d8b948e7e7 100644 --- a/jstests/noPassthrough/resumable_index_build_bulk_load_phase.js +++ b/jstests/noPassthrough/resumable_index_build_bulk_load_phase.js @@ -12,6 +12,7 @@ "use strict"; load("jstests/noPassthrough/libs/index_build.js"); +load("jstests/libs/sbe_util.js"); // For checkSBEEnabled. const dbName = "test"; @@ -19,6 +20,9 @@ const rst = new ReplSetTest({nodes: 1}); rst.startSet(); rst.initiate(); +const columnstoreEnabled = checkSBEEnabled( + rst.getPrimary().getDB(dbName), ["featureFlagColumnstoreIndexes", "featureFlagSbeFull"], true); + const runTests = function(docs, indexSpecsFlat, collNameSuffix) { const coll = rst.getPrimary().getDB(dbName).getCollection(jsTestName() + collNameSuffix); assert.commandWorked(coll.insert(docs)); @@ -51,5 +55,16 @@ runTests([{a: [1, 2], b: {c: [3, 4]}, d: ""}, {e: "", f: [[]], g: null, h: 8}], [{"$**": 1}, {h: 1}], "_wildcard"); +if (columnstoreEnabled) { + const testDocs = [ + {foo: 1, b: 10}, + {foo: 2, b: 11}, + {foo: 3, b: 12}, + {foo: 5, b: 13}, + {foo: 7, b: 14}, + ]; + runTests(testDocs, [{"$**": "columnstore"}, {b: 1}], "_columnstore"); +} + rst.stopSet(); })();
\ No newline at end of file diff --git a/jstests/noPassthrough/resumable_index_build_bulk_load_phase_large.js b/jstests/noPassthrough/resumable_index_build_bulk_load_phase_large.js index 8e46afb2260..905596b21d9 100644 --- a/jstests/noPassthrough/resumable_index_build_bulk_load_phase_large.js +++ b/jstests/noPassthrough/resumable_index_build_bulk_load_phase_large.js @@ -13,6 +13,7 @@ "use strict"; load("jstests/noPassthrough/libs/index_build.js"); +load("jstests/libs/sbe_util.js"); // For checkSBEEnabled. const dbName = "test"; @@ -21,6 +22,8 @@ const rst = new ReplSetTest( rst.startSet(); rst.initiate(); +const columnstoreEnabled = checkSBEEnabled( + rst.getPrimary().getDB(dbName), ["featureFlagColumnstoreIndexes", "featureFlagSbeFull"], true); // Insert enough data so that the collection scan spills to disk. const coll = rst.getPrimary().getDB(dbName).getCollection(jsTestName()); const bulk = coll.initializeUnorderedBulkOp(); @@ -40,5 +43,16 @@ ResumableIndexBuildTest.run( ["bulk load"], [{skippedPhaseLogID: 20391}]); +if (columnstoreEnabled) { + ResumableIndexBuildTest.run( + rst, + dbName, + coll.getName(), + [[{"$**": "columnstore"}]], + [{name: "hangIndexBuildDuringBulkLoadPhase", logIdWithIndexName: 4924400}], + 50, + ["bulk load"], + [{skippedPhaseLogID: 20391}]); +} rst.stopSet(); })();
\ No newline at end of file diff --git a/jstests/noPassthrough/resumable_index_build_collection_scan_phase_large.js b/jstests/noPassthrough/resumable_index_build_collection_scan_phase_large.js index 640bd711065..cc82cd05203 100644 --- a/jstests/noPassthrough/resumable_index_build_collection_scan_phase_large.js +++ b/jstests/noPassthrough/resumable_index_build_collection_scan_phase_large.js @@ -66,6 +66,5 @@ if (columnstoreEnabled) { ["collection scan"], [{numScannedAfterResume: numDocuments - maxIndexBuildMemoryUsageMB}]); } - rst.stopSet(); })();
\ No newline at end of file diff --git a/jstests/noPassthrough/resumable_index_build_mixed_phases.js b/jstests/noPassthrough/resumable_index_build_mixed_phases.js index 4e6ff5113a0..21e64da1346 100644 --- a/jstests/noPassthrough/resumable_index_build_mixed_phases.js +++ b/jstests/noPassthrough/resumable_index_build_mixed_phases.js @@ -137,6 +137,26 @@ if (columnstoreEnabled) { ], ["initialized", "collection scan"], [{numScannedAfterResume: 3}, {numScannedAfterResume: 2}]); + + runColumnTests( + [ + {name: "hangIndexBuildBeforeWaitingUntilMajorityOpTime", logIdWithBuildUUID: 4940901}, + {name: "hangIndexBuildDuringBulkLoadPhase", logIdWithIndexName: 4924400} + + ], + ["initialized", "bulk load"], + [{numScannedAfterResume: 3}, {skippedPhaseLogID: 20391}]); + + runColumnTests( + [ + { + name: "hangIndexBuildDuringCollectionScanPhaseBeforeInsertion", + logIdWithBuildUUID: 20386 + }, + {name: "hangIndexBuildDuringBulkLoadPhase", logIdWithIndexName: 4924400} + ], + ["collection scan", "bulk load"], + [{numScannedAfterResume: 2}, {skippedPhaseLogID: 20391}]); } rst.stopSet(); })();
\ No newline at end of file |