summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.h
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2016-09-14 20:49:17 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2016-09-14 20:49:17 -0400
commit8302d0735b34a16cac000e5e345722487536e5bc (patch)
treec9ef60fe493eda60feacddfd67c0ec298939c4ef /src/mongo/db/dbhelpers.h
parent46acb1b94944bc7aa68ff6a8b3cd2d340b272c6f (diff)
downloadmongo-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/dbhelpers.h')
-rw-r--r--src/mongo/db/dbhelpers.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.h b/src/mongo/db/dbhelpers.h
index 6386a943552..f3acb9f190c 100644
--- a/src/mongo/db/dbhelpers.h
+++ b/src/mongo/db/dbhelpers.h
@@ -32,6 +32,7 @@
#include <memory>
#include "mongo/db/db.h"
+#include "mongo/db/index/index_descriptor.h"
#include "mongo/db/record_id.h"
#include "mongo/db/storage/data_protector.h"
@@ -66,6 +67,7 @@ struct Helpers {
static void ensureIndex(OperationContext* txn,
Collection* collection,
BSONObj keyPattern,
+ IndexDescriptor::IndexVersion indexVersion,
bool unique,
const char* name);