-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
The CollectionRoutingInfoTargeter class is used by a WriteOp to target child write operations. It's also in charge of handling targeting-related errors such as StaleDbVersion and StaleConfig.
When a StaleDbVersion is returned, the WriteOp calls the CollectionRoutingInfoTargeter::noteStaleDbResponse() which will refresh the db metadata.
However, the CollectionRoutingInfoTargeter is also exposing a method called refreshIfNeeded() that is expected to refresh the collection routing information if the last received error is kCouldNotTarget. The refreshIfNeeded() method only refreshes the collection metadata and skips the refresh on the db metadata, which feels wrong since the db metadata is necessary to target unsharded-untracked collections.
There is no bug due to this behavior because we are handling the StaleDbVersion through the noteStaleDbResponse() handler. However, I think we should include the db metadata refresh under the refreshIfNeeded() to avoid any future misuse of it.
- is fixed by
-
SERVER-94376 Database is not refreshed under getCollectionRoutingInfoWithRefresh
- Closed
- is related to
-
SERVER-86671 CollectionRoutingInfo could contain stale database information even after refresh
- Closed