-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.2.8
-
Component/s: Index Maintenance, Querying, WiredTiger, Write Ops
-
ALL
-
I'm using an unique index:
{ "v" : 1, "unique" : true, "key" : { "state.agent" : 1 }, "name" : "state.agent_1", "ns" : "live.tasks.active", "partialFilterExpression" : { "state.value" : "assigned" }, "background" : true }
My applications works in a way that many times an update (using $set and $unset) is sent that should be rejected with an ""E11000 duplicate key error collection: live.tasks.active index: state.agent_1" because of duplicate value in the above index.
After running for ~20 days I realized that above index has become inconsistent with collection data in a way that a query using _id show's a document that should be in this index:
db.tasks.active.find({_id:ObjectId("57bea0f21ebfd0b31f32da1c")})
but a query that shows all data in the index doesn't show that document:
db.tasks.active.find({"state.value":"assigned"}, {"state.agent": 1})
I have tried to do a db.tasks.active.reIndex(), but it failed with a message that db.tasks.active contains duplicate values for an above index so that above index cannot be re-added.
It seems that because of an error sometimes a duplicate index value is allowed to enter into a collection document instead of returing ""E11000 duplicate key error collection: live.tasks.active index: state.agent_1".
I suspect that after this an index becomes inconsistent: isn't updated everytime as it should.
Most times I do get E11000, but from time to time update doesn't return an error (as it should) and updates a document making a duplicate index key entry that is not visible in the index itself.
- duplicates
-
SERVER-28546 Documents can erroneously be unindexed from a partial index
- Closed