diff options
author | Benety Goh <benety@mongodb.com> | 2022-04-29 11:56:13 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-07 13:39:05 +0000 |
commit | 9827d2a5d878ff635285e394b98648231dbea268 (patch) | |
tree | 74b51bf0d3637d9d932a9b8df3b8b5e2d3c3d760 | |
parent | 5229b86161b1588df34fbee304b525068081a860 (diff) | |
download | mongo-9827d2a5d878ff635285e394b98648231dbea268.tar.gz |
SERVER-64659 add multiple index spec test case for indexBulkBuilder server status section
(cherry picked from commit e2abe094a39dda8d4b8f623de23423868c7efb8f)
-rw-r--r-- | jstests/noPassthrough/serverstatus_indexbulkbuilder.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/noPassthrough/serverstatus_indexbulkbuilder.js b/jstests/noPassthrough/serverstatus_indexbulkbuilder.js index 98d38c88bd5..ab7bef1cc61 100644 --- a/jstests/noPassthrough/serverstatus_indexbulkbuilder.js +++ b/jstests/noPassthrough/serverstatus_indexbulkbuilder.js @@ -58,5 +58,18 @@ assert.gte(indexBulkBuilderSection.count, 3, tojson(indexBulkBuilderSection)); assert.eq(indexBulkBuilderSection.filesOpenedForExternalSort, 1, tojson(indexBulkBuilderSection)); assert.eq(indexBulkBuilderSection.filesClosedForExternalSort, 1, tojson(indexBulkBuilderSection)); +// Building multiple indexes in a single createIndex command increases count by the number of +// indexes requested. +// The compound index is the only index that will cause the sorter to use the disk because it +// indexes large values in the field 'a'. +// The expected values in the server status should add to the numbers at the end of the resumable +// index build test case. +assert.commandWorked(coll.createIndexes([{c: 1}, {d: 1}, {e: 1, a: 1}])); +IndexBuildTest.assertIndexes(newNodeColl, 5, ['_id_', 'a_1', 'c_1', 'd_1', 'e_1_a_1']); +indexBulkBuilderSection = testDB.serverStatus().indexBulkBuilder; +assert.eq(indexBulkBuilderSection.count, 4, tojson(indexBulkBuilderSection)); +assert.eq(indexBulkBuilderSection.filesOpenedForExternalSort, 2, tojson(indexBulkBuilderSection)); +assert.eq(indexBulkBuilderSection.filesClosedForExternalSort, 2, tojson(indexBulkBuilderSection)); + replSet.stopSet(); })(); |