-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
In SERVER-88953, a nontrivial number of server parameters are discussed that are indicative of a developer need to support "server parameter" values via set and get commands, but only to set the value for a scope that affects the client doing the operation. Currently these are all mixed in with the true server parameters, which have a process-wide scope. This is very ad hoc and thus parameters have surprising bevavior. We're relying on global currentClient singleton of the setters and getters. I feel like this needs a comprehensive structural solution.
SERVER-88953 added opCtx to every setter, which is a tactical fix to the currentClient thread_local access concern. However it doesn't install a distinction among the different parameters as to which are client-scoped and which are global, which I feel we should do in order to reduce churn and treat these different kinds of parameters with approriate and standardized semantics.
— example current ad hoc code —
This parameter affects the whole server.
ttlMonitorSleepSecs: description: "Period of TTL monitor thread (used for testing)." set_at: [startup, runtime] cpp_vartype: AtomicWord<int> cpp_varname: ttlMonitorSleepSecs on_update: "TTLMonitor::onUpdateTTLMonitorSleepSeconds" default: 60 validator: gt: 0 redact: false
Status TTLMonitor::onUpdateTTLMonitorSleepSeconds(int newSleepSeconds) { if (auto client = Client::getCurrent()) { if (auto ttlMonitor = TTLMonitor::get(client->getServiceContext())) { ttlMonitor->updateSleepSeconds(Seconds{newSleepSeconds}); } } return Status::OK(); }
... But others are less clear in scope.
Because this passes an entire opCtx to writer, it could be client-specific or not.
There seems to be no way to know.
Status TicketHolderManager::updateConcurrentWriteTransactions(const int32_t& newWriteTransactions) { if (auto client = Client::getCurrent()) { auto opCtx = client->getOperationContext(); ... writer->resize(opCtx, newWriteTransactions, Date_t::max()); ... } }
- is related to
-
SERVER-88953 ServerParameter onUpdate handlers should accept OperationContext
-
- Closed
-