|
renctan, I think we're intentionally not decrementing the counter in those cases. The following is the comment thread in the code review from SERVER-31198. CC jack.mulrow
On 2017/12/21 22:25:01, jack.mulrow wrote:
> On 2017/12/21 18:53:30, maxh wrote:
> > Hmm, I didn't comment on this when reviewing
> > https://mongodbcr.appspot.com/172310001/, but I think one reason that the mongo
> > shell shouldn't decrement `numRetries` here is because it doesn't implement the
> > "server discovery and monitoring" Driver's specification to attempt to discover
> > the current primary after seeing a "not master" error. Decrementing `numRetries`
> > would make it so that two "not master" errors could occur in short succession
> > for the same command object and cause an error to be returned back to the
> > client, making retryable writes less useful in the mongo shell.
>
> That makes sense, but it still feels a little scary to retry without a bound.
> Could it be possible for the shell to get stuck in a loop if the
> connection was never closed for some reason, or if the server kept returning a
> "retryable" error?
|