[SERVER-56737] Provide a separate path for delisting operations Created: 06/May/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: sa-remove-fv-backlog-22
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-70960 Fix the mismatch between registering ... Backlog
is related to SERVER-47802 Destroy opCtx after responding to cli... Closed
is related to SERVER-57016 Consider changing MozJSScriptEngine t... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

SERVER-47802 enabled an instance of ServiceStateMachine to postpone destruction of operations (i.e., instances of OperationContext) until after sending responses to the client. This enables partially moving the cost of running opCtx destructor off of the critical path.

Currently, ServiceStateMachine kills and delists operations before sinking the response to postpone destruction without impacting the visible state of running operations (e.g., the currentOp output). Killing the operation is currently necessary to ensure any task scheduled on the opCtx baton is drained and the operation cannot be reused.

However, killing an operation also notifies all killOpListeners (see here), callbacks that are invoked whenever an operation is killed – and killing operations to postpone their destruction can be very confusing to killOpListeners.

for (const auto listener : _killOpListeners) {
    try {
        listener->interrupt(opCtx->getOpID());
    } catch (...) {
        std::terminate();
    }
}

This ticket should investigate the possibility of providing a separate path for delisting operations in ServiceStateMachine without killing them (e.g., running killOpListeners). Next, it should introduce a new interface to delist operations and replace the usage of killAndDelistOperation in ServiceStateMachine if doing so doesn't violate any design invariants.


Generated at Thu Feb 08 05:40:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.