[SERVER-76541] documents can't be find with secondary readPref from mongos after create an sharded collection Created: 26/Apr/23 Updated: 26/Apr/23 Resolved: 26/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4 Required |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Chao Yin | Assignee: | Yuan Fang |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
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.
|
| Comments |
| Comment by Yuan Fang [ 26/Apr/23 ] |
|
Thank you for submitting your report. It appears that the issue you reported is a duplicate of I am closing this ticket for now. However, if you see any evidence indicating this is a separate issue, please let us know and we will reopen the ticket. Regards, |