|
It looks like it was the work to defer building indexes from SERVER-8412 and SERVER-11611 that "fixed" the bug where we used to "ignore" things like autoIndexId property when doing rename across DBs in 2.4 but we "respect" it in 2.6. Code comparison:
https://github.com/mongodb/mongo/commit/0abf27ae913dc3ca15b97480b1e35775ec2efbda#diff-892538d882b517875a5199201a5ef016L164
Reproducer with 2.4
> db.version()
|
2.4.8
|
> db
|
mrtemp1
|
> db.dropDatabase()
|
{ "dropped" : "mrtemp1", "ok" : 1 }
|
> db.getSiblingDB("mrtemp2").dropDatabase()
|
{ "dropped" : "mrtemp2", "ok" : 1 }
|
> db.createCollection("noindex",{autoIndexId:false})
|
{ "ok" : 1 }
|
> db.system.namespaces.find()
|
{ "name" : "mrtemp1.noindex", "options" : { "create" : "noindex", "autoIndexId" : false } }
|
> db.adminCommand({renameCollection:"mrtemp1.noindex",to:"mrtemp2.noindex"})
|
{ "ns" : "mrtemp1.noindex", "ok" : 1 }
|
> db.getSiblingDB("mrtemp2").system.namespaces.find()
|
{ "name" : "mrtemp2.system.indexes" }
|
{ "name" : "mrtemp2.noindex.$_id_" }
|
{ "name" : "mrtemp2.noindex" }
|
Reproducer with 2.6
> use mrtemp1
|
> db.version()
|
2.6.1
|
> db.dropDatabase()
|
{ "dropped" : "mrtemp1", "ok" : 1 }
|
> db.getSiblingDB("mrtemp2").dropDatabase()
|
{ "dropped" : "mrtemp2", "ok" : 1 }
|
> db.createCollection("noindex",{autoIndexId:false})
|
{ "ok" : 1 }
|
> db.system.namespaces.find()
|
{ "name" : "mrtemp1.noindex", "options" : { "autoIndexId" : false } }
|
> db.adminCommand({renameCollection:"mrtemp1.noindex",to:"mrtemp2.noindex"})
|
{ "ok" : 1 }
|
> db.getSiblingDB("mrtemp2").system.namespaces.find()
|
{ "name" : "mrtemp2.noindex", "options" : { "autoIndexId" : false } }
|
|