|
It looks like if I have a view on a non-sharded collection, then operations on it (e.g. find, explain) require an extra roundtrip because mongod bounces the first request with an exception that is used by mongos to find out that it's indeed a view:
2019-09-19T09:20:46.883-0500 D TRACKING [replSetDistLockPinger] Cmd: NotSet, TrackingId: 5d838ebe2a67f139ad45d445
|
2019-09-19T09:20:47.647-0500 D TRACKING [Uptime reporter] Cmd: NotSet, TrackingId: 5d838ebf2a67f139ad45d447
|
2019-09-19T09:20:48.476-0500 D - [conn5] User Assertion: CommandOnShardedViewNotSupportedOnMongod{ resolvedView: { ns: "test.test", pipeline: [], collation: { locale: "simple" } } }: On sharded systems, resolved views must be executed by mongos src/mongo/db/query/cursor_response.h 165
|
2019-09-19T09:20:48.479-0500 D TRACKING [conn5] Cmd: find, TrackingId: 5d838ec02a67f139ad45d44c
|
2019-09-19T09:20:48.483-0500 I COMMAND [conn5] command test.view appName: "MongoDB Shell" command: find { find: "view", filter: { x: 3.0 }, lsid: { id: UUID("a9e2ff0d-2a78-4a7a-b8d5-16f14ac83375") }, $clusterTime: { clusterTime: Timestamp(1568902782, 1), signature: { hash: BinData(0, 0000000000000000000000000000000000000000
|
I think this is not necessary for non-sharded collections.
|