[SERVER-1770] Replica set fails to add member Created: 10/Sep/10 Updated: 30/Mar/12 Resolved: 10/Sep/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.6.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jozef Sovcik | Assignee: | Kyle Banker |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
a) 4 replica-set nodes running according to rs.status() are all healthy |
||
| Attachments: |
|
| Operating System: | Linux |
| Participants: |
| Description |
|
Hi, I'm trying to use Ruby to configure MongoDB replica set and seems that there is a bug while trying to eval rs.add. When trying to use db.eval to run rs.add() from Ruby script I'm getting following error: , "ok"=>1.0} Log file (primary) shows following error (full connection log is attached as "log_rsadd_using_ruby.txt" It worked when I tried to add member using mongo shell using the same rs.add(), so I'm sure all members were up. |
| Comments |
| Comment by Jozef Sovcik [ 10/Sep/10 ] |
|
Great! |
| Comment by Kyle Banker [ 10/Sep/10 ] |
|
Added. |
| Comment by Jozef Sovcik [ 10/Sep/10 ] |
|
I would anyway recommend either So others will not waste time trying to find why rs.add does not work... |
| Comment by Jozef Sovcik [ 10/Sep/10 ] |
|
one more correction config = connection['local']['system.replset'].find_one Anyway, it works. Thanks a lot! Based on this experience I wrote a method for Mongo::Connection class 'add_rs_member'. |
| Comment by Kyle Banker [ 10/Sep/10 ] |
|
First like should read config = connection['local']['system.replSet'].find_one |
| Comment by Kyle Banker [ 10/Sep/10 ] |
|
I believe the problem is that eval takes and write lock and that this conflicts with the requirements of reinitiating a replica set. Much better to do this manually like so: config = connection['local']['system.replSet'].findOne connection['admin'].command({ :replSetReconfig => config}) Please report back if this works. Include the relevant Ruby file you've written if it fails. |
| Comment by Jozef Sovcik [ 10/Sep/10 ] |
|
I have it all right here in front of me, so for next couple of hours I'm available to help. |
| Comment by Jozef Sovcik [ 10/Sep/10 ] |
|
Forgot to mention: Linux distro: Debian Lenny 64bit |
| Comment by Eliot Horowitz (Inactive) [ 10/Sep/10 ] |
|
Kyle can help figure what the root issue is here |
| Comment by Jozef Sovcik [ 10/Sep/10 ] |
|
I have attached also ruby script I used for testing. |