[SERVER-948] renameCollection not working with sharding enabled Created: 20/Jan/10  Updated: 12/Jul/16  Resolved: 28/Apr/10

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

Type: Improvement Priority: Minor - P4
Reporter: Ask Bjørn Hansen Assignee: Mathias Stearn
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

x86_64 Linux, 2010-01-19 snapshot; sharded installation


Participants:

 Description   

renameCollection() doesn't seem to work when sharding is enabled (mongodb.la.sol is our mongos instance).

$ /pkg/packages/mongodb-linux-x86_64-2010-01-19/bin/mongo mongodb.la.sol/foo
MongoDB shell version: 1.3.1-
url: mongodb.la.sol/foo
connecting to: mongodb.la.sol/foo
type "help" for help
> show collections
> db.foo.insert(

{test:true}

)
> db.foo.find()

{ "_id" : ObjectId("4b57a13da733b69b57f82ad1"), "test" : true }

> db.foo.renameCollection("foo2")

{ "errmsg" : "assertion: source namespace does not exist", "ok" : 0 }

>



 Comments   
Comment by Tony Lambropoulos [ 09/May/13 ]

its like on the actual replica set, the collections were in the new database, but when I check from a mongos, they arent there.

Comment by Mathias Stearn [ 28/Apr/10 ]

This now works in cases where it can be done atomicly. Important cases where it can't be done include sharded collections and sharded DBs where the source and the destination collections live on different shards.

Comment by auto [ 28/Apr/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: renameCollection in mongos SERVER-948
http://github.com/mongodb/mongo/commit/a634d541ade8c645bb55fbe3e22b81165c24f070

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