[SERVER-45611] Lazily enforce that persisted collection validators are well formed Created: 16/Jan/20  Updated: 29/Oct/23  Resolved: 28/Jan/20

Status: Closed
Project: Core Server
Component/s: Querying, Write Ops
Affects Version/s: None
Fix Version/s: 4.2.4, 4.3.4

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Ian Boros
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-45588 Use of invalid regex in schema valida... Closed
Problem/Incident
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2
Sprint: Query 2020-01-27, Query 2020-02-10
Participants:
Linked BF Score: 38

 Description   

SERVER-45588 came out of a case where a user had persisted collection validators that were considered valid in 4.0 but not in 4.2 because some checks around RegexMatchExpressions were made tighter in 4.2. This prevented upgrade.

To avoid this kind of situation in the future, we should not enforce that collection validators which have been persisted are valid until we attempt to use them (when insertions are done). We should still enforce that validators are well formed when setting/creating them (through collMod or createCollection).

 

It looks like this would be relatively straightforward given the way CollectionImpl enforces that validators are well formed.



 Comments   
Comment by Githook User [ 24/Feb/20 ]

Author:

{'name': 'Ian Boros', 'username': 'puppyofkosh', 'email': 'ian.boros@mongodb.com'}

Message: SERVER-45611 lazily enforce that collection validators are valid
Branch: v4.2
https://github.com/mongodb/mongo/commit/bbdb6a411e614fcf048a8fe1ee363fac2ff0020c

Comment by Louis Williams [ 30/Jan/20 ]

ian.boros not unless there are any significant changes.

Comment by Ian Boros [ 30/Jan/20 ]

louis.williams do you have any objections to backporting this to 4.2?

Comment by Githook User [ 27/Jan/20 ]

Author:

{'username': 'puppyofkosh', 'name': 'Ian Boros', 'email': 'ian.boros@mongodb.com'}

Message: SERVER-45611 lazily enforce that collection validators are valid
Branch: master
https://github.com/mongodb/mongo/commit/582a071fa36630d302a25c9a6aec992fcd07a1e5

Comment by Ian Boros [ 16/Jan/20 ]

CC louis.williams as we discussed this a bit yesterday.

Generated at Thu Feb 08 05:09:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.