-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
ALL
ensureFieldsUniqueOrResolveDocumentKey() is used as part of the merge operator implementation and has different behavior depending if it is executed on the router or on the shard role. On the router, this function has the responsibility to retrieve the shard key pattern and the version of the target collection.
The target collection version is later pushed down to the shards that will use it to ensure that the collection is not dropped and recreated during the merge/$out operation.
The current implementation of ensureFieldsUniqueOrResolveDocumentKey() is forcing a refresh of the catalog cache, this is very inefficient because it causes all the other concurrent thread that are accessing the catalog cache for the same collection to wait for the forced refresh to complete.
The refresh should not be necessary in this case and in fact even forcing a refresh does not guarantee that the retrieved metadata are the latest present on the config server.
- is related to
-
SERVER-94889 Investigate suspicious usage of isSharded() condition
- Closed