|
A copydb command will fail if a collection in the database contains a document that fails validation. When this occurs, a secondary will contain a collection with an _id index, whereas the corresponding primary will be missing that same _id index.
Oplog dump:
[
|
{
|
"ts" : Timestamp(1455321967, 1),
|
"h" : NumberLong("-2943391995913786641"),
|
"v" : 2,
|
"op" : "n",
|
"ns" : "",
|
"o" : {
|
"msg" : "initiating set"
|
}
|
},
|
{
|
"ts" : Timestamp(1455321978, 2),
|
"t" : NumberLong(1),
|
"h" : NumberLong("-7019435253571208007"),
|
"v" : 2,
|
"op" : "n",
|
"ns" : "",
|
"o" : {
|
"msg" : "new primary"
|
}
|
},
|
{
|
"ts" : Timestamp(1455321978, 3),
|
"t" : NumberLong(1),
|
"h" : NumberLong("3677791815055733623"),
|
"v" : 2,
|
"op" : "c",
|
"ns" : "test.$cmd",
|
"o" : {
|
"create" : "foo",
|
"validator" : {
|
"a" : {
|
"$exists" : true
|
}
|
},
|
"validationLevel" : "strict",
|
"validationAction" : "error"
|
}
|
},
|
{
|
"ts" : Timestamp(1455321978, 4),
|
"t" : NumberLong(1),
|
"h" : NumberLong("-5242686880532286683"),
|
"v" : 2,
|
"op" : "i",
|
"ns" : "test.foo",
|
"o" : {
|
"_id" : ObjectId("56be737a8e9c12d16896f4c6")
|
}
|
},
|
{
|
"ts" : Timestamp(1455321978, 5),
|
"t" : NumberLong(1),
|
"h" : NumberLong("4831483178064446599"),
|
"v" : 2,
|
"op" : "c",
|
"ns" : "test2.$cmd",
|
"o" : {
|
"create" : "foo",
|
"validator" : {
|
"a" : {
|
"$exists" : true
|
}
|
},
|
"validationLevel" : "strict",
|
"validationAction" : "error"
|
}
|
}
|
]
|
|