[SERVER-1708] moveprimary does not work when moving a db between replica set shards Created: 31/Aug/10  Updated: 12/Jul/16  Resolved: 25/Oct/10

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

Type: Bug Priority: Major - P3
Reporter: Tony Hannan Assignee: Tony Hannan
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

> ./mongod --version
db version v1.7.0-pre-, pdfile version 4.5
Tue Aug 31 12:04:20 git version: 0845e6c517c2f1a2065287252e149d7efffef13c

> ./mongos --version
Tue Aug 31 12:04:54 ./mongos db version v1.7.0-pre-, pdfile version 4.5 starting (--help for usage)
Tue Aug 31 12:04:54 git version: 0845e6c517c2f1a2065287252e149d7efffef13c
Tue Aug 31 12:04:54 sys info: Darwin nonserviam.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_42


Operating System: ALL
Participants:

 Description   

moveprimary works for individual server shards but not for replica set shards.

To reproduce:
1. Create one replica set, eg. 'repset1/127.0.0.1:30000,127.0.0.1:30001'
2. Add data to 'test' db in above set.
2. Create second replica set, eg 'repset2/127.0.0.1:30006,127.0.0.1:30007'
3. Make them both shards in a sharding set up.
4. mongosConn.getDB('admin').runCommand (

{moveprimary: 'test', to: 'repset2/127.0.0.1:30006,127.0.0.1:30007'}

)

runCommand yields following error:

{ "ok" : 0, "errmsg" : "clone failed" }

assert failed :

{ "ok" : 0, "errmsg" : "clone failed" }

Error("Printing Stack Trace (lines are 0-based in spidermonkey)")@:0
()@shell/utils.js:20
("assert failed :

{ \"ok\" : 0, \"errmsg\" : \"clone failed\" }

")@shell/utils.js:31
(0,"

{ \"ok\" : 0, \"errmsg\" : \"clone failed\" }

")@shell/utils.js:41
moveDB([object Mongo],"test","repset2/127.0.0.1:30006,127.0.0.1:30007")@jstests/tony/infra.js:80
@/Users/afsheenb/MongoDB/mongo/jstests/tony/ajh1.js:48
Tue Aug 31 11:33:13 uncaught exception: assert failed :

{ "ok" : 0, "errmsg" : "clone failed" }

failed to load: /Users/afsheenb/MongoDB/mongo/jstests/tony/ajh1.js

mongos log:
Tue Aug 31 11:33:13 [conn1] movePrimary: moving test primary from: repset1:repset1/127.0.0.1:30000,127.0.0.1:30001 to: repset2:repset2/127.0.0.1:30006,127.0.0.1:30007
Tue Aug 31 11:33:13 [conn1] clone failed

{ errmsg: "couldn't connect to server repset1/127.0.0.1:30000,127.0.0.1:30001", ok: 0.0 }

 Comments   
Comment by Tony Hannan [ 25/Oct/10 ]

Test case moved to jstests/slowNightly/moveprimary-replset.js

Comment by Tony Hannan [ 25/Oct/10 ]

It works. Test at jstests/grid/moveprimary-replset.js

Comment by Eliot Horowitz (Inactive) [ 24/Oct/10 ]

can you test again?
I think you may have actually fixed

Comment by Eliot Horowitz (Inactive) [ 27/Sep/10 ]

No workarounds - will get this fixed soon though

Comment by Eric Anderson [ 27/Sep/10 ]

Any workarounds?

Generated at Thu Feb 08 02:57:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.