-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Catalog, Replication
-
None
-
Fully Compatible
-
ALL
-
99
Before SERVER-52538, when you add a document validator to a collection with the "collMod" command, the default validationAction/Level are explicitly included in the collection's catalog entry. They appear in listCollections:
> db.runCommand({collMod: "collection", validator: ...}) {ok: 1} > db.getCollectionInfos() [ { "name" : "foo", "type" : "collection", "options" : { "validator" : ..., "validationLevel" : "strict", "validationAction" : "error" } ]
Oddly, if you create a collection with a validator using the "create" command, the default validation action/level are OMITTED from the catalog entry. This difference is probably unintentional but we should preserve it.
After SERVER-52538's second commit, I accidentally changed this behavior, and collMod would OMIT validation action/level from the catalog entry if the user didn't pass values for them. concurrency_replication_multiversion and other suites started failing due to the inconsistency between old and new mongods' behavior.
It's possible I introduced an inconsistency between collMod's behavior on primaries and secondaries, but I didn't investigate. Probably not, since we only saw failures in the multiversion suites.
To fix this, I'll restore collMod's quirk: the default validation action/level are explicitly added to the catalog entry even when the user doesn't pass them.
- is caused by
-
SERVER-52538 Update IDL definition for create command
- Closed