[SERVER-22386] could not contact primary Created: 31/Jan/16  Updated: 06/Apr/23  Resolved: 31/Jan/16

Status: Closed
Project: Core Server
Component/s: Replication, Sharding
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ali Hallaji Assignee: Stennie Steneker (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

We deploy sharded cluster between multi locations(data center).
We have multi replica set for each location, Also We have use from CSRS for configsvr, and We distribute configsvr between all locations.
Also we have 4 mongos that each mongos connect to near configsvr from config replica set name.
Issue: When I query to find into sharded collection, I get some error,Also Why I just use from tag shard aware into all query(insert, criteria).

I describe all details about this sharded cluster at below:
1- mongodb version: 3.2.1
2- QTY of locations(or Data center): 4 location to the names (thr, ifn, mhd, bnd)
3- The location "thr" is main datacenter, Then the thr must be majority on replica set.
4- We deploy the replica set for configsvr, and We put 4 members into thr, 4 into mhd, 4 into ifn and one member into bnd.
5- The thr is majority, Then 3 of members is votes=1 and other is zero(CSRS)
6- Other locations(mhd,ifn), They have just one member for votes=1(CSRS)
7- The bnd location just one secondery with votes=0(CSRS)
8- Each location have one replica set(3 members) for sharding.(Shard)
9- We use tag aware for replica set
10- We have 4 mongos, 4 replica set(3 member for two replica set, 2member for other replica set), 1 replica set configsvr(13 member)
11- Shard key: origin_code
12- We use tag aware

Example of Error when I insert doc with shard key:
mongos> db.origins.insert(

{origin_code:52}

)
WriteResult({
"nInserted" : 0,
"writeError" :

{ "code" : 7, "errmsg" : "could not contact primary for replica set thr" }

})

My question is if bnd replica set(shard, configsvr, mongos of bnd is up) disconnected from sharded cluster, That must be work and even it insert and find, So when it connected to sharded cluster configsvr must be migrate chunk or doc from bnd replica set to thr replica set.
Why thr replica set is disconnected from shard, I can't insert doc with tag thr(origin_code for the is 52).



 Comments   
Comment by Ali Hallaji [ 31/Jan/16 ]

Ok, Thank you very much

Comment by Stennie Steneker (Inactive) [ 31/Jan/16 ]

Hi,

The information in the current description isn't entirely clear, but this sounds like a support issue which needs some further discussion on your deployment and usage before determining if there might be a server issue.

> My question is if bnd replica set(shard, configsvr, mongos of bnd is up) disconnected from sharded cluster, That must be work and even it insert and find, So when it connected to sharded cluster configsvr must be migrate chunk or doc from bnd replica set to thr replica set.

If a replica set is part of a sharded cluster, you can only insert documents via a mongos. You can't isolate a replica set from a sharded cluster and expect normal operation (eg. migrations or inserting documents into an unavailable shard). The error message "could not contact primary for replica set thr" would be expected if that replica set was inaccessible or did not have a current primary.

It would be more appropriate if you can start a new discussion in the mongodb-user group. MongoDB team members are active in this forum and you can also benefit from the experience of other MongoDB users.

Thanks,
Stephen

Comment by Ali Hallaji [ 31/Jan/16 ]

Hi Stephen Steneker,
Thank you for your comment.
Yes of course, But I think this issue may be bug.
Because It not work normally.

Best Regards,
Hallaji

Comment by Stennie Steneker (Inactive) [ 31/Jan/16 ]

Hi Ali,

The SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag, where your question will reach a larger audience.

A question like this involving more discussion would be best posted on the mongodb-user group.

See our Technical Support page for additional support resources.

Thanks,
Stephen

Generated at Thu Feb 08 04:00:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.