diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-09-14 20:49:17 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-09-14 20:49:17 -0400 |
commit | 8302d0735b34a16cac000e5e345722487536e5bc (patch) | |
tree | c9ef60fe493eda60feacddfd67c0ec298939c4ef /src/mongo/db/index_builder.cpp | |
parent | 46acb1b94944bc7aa68ff6a8b3cd2d340b272c6f (diff) | |
download | mongo-8302d0735b34a16cac000e5e345722487536e5bc.tar.gz |
SERVER-24033 Write full index spec in oplog entry for index creation.
This ensures that the index version (aka the "v" field) is always
present in the oplog entry when creating indexes on a 3.4 primary.
We can therefore assume that if the "v" field isn't present in the
corresponding oplog entry, then a v=1 index should be built.
Changes MultiBlockIndex::init() to return the index specifications
that were actually created.
The "repairDatabase", "compact", "copydb", and "cloneCollection"
commands no longer automatically upgrade the index version to the
current default version. Instead, the only command that does so is
the "reIndex" command.
Diffstat (limited to 'src/mongo/db/index_builder.cpp')
-rw-r--r-- | src/mongo/db/index_builder.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp index fbefb512ff2..352b5f2d5cc 100644 --- a/src/mongo/db/index_builder.cpp +++ b/src/mongo/db/index_builder.cpp @@ -161,7 +161,7 @@ Status IndexBuilder::_build(OperationContext* txn, try { - status = indexer.init(_index); + status = indexer.init(_index).getStatus(); if (status.code() == ErrorCodes::IndexAlreadyExists) { if (allowBackgroundBuilding) { // Must set this in case anyone is waiting for this build. |