[SERVER-28874] make stale shardVersion error override 'allowPartialResults' option in establishCursors() Created: 19/Apr/17  Updated: 30/Oct/23  Resolved: 03/Nov/17

Status: Closed
Project: Core Server
Component/s: Querying, Sharding
Affects Version/s: 3.4.3, 3.5.6
Fix Version/s: 3.6.0-rc3

Type: Bug Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-31782 allow aggregation to take an 'allowPa... Backlog
related to SERVER-44126 Make AsyncResultsMerger only swallow ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2017-09-11, Sharding 2017-10-23, Sharding 2017-11-13
Participants:

 Description   

We should add "!ErrorCodes::isStaleShardingError() &&" when checking whether to discard an error from a shard because of the allowPartialResults flag.

https://github.com/mongodb/mongo/blob/r3.5.6/src/mongo/s/query/establish_cursors.cpp#L112-L115

        // Unreachable host errors are swallowed if the 'allowPartialResults' option is set.
        if (allowPartialResults) {
            continue;
        }

This bug also exists in the ARM on 3.4 (although in 3.4, we didn't swallow retriable errors).

Also, should we really swallow all other errors? The only other error we check for on both 3.4 and 3.6 is ErrorCodes::CommandOnShardedViewNotSupportedOnMongod.



 Comments   
Comment by Githook User [ 03/Nov/17 ]

Author:

{'name': 'Esha Maharishi', 'username': 'EshaMaharishi', 'email': 'esha.maharishi@mongodb.com'}

Message: SERVER-28874 make allowPartialResults option only apply if exhausted retries on retriable errors
Branch: master
https://github.com/mongodb/mongo/commit/b74b769b0551697ae43c7f2690ff200cb4044819

Comment by Esha Maharishi (Inactive) [ 31/Oct/17 ]

Since aggregation sits on top of establishCursors(), aggregation has the ability to support allowPartialResults (in addition to find), but it currently does not.

This ticket adds a js test case that aggregation fails if 'allowPartialResults' is passed in the command, and the test case can be removed when we decide to officially support aggregation with allowPartialResults.

CC charlie.swanson@mongodb.com

Comment by Esha Maharishi (Inactive) [ 25/Apr/17 ]

Note: add a test that exercises this behavior

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