[SERVER-31730] PlanExecutor::executePlan() should preserve error code from getNext() failure Created: 26/Oct/17  Updated: 30/Oct/23  Resolved: 06/Nov/17

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.6.0-rc3

Type: Task Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-32208 Remove retrying of OperationFailed in... Backlog
Backwards Compatibility: Fully Compatible
Sprint: Query 2017-11-13
Participants:
Linked BF Score: 0

 Description   

PlanExecutor::executePlan() swallows the error code from a getNext() failure and replaces it with OperationFailed. This reduces the information provided about the error, and in particular, interferes with mongos retry logic, when it swallows an error code that mongos would consider retryable.



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

Author:

{'name': 'Justin Seyster', 'username': 'jseyster', 'email': 'justin.seyster@mongodb.com'}

Message: SERVER-31730 Preserve getNext status in PlanExecutor::executePlan().

It is possible for an update that gets interrupted because a primary
node stepped down to result in an error return from
PlanExecutor::getNext(), which ultimately propagates to the
client. Clients should know to retry any operation that fails for this
reason, but in PlanExecutor::executePlan(), the status code gets
rewritten to be OperationFailed, which clients do not know to retry.

This patch preserves the original error code, so that clients do the
right thing.

commit f6581038d95314794fcfc84f24253653a1ff861e
Author: Justin Seyster <justin.seyster@mongodb.com>
Date: Fri Oct 27 16:56:59 2017 -0400

SERVER-31730 Preserve getNext status in PlanExecutor::executePlan().
Branch: master
https://github.com/mongodb/mongo/commit/95bfa3866791e007de917982f215d1d8f40bc0f4

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