[SERVER-34345] Make it easier to provide validation rules for server parameters Created: 05/Apr/18  Updated: 29/Oct/23  Resolved: 10/May/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.6.6, 4.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-32382 Rollback can time out if oplog entrie... Closed
Duplicate
is duplicated by SERVER-30389 Simple and generic way to restrict se... Closed
Related
related to SERVER-34952 Require validators for non-boolean se... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.6, v3.4
Sprint: Repl 2018-05-21
Participants:
Linked BF Score: 0

 Description   

We have nice macros for defining a server parameter, like MONGO_EXPORT_SERVER_PARAMETER. But if you want to validate the input in any way, you can't use the macros and have to define the ServerParameter explicitly, like we do here. It would be nice if we could just pass in a lambda to the macro that returned a Status indicating whether the value provided was valid, that could be used both for startup and runtime changes.



 Comments   
Comment by Githook User [ 21/Jun/18 ]

Author:

{'username': 'BillyDonahue', 'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com'}

Message: SERVER-34345 replace ...WITH_VALIDATOR macros to ->withValidator syntax.

metaprogramming compactness
mark unused auto pointer
change is_same value use from {} to ::value

(cherry picked from commit df4b551101995817b71a47ec85d58190d069540a)
Branch: v3.6
https://github.com/mongodb/mongo/commit/3cca5fccafbe69a317369e03ed91826c299e95c1

Comment by Githook User [ 21/Jun/18 ]

Author:

{'username': 'stbrody', 'name': 'Spencer T Brody', 'email': 'spencer@mongodb.com'}

Message: SERVER-34345 Make it easy to provide validator functions for server parameters

(cherry picked from commit 9c001939d82c4522a8cb071b4285b1f1718b81cf)
Branch: v3.6
https://github.com/mongodb/mongo/commit/bf30b803d36669eb5e8a1bda3314c21b4b851553

Comment by Spencer Brody (Inactive) [ 16/May/18 ]

Requesting backport to 3.6 and 3.4 to ease the backport of SERVER-32382

Comment by Githook User [ 15/May/18 ]

Author:

{'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue', 'name': 'Billy Donahue'}

Message: SERVER-34345 remove new EXPORT_SERVER_PARAMETER....WITH_VALIDATOR

fixes df4b551101995817b71a47ec85d58190d069540a
Branch: master
https://github.com/mongodb/mongo/commit/088097b7abadc753da184124c6240ede86d08178

Comment by Githook User [ 15/May/18 ]

Author:

{'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue', 'name': 'Billy Donahue'}

Message: SERVER-34345 replace ...WITH_VALIDATOR macros to ->withValidator syntax.

metaprogramming compactness
mark unused auto pointer
change is_same value use from {} to ::value
Branch: master
https://github.com/mongodb/mongo/commit/df4b551101995817b71a47ec85d58190d069540a

Comment by Githook User [ 10/May/18 ]

Author:

{'name': 'Spencer T Brody', 'email': 'spencer@mongodb.com', 'username': 'stbrody'}

Message: SERVER-34345 Make it easy to provide validator functions for server parameters
Branch: master
https://github.com/mongodb/mongo/commit/9c001939d82c4522a8cb071b4285b1f1718b81cf

Generated at Thu Feb 08 04:36:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.