[SERVER-20236] Read preference for an explain routed through mongos does not work on 3.0 for explain-of-count and explain-of-group Created: 01/Sep/15  Updated: 06/Dec/22  Resolved: 02/Jul/18

Status: Closed
Project: Core Server
Component/s: Querying, Sharding
Affects Version/s: 3.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File explain_read_pref.js    
Issue Links:
Related
is related to SERVER-21661 v3.0 mongos and v3.2 cluster explain ... Closed
is related to SERVER-19341 Finalize how read preference and slav... Closed
Assigned Teams:
Query
Operating System: ALL
Steps To Reproduce:

The attached test, explain_read_pref.js, demonstrates the issue. It is a slightly modified version of the test in the master branch (jstests/sharding/explain_read_pref.js).

Participants:

 Description   

In 3.0, the host targeting logic on mongos only works for the explain command if explaining a find operation. If an explain of a count or group operation is routed through mongos with a read preference, the read preference is ignored. As a result, these explains are always delivered to the primary node, even for read preferences like "secondary" or "secondaryPreferred".

This has already been fixed in the 3.1.8 development version under SERVER-19341. Therefore, the issue only affects the 3.0 branch. (It does not affect 2.6 or previous versions because find was the only explainable operation in these versions.)



 Comments   
Comment by David Storch [ 02/Jul/18 ]

Closing as Won't Fix since this issue only affects versions 3.0 and older.

Generated at Thu Feb 08 03:53:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.