diff options
author | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2018-04-24 11:31:54 +1000 |
---|---|---|
committer | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2018-04-24 11:31:54 +1000 |
commit | 7f2f527bf147d61b48696cd4438acb1a8a920c8a (patch) | |
tree | 8ec875a8c50e9cd5b36fbb0d4420071a0fd8e46c /src/mongo/db/index | |
parent | 93fd36a003686fe39935fa9c9d9b1b354a14eceb (diff) | |
download | mongo-7f2f527bf147d61b48696cd4438acb1a8a920c8a.tar.gz |
SERVER-34263 Use WT specific data format version for new unique idxr3.7.6
Diffstat (limited to 'src/mongo/db/index')
-rw-r--r-- | src/mongo/db/index/btree_key_generator.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/index/index_descriptor.cpp | 18 | ||||
-rw-r--r-- | src/mongo/db/index/index_descriptor.h | 6 |
3 files changed, 3 insertions, 22 deletions
diff --git a/src/mongo/db/index/btree_key_generator.cpp b/src/mongo/db/index/btree_key_generator.cpp index 9e24016e3e7..d1737ddf314 100644 --- a/src/mongo/db/index/btree_key_generator.cpp +++ b/src/mongo/db/index/btree_key_generator.cpp @@ -77,7 +77,6 @@ std::unique_ptr<BtreeKeyGenerator> BtreeKeyGenerator::make(IndexVersion indexVer return stdx::make_unique<BtreeKeyGeneratorV0>(fieldNames, fixed, isSparse); case IndexVersion::kV1: case IndexVersion::kV2: - case IndexVersion::kV2Unique: return stdx::make_unique<BtreeKeyGeneratorV1>(fieldNames, fixed, isSparse, collator); } return nullptr; diff --git a/src/mongo/db/index/index_descriptor.cpp b/src/mongo/db/index/index_descriptor.cpp index ca9ea36ece0..71fe92d0e47 100644 --- a/src/mongo/db/index/index_descriptor.cpp +++ b/src/mongo/db/index/index_descriptor.cpp @@ -101,7 +101,6 @@ bool IndexDescriptor::isIndexVersionSupported(IndexVersion indexVersion) { case IndexVersion::kV0: case IndexVersion::kV1: case IndexVersion::kV2: - case IndexVersion::kV2Unique: return true; } return false; @@ -120,7 +119,6 @@ Status IndexDescriptor::isIndexVersionAllowedForCreation( break; case IndexVersion::kV1: case IndexVersion::kV2: - case IndexVersion::kV2Unique: return Status::OK(); } return {ErrorCodes::CannotCreateIndex, @@ -129,21 +127,7 @@ Status IndexDescriptor::isIndexVersionAllowedForCreation( << static_cast<int>(indexVersion)}; } -IndexVersion IndexDescriptor::getDefaultIndexVersion( - ServerGlobalParams::FeatureCompatibility::Version featureCompatibilityVersion, - bool isUniqueIndex) { - // The gating variable would allow creation of V2 format unique index when set to true. - // Note: Here "isUniqueIndex" only considers whether or not "unique" field is specified - // and that its value evaluates to true. "_id" index for instance is unique, but the - // index spec for it doesn't carry a "unique" field. "isUniqueIndex" being false for - // "_id" indexes is on purpose, and in future if we were to make "_id" index specs - // include "unique:true", then we would need to change the logic here to preserve its - // behavior. - const bool useV2UniqueIndexFormat = false; - if (useV2UniqueIndexFormat && isUniqueIndex) { - return IndexVersion::kV2Unique; - } - +IndexVersion IndexDescriptor::getDefaultIndexVersion() { return IndexVersion::kV2; } diff --git a/src/mongo/db/index/index_descriptor.h b/src/mongo/db/index/index_descriptor.h index f1135ca3f91..b62cbeb9e38 100644 --- a/src/mongo/db/index/index_descriptor.h +++ b/src/mongo/db/index/index_descriptor.h @@ -56,7 +56,7 @@ class OperationContext; */ class IndexDescriptor { public: - enum class IndexVersion { kV0 = 0, kV1 = 1, kV2 = 2, kV2Unique = 3 }; + enum class IndexVersion { kV0 = 0, kV1 = 1, kV2 = 2 }; static constexpr IndexVersion kLatestIndexVersion = IndexVersion::kV2; static constexpr StringData k2dIndexBitsFieldName = "bits"_sd; @@ -132,9 +132,7 @@ public: /** * Returns the index version to use if it isn't specified in the index specification. */ - static IndexVersion getDefaultIndexVersion( - ServerGlobalParams::FeatureCompatibility::Version featureCompatibilityVersion, - bool isUniqueIndex = false); + static IndexVersion getDefaultIndexVersion(); // // Information about the key pattern. |