mirror of https://github.com/mongodb/mongo
SERVER-112221 Add execution control adjustment algorithm to serverStatus (#43096)
Co-authored-by: Pol Piñol Castuera <pol.pinol@mongodb.com> GitOrigin-RevId: 9a86fde668cab7d898206f1792ff2a3ac6284b5f
This commit is contained in:
parent
443e034134
commit
fce29a1440
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* Checks the concurrency algorithm is reported on serverStatus.
|
||||
*
|
||||
* @tags: [
|
||||
* featureFlagMultipleTicketPoolsExecutionControl,
|
||||
* ]
|
||||
*/
|
||||
|
||||
import {ReplSetTest} from "jstests/libs/replsettest.js";
|
||||
|
||||
const rst = new ReplSetTest({
|
||||
nodes: 1,
|
||||
});
|
||||
|
||||
rst.startSet();
|
||||
rst.initiate();
|
||||
|
||||
const primary = rst.getPrimary();
|
||||
const db = primary.getDB(jsTestName());
|
||||
|
||||
assert.commandWorked(
|
||||
rst.getPrimary().adminCommand({
|
||||
setParameter: 1,
|
||||
storageEngineConcurrencyAdjustmentAlgorithm: "throughputProbing",
|
||||
}),
|
||||
);
|
||||
|
||||
let algorithm = db.serverStatus().queues.execution.storageEngineConcurrencyAdjustmentAlgorithm;
|
||||
assert.eq(2, algorithm);
|
||||
|
||||
assert.commandWorked(
|
||||
rst.getPrimary().adminCommand({
|
||||
setParameter: 1,
|
||||
storageEngineConcurrencyAdjustmentAlgorithm: "fixedConcurrentTransactionsWithPrioritization",
|
||||
}),
|
||||
);
|
||||
|
||||
algorithm = db.serverStatus().queues.execution.storageEngineConcurrencyAdjustmentAlgorithm;
|
||||
assert.eq(1, algorithm);
|
||||
|
||||
assert.commandWorked(
|
||||
rst.getPrimary().adminCommand({
|
||||
setParameter: 1,
|
||||
storageEngineConcurrencyAdjustmentAlgorithm: "fixedConcurrentTransactions",
|
||||
}),
|
||||
);
|
||||
|
||||
algorithm = db.serverStatus().queues.execution.storageEngineConcurrencyAdjustmentAlgorithm;
|
||||
assert.eq(0, algorithm);
|
||||
|
||||
rst.stopSet();
|
||||
|
|
@ -356,6 +356,7 @@ void TicketingSystem::appendStats(BSONObjBuilder& b) const {
|
|||
boost::optional<BSONObjBuilder> writeStats;
|
||||
int32_t readOut = 0, readAvailable = 0, readTotalTickets = 0;
|
||||
int32_t writeOut = 0, writeAvailable = 0, writeTotalTickets = 0;
|
||||
_state.loadRelaxed().appendStats(b);
|
||||
b.append("totalDeprioritizations", _opsDeprioritized.loadRelaxed());
|
||||
|
||||
for (size_t i = 0; i < _holders.size(); ++i) {
|
||||
|
|
@ -536,5 +537,9 @@ bool TicketingSystem::TicketingState::isRuntimeResizable() const {
|
|||
return !usesThroughputProbing();
|
||||
}
|
||||
|
||||
void TicketingSystem::TicketingState::appendStats(BSONObjBuilder& b) const {
|
||||
b.append("storageEngineConcurrencyAdjustmentAlgorithm", algorithm);
|
||||
}
|
||||
|
||||
} // namespace admission
|
||||
} // namespace mongo
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ private:
|
|||
bool usesPrioritization() const;
|
||||
bool usesThroughputProbing() const;
|
||||
bool isRuntimeResizable() const;
|
||||
void appendStats(BSONObjBuilder& b) const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue