[SERVER-14820] Compact claims not to enforce unique indexes but actually does Created: 07/Aug/14  Updated: 20/Nov/14  Resolved: 13/Aug/14

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.6.0
Fix Version/s: 2.7.5

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

Issue Links:
Tested
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The claim that we don't want to enforce uniqueness in compact is made here:
https://github.com/mongodb/mongo/blob/v2.6/src/mongo/db/structure/collection_compact.cpp#L157

It doesn't actually work because we go directly to the index descriptor to check if dups are allowed here:
https://github.com/mongodb/mongo/blob/v2.6/src/mongo/db/index/btree_based_access_method.cpp#L413



 Comments   
Comment by Githook User [ 13/Aug/14 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-13951 Split index building in to UnitOfWork-sized stages

All index builds now go through the MultiIndexBuilder as its API was already
close to ideal. The following tickets have also been addressed by this commit:

SERVER-14710 Remove dropDups
SERVER-12309 Cloner build indexes in parallel
SERVER-14737 Initial sync uses bg index building
SERVER-9135 fast index build for initial sync
SERVER-2747 can't kill index in phase 2
SERVER-8917 check error code rather than assuming all errors are dups
SERVER-14820 compact enforces unique while claiming not to
SERVER-14746 IndexRebuilder should be foreground and fail fatally
Branch: master
https://github.com/mongodb/mongo/commit/00913e47de5aced5267e44e82ac9e976bbaac089

Comment by Eric Milkie [ 07/Aug/14 ]

Is the intention to change the comment, or to change the behavior? I'm not sure we need to change the behavior now as I don't see what benefit we get. The assumption from the comment may have been that building the index would be faster if we didn't enforce uniqueness?

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