diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:20:35 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 11:02:23 -0400 |
commit | 134a4083953270e8a11430395357fb70a29047ad (patch) | |
tree | dd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /jstests/noPassthrough/timestamp_index_builds.js | |
parent | 1e46b5049003f427047e723ea5fab15b5a9253ca (diff) | |
download | mongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz |
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'jstests/noPassthrough/timestamp_index_builds.js')
-rw-r--r-- | jstests/noPassthrough/timestamp_index_builds.js | 128 |
1 files changed, 63 insertions, 65 deletions
diff --git a/jstests/noPassthrough/timestamp_index_builds.js b/jstests/noPassthrough/timestamp_index_builds.js index e5ffa405d45..41f5ecfb42c 100644 --- a/jstests/noPassthrough/timestamp_index_builds.js +++ b/jstests/noPassthrough/timestamp_index_builds.js @@ -18,84 +18,82 @@ * @tags: [requires_replication, requires_persistence, requires_majority_read_concern] */ (function() { - "use strict"; +"use strict"; - const rst = new ReplSetTest({ - name: "timestampingIndexBuilds", - nodes: 2, - nodeOptions: - {setParameter: {logComponentVerbosity: tojsononeline({storage: {recovery: 2}})}} - }); - const nodes = rst.startSet(); - rst.initiate(); +const rst = new ReplSetTest({ + name: "timestampingIndexBuilds", + nodes: 2, + nodeOptions: {setParameter: {logComponentVerbosity: tojsononeline({storage: {recovery: 2}})}} +}); +const nodes = rst.startSet(); +rst.initiate(); - if (!rst.getPrimary().adminCommand("serverStatus").storageEngine.supportsSnapshotReadConcern) { - // Only snapshotting storage engines require correct timestamping of index builds. - rst.stopSet(); - return; - } +if (!rst.getPrimary().adminCommand("serverStatus").storageEngine.supportsSnapshotReadConcern) { + // Only snapshotting storage engines require correct timestamping of index builds. + rst.stopSet(); + return; +} - function getColl(conn) { - return conn.getDB("timestampingIndexBuild")["coll"]; - } +function getColl(conn) { + return conn.getDB("timestampingIndexBuild")["coll"]; +} - let coll = getColl(rst.getPrimary()); +let coll = getColl(rst.getPrimary()); - // Create a collection and wait for the stable timestamp to exceed its creation on both nodes. - assert.commandWorked( - coll.insert({}, {writeConcern: {w: "majority", wtimeout: rst.kDefaultTimeoutMS}})); +// Create a collection and wait for the stable timestamp to exceed its creation on both nodes. +assert.commandWorked( + coll.insert({}, {writeConcern: {w: "majority", wtimeout: rst.kDefaultTimeoutMS}})); - // Wait for the stable timestamp to match the latest oplog entry on both nodes. - rst.awaitLastOpCommitted(); +// Wait for the stable timestamp to match the latest oplog entry on both nodes. +rst.awaitLastOpCommitted(); - // Disable snapshotting on all members of the replica set so that further operations do not - // enter the majority snapshot. - nodes.forEach(node => assert.commandWorked(node.adminCommand( - {configureFailPoint: "disableSnapshotting", mode: "alwaysOn"}))); +// Disable snapshotting on all members of the replica set so that further operations do not +// enter the majority snapshot. +nodes.forEach(node => assert.commandWorked(node.adminCommand( + {configureFailPoint: "disableSnapshotting", mode: "alwaysOn"}))); - assert.commandWorked(coll.createIndexes([{foo: 1}], {background: true})); - rst.awaitReplication(); +assert.commandWorked(coll.createIndexes([{foo: 1}], {background: true})); +rst.awaitReplication(); - rst.stopSet(undefined, true); +rst.stopSet(undefined, true); - // The `disableSnapshotting` failpoint is no longer in effect. Bring up and analyze each node - // separately. The client does not need to perform any writes from here on out. - for (let nodeIdx = 0; nodeIdx < 2; ++nodeIdx) { - let node = nodes[nodeIdx]; - let nodeIdentity = tojsononeline({nodeIdx: nodeIdx, dbpath: node.dbpath, port: node.port}); +// The `disableSnapshotting` failpoint is no longer in effect. Bring up and analyze each node +// separately. The client does not need to perform any writes from here on out. +for (let nodeIdx = 0; nodeIdx < 2; ++nodeIdx) { + let node = nodes[nodeIdx]; + let nodeIdentity = tojsononeline({nodeIdx: nodeIdx, dbpath: node.dbpath, port: node.port}); - // Bringing up the node as a standalone should only find the `_id` index. - { - jsTestLog("Starting as a standalone. Ensure only the `_id` index exists. Node: " + - nodeIdentity); - let conn = rst.start(nodeIdx, {noReplSet: true, noCleanData: true}); - assert.neq(null, conn, "failed to restart node"); - assert.eq(1, getColl(conn).getIndexes().length); - rst.stop(nodeIdx); - } + // Bringing up the node as a standalone should only find the `_id` index. + { + jsTestLog("Starting as a standalone. Ensure only the `_id` index exists. Node: " + + nodeIdentity); + let conn = rst.start(nodeIdx, {noReplSet: true, noCleanData: true}); + assert.neq(null, conn, "failed to restart node"); + assert.eq(1, getColl(conn).getIndexes().length); + rst.stop(nodeIdx); + } - // Bringing up the node with `--replSet` will run oplog recovery. The `foo` index will be - // rebuilt, but not become "stable". - { - jsTestLog("Starting as a replica set. Both indexes should exist. Node: " + - nodeIdentity); - let conn = rst.start(nodeIdx, {startClean: false}, true); - conn.setSlaveOk(); - assert.eq(2, getColl(conn).getIndexes().length); - rst.stop(nodeIdx); - } + // Bringing up the node with `--replSet` will run oplog recovery. The `foo` index will be + // rebuilt, but not become "stable". + { + jsTestLog("Starting as a replica set. Both indexes should exist. Node: " + nodeIdentity); + let conn = rst.start(nodeIdx, {startClean: false}, true); + conn.setSlaveOk(); + assert.eq(2, getColl(conn).getIndexes().length); + rst.stop(nodeIdx); + } - // Restarting the node as a standalone once again only shows the `_id` index. - { - jsTestLog( - "Starting as a standalone after replication startup recovery. Ensure only the `_id` index exists. Node: " + - nodeIdentity); - let conn = rst.start(nodeIdx, {noReplSet: true, noCleanData: true}); - assert.neq(null, conn, "failed to restart node"); - assert.eq(1, getColl(conn).getIndexes().length); - rst.stop(nodeIdx); - } + // Restarting the node as a standalone once again only shows the `_id` index. + { + jsTestLog( + "Starting as a standalone after replication startup recovery. Ensure only the `_id` index exists. Node: " + + nodeIdentity); + let conn = rst.start(nodeIdx, {noReplSet: true, noCleanData: true}); + assert.neq(null, conn, "failed to restart node"); + assert.eq(1, getColl(conn).getIndexes().length); + rst.stop(nodeIdx); } +} - rst.stopSet(); +rst.stopSet(); }()); |