diff options
-rw-r--r-- | jstests/multiVersion/text_index_limits.js | 53 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_index_format.cpp | 26 |
2 files changed, 0 insertions, 79 deletions
diff --git a/jstests/multiVersion/text_index_limits.js b/jstests/multiVersion/text_index_limits.js deleted file mode 100644 index 5860d5b0726..00000000000 --- a/jstests/multiVersion/text_index_limits.js +++ /dev/null @@ -1,53 +0,0 @@ -// TODO SERVER-36440: Remove this test -(function() { - "use strict"; - - load("jstests/libs/feature_compatibility_version.js"); - - // Start the node with FCV 4.0 - let conn = MongoRunner.runMongod({binVersion: "latest"}); - assert.commandWorked(conn.adminCommand({setFeatureCompatibilityVersion: "4.0"})); - var db = conn.getDB('test'); - var t = db.text_index_limits; - t.drop(); - - assert.commandWorked(t.createIndex({comments: "text"})); - - // 1. Test number of unique terms exceeds 400,000 - let commentsWithALotOfUniqueWords = ""; - // 26^4 = 456,976 > 400,000 - for (let ch1 = 97; ch1 < 123; ch1++) { - for (let ch2 = 97; ch2 < 123; ch2++) { - for (let ch3 = 97; ch3 < 123; ch3++) { - for (let ch4 = 97; ch4 < 123; ch4++) { - let word = String.fromCharCode(ch1, ch2, ch3, ch4); - commentsWithALotOfUniqueWords += word + " "; - } - } - } - } - assert.commandFailedWithCode( - db.runCommand( - {insert: t.getName(), documents: [{_id: 1, comments: commentsWithALotOfUniqueWords}]}), - 16732); - - // 2. Test total size of index keys for unique terms exceeds 4MB - - // 26^3 = 17576 < 400,000 - let prefix = "a".repeat(400); - let commentsWithWordsOfLargeSize = ""; - for (let ch1 = 97; ch1 < 123; ch1++) { - for (let ch2 = 97; ch2 < 123; ch2++) { - for (let ch3 = 97; ch3 < 123; ch3++) { - let word = String.fromCharCode(ch1, ch2, ch3); - commentsWithWordsOfLargeSize += prefix + word + " "; - } - } - } - assert.commandFailedWithCode( - db.runCommand( - {insert: t.getName(), documents: [{_id: 2, comments: commentsWithWordsOfLargeSize}]}), - 16733); - - MongoRunner.stopMongod(conn); -}()); diff --git a/src/mongo/db/fts/fts_index_format.cpp b/src/mongo/db/fts/fts_index_format.cpp index 2bcf35ff398..d9fda7efa14 100644 --- a/src/mongo/db/fts/fts_index_format.cpp +++ b/src/mongo/db/fts/fts_index_format.cpp @@ -159,21 +159,7 @@ void FTSIndexFormat::getKeys(const FTSSpec& spec, const BSONObj& obj, BSONObjSet // create index keys from raw scores // only 1 per string - - // TODO SERVER-36440: Completely remove this limit in 4.3. - if (serverGlobalParams.featureCompatibility.isVersionInitialized() && - serverGlobalParams.featureCompatibility.getVersion() == - ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo40) { - uassert(16732, - str::stream() << "too many unique keys for a single document to" - << " have a text index, max is " - << term_freqs.size() - << obj["_id"], - term_freqs.size() <= 400000); - } - long long keyBSONSize = 0; - const int MaxKeyBSONSizeMB = 4; for (TermFrequencyMap::const_iterator i = term_freqs.begin(); i != term_freqs.end(); ++i) { const string& term = i->first; @@ -198,18 +184,6 @@ void FTSIndexFormat::getKeys(const FTSSpec& spec, const BSONObj& obj, BSONObjSet keys->insert(res); keyBSONSize += res.objsize(); - - // TODO SERVER-36440: Completely remove this limit in 4.3. - if (serverGlobalParams.featureCompatibility.isVersionInitialized() && - serverGlobalParams.featureCompatibility.getVersion() == - ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo40) { - uassert(16733, - str::stream() << "trying to index text where term list is too big, max is " - << MaxKeyBSONSizeMB - << "mb " - << obj["_id"], - keyBSONSize <= (MaxKeyBSONSizeMB * 1024 * 1024)); - } } } |