[SERVER-42658] secondary don't refresh its routing table when transition to primary. Created: 07/Aug/19 Updated: 06/Dec/22 Resolved: 13/Aug/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.4.22, 3.6.12, 4.0.10 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | FirstName lipengchong | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | pull-request | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Sharding
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | A Sharded Cluster with 2 replset shards (shard A and shard B), 2 mongos (a and b). mongos> sh.shardCollection("test.table1",{_id:"hashed"}) { "collectionsharded" : "test.table1", "ok" : 1 } , mongos> db.table2.find() { "_id" : 3 } { "_id" : 6 } { "_id" : 8 } |
||||||||
| Participants: | |||||||||
| Description |
|
Recently, we get a strange phenomenon that all data of a sharding table are in the primary shard. After a period of research, i think i get a bug. |
| Comments |
| Comment by FirstName lipengchong [ 14/Aug/19 ] |
|
hi Kaloian Manassiev . I think the problem of "I don't know what's the state of this collection" and "The collection is unsharded" is for mongos . But in my phenomenon , I think the main problem is mongod, mongod should refresh the routing tables when transition to primary. So maybe it is a different problem with the |
| Comment by Kaloian Manassiev [ 13/Aug/19 ] |
|
Hi lpc, Thank you for the detailed description and repro steps. What you have experienced is caused by the fact that currently we have no way to differentiate between "I don't know what's the state of this collection" and "The collection is unsharded" and we are already tracking it by Please follow Best regards, |
| Comment by FirstName lipengchong [ 09/Aug/19 ] |
|
I have attached a patch for resolve this problem. it's based on v34, other versions are similar it. |
| Comment by Danny Hatcher (Inactive) [ 07/Aug/19 ] |
|
Thanks for the report and the steps to reproduce. I can confirm that if I follow your scenario I end up in a state where both mongos nodes only return some of the information found on the primary shard for the collection. I'll forward it along to our sharding team to take a further look. |