Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
Description
Here's the page of the docs where I'm seeing things.
The quote is by autoIndexId:
IMPORTANT
For replica sets, all collections must have autoIndexId set to true.
I'd suggest changing this to something like "For replica sets, you should not set autoIndexId: false, because it will interfere with replication."
The page as it exists now isn't true; we currently do allow it (I verified in a sharded cluster). There are a couple of JIRA issues open on this (here's one, here's another, hat tip to scotthernandez for pointing me to them).
Steps to reproduce:
1. Spin up a replica set
2. Perform the following on the primary:
db.createCollection("foo", { autoIndexId: false } )
|
db.foo.insert( { _id : 0, a : 1 } )
|
db.foo.insert( { _id : 0, a : 1 } )
|
db.foo.insert( { _id : 0, a : 1 } )
|
db.foo.update( { _id : 0 }, { $set : { b : 1 } }, { multi : true } )
|
Check the oplog on the primary (all the writes are there), and then check on a secondary with db.foo.find(); I see only one document, though I don't know if that's a deterministic finding or if other factors will affect this.
Attachments
Issue Links
- duplicates
-
SERVER-19067 Warn at creation that autoIndexId:false is deprecated
-
- Closed
-