[SERVER-37168] IDL: Add a method for specifying integer limits Created: 17/Sep/18  Updated: 29/Oct/23  Resolved: 05/Oct/18

Status: Closed
Project: Core Server
Component/s: IDL
Affects Version/s: None
Fix Version/s: 4.1.4

Type: Improvement Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Sara Golemon
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Security 2018-10-08
Participants:
Linked BF Score: 0

 Description   

For the $exchange aggregation stage, there are options that directly control the number and size of buffers that the stage will allocate and fill. It would be awesome if we could specify the limits (at least for integers) in the IDL itself instead of adding assertions in the cpp.



 Comments   
Comment by Githook User [ 08/Oct/18 ]

Author:

{'name': 'Sara Golemon', 'email': 'sara.golemon@mongodb.com', 'username': 'sgolemon'}

Message: SERVER-37168 Use numeric_limits instead of raw ordinals
Branch: master
https://github.com/mongodb/mongo/commit/065935311777d1016ea35cf78784f6dc793860e2

Comment by Githook User [ 05/Oct/18 ]

Author:

{'name': 'Sara Golemon', 'email': 'sara.golemon@mongodb.com', 'username': 'sgolemon'}

Message: SERVER-37168 Add validators for IDL fields
Branch: master
https://github.com/mongodb/mongo/commit/f9600749453db5dec58bd1bbfd967e16b1578a24

Comment by Sara Golemon [ 26/Sep/18 ]

How should we deal with the set accessors?  Example:

MyIDLType val;
// Ideally the value being set should be validated here.
val.setFoo(123);

If we have the setters return Status, then EVERY existing callsite will need to be updated or we'll get "ignoring Status" errors. We could uassert(), and since no field has validators on them yet, that's probably fine, but may lead to surprises. I think the worst option by far is ignoring validation in this direction.

Comment by Mark Benvenuto [ 17/Sep/18 ]

sara.golemon, you work in IDL for server parameter validators may help us build this feature in the future.

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