[SERVER-17599] dropDups ignored on index creation Created: 16/Mar/15  Updated: 17/Mar/15  Resolved: 16/Mar/15

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 3.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Neil Lunn Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-17628 Unique Index Creation Fails Despite `... Closed
Related
related to DOCS-5012 3.0 docs still refer to dropDups option Closed
is related to SERVER-14710 Remove dropDups support from index bu... Closed
Backwards Compatibility: Major Change
Operating System: ALL
Steps To Reproduce:

Create duplicate data:

    db.test.insert({ "a": 1 })
    db.test.insert({ "a": 1 })

Try to create the index:

    db.test.ensureIndex({ "a": 1 },{ "unique": true, "dropDups": true })

Index build fails with message:

    {
        "createdCollectionAutomatically" : false,
        "numIndexesBefore" : 1,
        "errmsg" : "exception: E11000 duplicate key error dup key: { : 1.0 }",
        "code" : 11000,
        "ok" : 0
    }

Participants:

 Description   

The dropDups option is being ignored and indexing fails when a key with a unique constraint contains duplicates



 Comments   
Comment by Stennie Steneker (Inactive) [ 16/Mar/15 ]

neillunn See linked issue: DOCS-5012.

This is already present in the 3.0 release notes per my previous comment: http://docs.mongodb.org/manual/release-notes/3.0-compatibility/#remove-dropdups-option

Thanks,
Stephen

Comment by Neil Lunn [ 16/Mar/15 ]

Noted as a closed task. https://jira.mongodb.org/browse/SERVER-14710 But clearly still present in documentation and not present in release notes.

Comment by Stennie Steneker (Inactive) [ 16/Mar/15 ]

Hi Neil,

The dropDups option was removed in MongoDB 3.0:
http://docs.mongodb.org/manual/release-notes/3.0-compatibility/#remove-dropdups-option

See also: SERVER-14710. Non-deterministic deletion of data was an unexpected side effect of an index option.

Regards,
Stephen

Comment by Neil Lunn [ 16/Mar/15 ]

Originally sourced from here: http://stackoverflow.com/q/29072209/2313887

Generated at Thu Feb 08 03:45:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.