1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/**
* Tests that if an index build fails to resume during setup (before the index builds thread is
* created), the index build will successfully restart from the beginning.
*
* @tags: [
* requires_majority_read_concern,
* requires_persistence,
* requires_replication,
* ]
*/
(function() {
"use strict";
load("jstests/noPassthrough/libs/index_build.js");
load("jstests/libs/sbe_util.js"); // For checkSBEEnabled.
const dbName = "test";
const collName = jsTestName();
let rst = new ReplSetTest({nodes: 1});
rst.startSet();
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}));
ResumableIndexBuildTest.runFailToResume(rst,
dbName,
collName,
{a: 1},
{failPointAfterStartup: "failToParseResumeIndexInfo"},
[{a: 2}, {a: 3}],
[{a: 4}, {a: 5}],
true /* failWhileParsing */);
ResumableIndexBuildTest.runFailToResume(rst,
dbName,
collName,
{a: 1},
{failPointAfterStartup: "failSetUpResumeIndexBuild"},
[{a: 6}, {a: 7}],
[{a: 8}, {a: 9}]);
ResumableIndexBuildTest.runFailToResume(rst,
dbName,
collName,
{a: 1},
{removeTempFilesBeforeStartup: true},
[{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();
})();
|