-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.4 Required
-
Component/s: None
-
None
-
ALL
-
After creating a sharded collection and inserting some documents, thoese documents may not be read from other mongos with secondary readPref, even by setting local readConcern.
Another mongos thinks that the table is a unsharded unshared collection and sends the request to the primaryshard, but the data may be distributed on another shard.
And if secondary readpref is set, the request sent to the shard will not carry routing information, and will not check whether the route is dirty, so the route cannot be refreshed.
https://github.com/mongodb/mongo/blob/r4.4.13/src/mongo/db/service_entry_point_common.cpp#L1157
https://github.com/mongodb/mongo/blob/r4.4.13/src/mongo/db/s/collection_sharding_runtime.cpp#L328
With local readconcern, this phenomenon still exists.
Although the routing information is carried, the routing is empty and can pass the inspection.
5.0 does not have this problem, it seems that because the code of the route cache is modified, mongos will refresh the route after receiving the first request.
- duplicates
-
SERVER-53474 Cannot read from another mongos with secondaryPreferred after creating a new collection on one mongos
- Closed
- related to
-
SERVER-54625 Maybe the root case for reading from secondary return empty even readConcern=local/majority
- Closed