Operational Defect Database

BugZero found this defect 132 days ago.

MongoDB | 2539088

Shard-local re-execution of a command might bubble up a misleading StaleConfig exception to the router

Last update date:

3/15/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

In some cases, when a shard realizes that the filtering metadata is not properly installed, it fails the current execution of the command, forces a refresh and then it re-executes the original command. If that refresh ends up failing, the error that is bubbled up to the router is the StaleConfig one and not the new one we got from the refresh. This behavior for in general makes a lot of sense: the router will retry the whole command and then the shard will execute the same steps as before, hoping that the refresh won't fail. Bubbling up the StaleConfig instead of the proper error might be problematic in some cases, though: imagine that we get a NotPrimary exception. If we bubble up a StaleConfig exception the router won't realize that the primary has changed, potentially leading to a re-execution of the command with exactly the same consequences until we  exhaust the retries.

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

In Code Review

Learn More

Search:

...