Details
Description
Description
The createIndexes command had permitted values of the wrong type for at least some of the following options: background, unique, sparse, finestIndexedLevel, coarsestIndexedLevel, dropDups, weights, default_language, language_override, wildcardProjection, 2dsphereIndexVersion, textIndexVersion, bits, min, and max. In SERVER-52545 and SERVER-53739, I have tightened up validation for these createIndexes options. Sara Goleman is further tightening validation in the upcoming SERVER-52539, and her changes will ban unrecognized options.
All valid invocations of createIndexes should work the same as before, but misformatted invocations that had silently misbehaved heretofore will be rejected henceforth.
Description of Linked Ticket
My change to the "listIndexes" IDL (SERVER-52545) has caused an intermittent failure in jstestfuzz_replication_initsync, I think this is the sequence:
- the fuzzer generates a createIndexes command like {createIndexes: [
{key: "foo", dropDups: "some string"}
]}
- that's wrong because "dropDups" is supposed to be a bool, but createIndexes succeeds anyway (its parameter validation is spotty, awaiting
SERVER-52539) and creates a corrupt catalog entry - subsequent "listIndexes" commands fail with a uassert, because they now strictly parse the catalog entries. The message is like: "Could not parse catalog entry while replying to listIndexes"
- initial sync is now impossible because the sync source can't answer "listIndexes". The initial-sync node crashes, logging:
> "Fatal assertion","attr":{"msgid":40088,"error":"InitialSyncFailure: error cloning databases :: caused by :: Location5254501: Error cloning collection 'qa450.existingname' :: caused by :: listIndexes failed: { ok: 0.0, errmsg: \"Could not parse catalog entry while replying to listIndexes\", code: 5254501, codeName: \"Location5254501\",
This will be fixed by
SERVER-52539"Specify input/output to createIndexes command in IDL", which will make createIndexes as strict as listIndexes. But I want to fix the BF sooner than that, so this ticket is a bandaid.
(In retrospect, we should've converted createIndexes before listIndexes, but I didn't anticipate this issue.)
I made createIndexes validate the "background" option in this commit, now I'll validate the rest of the options.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
Attachments
Issue Links
- documents
-
SERVER-53739 Validate all createIndexes options
-
- Closed
-