mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
check for background indexing in progress after dup check SERVER-1317
This commit is contained in:
parent
50ce0e0539
commit
c088ca1af8
12
db/index.cpp
12
db/index.cpp
@ -172,11 +172,6 @@ namespace mongo {
|
||||
uassert(10097, "bad table to index name on add index attempt",
|
||||
cc().database()->name == nsToDatabase(sourceNS.c_str()));
|
||||
|
||||
/* we can't build a new index for the ns if a build is already in progress in the background -
|
||||
EVEN IF this is a foreground build.
|
||||
*/
|
||||
uassert(12588, "cannot add index with a background operation in progress",
|
||||
!BackgroundOperation::inProgForNs(sourceNS.c_str()));
|
||||
|
||||
BSONObj key = io.getObjectField("key");
|
||||
uassert(12524, "index key pattern too large", key.objsize() <= 2048);
|
||||
@ -222,6 +217,13 @@ namespace mongo {
|
||||
uasserted(12505,s);
|
||||
}
|
||||
|
||||
/* we can't build a new index for the ns if a build is already in progress in the background -
|
||||
EVEN IF this is a foreground build.
|
||||
*/
|
||||
uassert(12588, "cannot add index with a background operation in progress",
|
||||
!BackgroundOperation::inProgForNs(sourceNS.c_str()));
|
||||
|
||||
|
||||
/* this is because we want key patterns like { _id : 1 } and { _id : <someobjid> } to
|
||||
all be treated as the same pattern.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user