[SERVER-54278] Add feature flag to disable Opportunistic Reads by default Created: 04/Feb/21  Updated: 29/Oct/23  Resolved: 24/Feb/21

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 4.2.0
Fix Version/s: 4.2.13

Type: Task Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File SERVER-54278-c5a.8xlarge.png    
Issue Links:
Depends
Documented
is documented by DOCS-14251 Investigate changes in SERVER-54278: ... Closed
Related
is related to SERVER-53853 Large buildup of mongos to mongod con... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2021-02-22, Service Arch 2021-03-08
Participants:

 Description   

Opportunistic reads against replica-sets was originally introduced in v4.2 as part of PM-856. This feature allows mongos to direct secondary reads to any secondary with an active connection, instead of waiting for a new connection to a specific secondary.

Under certain workloads, as described in SERVER-53853, opportunistic reads may trigger construction of unnecessary connections to mongod processes, which would regress the overall performance.

This ticket should introduce a new feature flag to disable opportunistic reads in v4.2 by default. In particular, the following tickets from PM-856 introduce new functionality that we might want to guard with the feature flag: SERVER-41132, SERVER-41133, and SERVER-41134.

We may wan to approach this ticket from this for loop, introduced by SERVER-41133 (see excerpt below).

// Attempt to get a connection to every target host
for (size_t idx = 0; idx < request.target.size() && !cmdState->finishLine.isReady(); ++idx) {
    auto connFuture = _pool->get(request.target[idx], request.sslMode, request.timeout);
    ...
}



 Comments   
Comment by Githook User [ 24/Feb/21 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-54278 Add feature flag to disable Opportunistic Reads by default
Branch: v4.2
https://github.com/mongodb/mongo/commit/030c2936957607671ba3309718ef194bb3ad5f5d

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