Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
Replication
-
Quint Iteration 7, QuInt 8 08/28/15, Quint 9 09/18/15, QuInt A (10/12/15)
Description
The server logs a warning at startup if any collection is missing an _id index. A startup warning should also be generated at time of initial sync for any cloned collection that does not have this index.
Correctness of replication is not guaranteed for any collection that is missing this index. To illustrate a simple example: the following script inserts two documents into a replicated collection without an _id index, and shows that the secondary's copy of the collection ends up with only one document.
var rst = new ReplSetTest({nodes: 2}); |
rst.startSet();
|
rst.initiate();
|
var primary = rst.getPrimary(); |
primary.getCollection("test.foo").runCommand("create", {autoIndexId: false}); |
primary.getCollection("test.foo").insert({_id: 0, a: 1}); |
primary.getCollection("test.foo").insert({_id: 0, a: 2}); |
rst.awaitReplication();
|
var secondary = rst.getSecondary(); |
assert.eq(primary.getCollection("test.foo").count(), secondary.getCollection("test.foo").count()); |
// Line 10 throws "assert: [2] != [1] are not equal : undefined" |
Attachments
Issue Links
- is related to
-
SERVER-19067 Warn at creation that autoIndexId:false is deprecated
-
- Closed
-
-
DOCS-3523 "autoIndexId" collection option should include warning not to disable if using with replication
-
- Closed
-
-
SERVER-38624 Do not allow node to startup with autoIndexId: False collection
-
- Closed
-
- related to
-
SERVER-8237 autoIndexId:false should be disabled
-
- Closed
-