Hello,
I wished I had come across that bug
(https://jira.mongodb.org/browse/SERVER-4332) before I initiated the rename
but unfortunately this isn't the case and I'm a bit puzzled as to the state
of my replica set. I have a simple replica set with 2 nodes and an
arbitrer. On the master I attempted to move a collection from one db to
another using renameCollection:
db.runCommand({renameCollection:"db1.products",to:"db2.products"});
After a few minutes (the collection was about 12GB in size) it came back
with the error
{
"errmsg" : "exception: no index name specified",
"code" : 12523,
"ok" : 0
}
Meanwhile this node stopped being the primary (it probably stopped
responding while I was doing that rename). So things are working fine so
far but I'm curious as to the state of the node I ran the renameCollection
on. Because now the products collection is present in both DBs. Replication
seems to still work fine. So to me it seems that the only difference is
that duplicated collection on what used to be my primary but is now a
secondary. Can I just drop it? Will it let me do it since it's a secondary?
And as a secondary question, how do you move a collection to another DB in
a replica set running with mongo 2.0.7? My collection has 5 million rows
(12GB) and is currently not being used by anything but it's part of a mongo
instance which is used for other things.
Thanks for any insight you can provide.
Gui