-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Workload Resilience
-
WR Prioritized list
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
See details in BF-46509:
"consider making the request rate limiter not reject killCursors (or must otherwise guarantee cursor cleanup) as admitting a request that creates a cursor and then rejecting the killCursors that would clean it up strands the cursor"
We should consider this for commands like abortTransaction, commitTransaction, killOp, endSessions, etc. We should also apply this to queueing.
Potential Server change (ideas proposed by AI):
- Check the command only on the reject path. In SessionWorkflow::Impl::_dispatchWork (`session_workflow.cpp`), when _rateLimit() returns false, peek at the first field name of the OP_MSG body before building the rejection:
- If it is `killCursors`, admit the request and record it as an exemption, the same accounting as `IngressRequestRateLimiter::admitRequest` uses for exempt clients (`ingress_request_rate_limiter.cpp` L205–209).
- Otherwise, reject as today.
The admitted path does not change, so only rejected requests pay for the peek. This preserves the reason the limiter runs before parsing.
- Skip the queue wait for deferred tokens. When the mongos policy uses queue_mode: TargetQueueTime, a `killCursors` can receive a deferred token and wait in `waitForAdmission` (`src/mongo/s/commands/strategy.cpp`; `src/mongo/db/service_entry_point_shard_role.cpp`). That point runs after parsing, so the command is known and the wait can be skipped for `killCursors`.
- Mongos→shard `killCursors` is covered too. mongod uses the same `session_workflow.cpp` path, so the exemption also applies there whenever mongod's IRRL is engaged and the internal connection is not already exempt by appName.
- related to
-
SERVER-135768 Support rate limiting reads/writes separately in IRRL
-
- Open
-