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/flow_control_logging.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/flow_control_logging.js')
-rw-r--r-- | jstests/noPassthrough/flow_control_logging.js | 78 |
1 files changed, 37 insertions, 41 deletions
diff --git a/jstests/noPassthrough/flow_control_logging.js b/jstests/noPassthrough/flow_control_logging.js index 0d4744b4559..bd3478aa7dd 100644 --- a/jstests/noPassthrough/flow_control_logging.js +++ b/jstests/noPassthrough/flow_control_logging.js @@ -8,51 +8,47 @@ * ] */ (function() { - "use strict"; +"use strict"; - load("jstests/libs/check_log.js"); +load("jstests/libs/check_log.js"); - const replSet = new ReplSetTest({name: "flow_control_logging", nodes: 3}); - replSet.startSet({ - setParameter: { - flowControlSamplePeriod: - 1, // Increase resolution to detect lag in a light write workload. - flowControlWarnThresholdSeconds: 1, - // Configure flow control to engage after one second of lag. - flowControlTargetLagSeconds: 1, - flowControlThresholdLagPercentage: 1, - // Use a speedy no-op writer to avoid needing a robust background writer. - writePeriodicNoops: true, - periodicNoopIntervalSecs: - 2 // replSet.initiate() can hang with a one second interval for reasons. - } - }); - replSet.initiate(); - - // Stop replication which will pin the commit point. - for (let sec of replSet.getSecondaries()) { - assert.commandWorked(sec.adminCommand({ - configureFailPoint: "pauseBatchApplicationAfterWritingOplogEntries", - mode: "alwaysOn" - })); +const replSet = new ReplSetTest({name: "flow_control_logging", nodes: 3}); +replSet.startSet({ + setParameter: { + flowControlSamplePeriod: 1, // Increase resolution to detect lag in a light write workload. + flowControlWarnThresholdSeconds: 1, + // Configure flow control to engage after one second of lag. + flowControlTargetLagSeconds: 1, + flowControlThresholdLagPercentage: 1, + // Use a speedy no-op writer to avoid needing a robust background writer. + writePeriodicNoops: true, + periodicNoopIntervalSecs: + 2 // replSet.initiate() can hang with a one second interval for reasons. } +}); +replSet.initiate(); - const timeoutMilliseconds = 30 * 1000; - // The test has stopped replication and the primary's no-op writer is configured to create an - // oplog entry every other second. Once the primary notices the sustainer rate is not moving, it - // should start logging a warning once per second. This check waits for two log messages to make - // sure the appropriate state variables are being reset. - checkLog.containsWithAtLeastCount( - replSet.getPrimary(), - "Flow control is engaged and the sustainer point is not moving.", - 2, - timeoutMilliseconds); +// Stop replication which will pin the commit point. +for (let sec of replSet.getSecondaries()) { + assert.commandWorked(sec.adminCommand( + {configureFailPoint: "pauseBatchApplicationAfterWritingOplogEntries", mode: "alwaysOn"})); +} - // Restart replication so the replica set will shut down. - for (let sec of replSet.getSecondaries()) { - assert.commandWorked(sec.adminCommand( - {configureFailPoint: "pauseBatchApplicationAfterWritingOplogEntries", mode: "off"})); - } +const timeoutMilliseconds = 30 * 1000; +// The test has stopped replication and the primary's no-op writer is configured to create an +// oplog entry every other second. Once the primary notices the sustainer rate is not moving, it +// should start logging a warning once per second. This check waits for two log messages to make +// sure the appropriate state variables are being reset. +checkLog.containsWithAtLeastCount(replSet.getPrimary(), + "Flow control is engaged and the sustainer point is not moving.", + 2, + timeoutMilliseconds); + +// Restart replication so the replica set will shut down. +for (let sec of replSet.getSecondaries()) { + assert.commandWorked(sec.adminCommand( + {configureFailPoint: "pauseBatchApplicationAfterWritingOplogEntries", mode: "off"})); +} - replSet.stopSet(); +replSet.stopSet(); })(); |