[SERVER-73492] Support IDL 'type' under 'server_parameters' Created: 31/Jan/23  Updated: 30/Mar/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-73269 add a new startup configuration para... Closed
is related to SERVER-73587 IDL 'chained_structs' does not execut... Backlog
Assigned Teams:
Service Arch
Sprint: Execution Team 2023-03-20
Participants:

 Description   

There is a HostAndPort IDL type, but it does not appear to be supported under 'server_parameters' IDL definitions. Attempting to do so like this:

server_parameters:
    searchIndexAtlasHostAndPort:
        description: 'Search index Atlas host address'
        set_at: [ startup ]
        type: HostAndPort
        cpp_varname: gSearchIndexParams

results in an error msg like this:

...
Errors found while compiling IDL
search_index_options.idl: (12, 8): ID0008: Unknown IDL node 'type' for YAML entity 'server_parameters'
...

Instead of an easy IDL definition like above, it's necessary to create a CPP type and leverage it in the IDL, like done in this recent patch commit, where IDL looks like this

 server_parameters:
     searchIndexAtlasHostAndPort:
         description: 'Search index Atlas host address'
         set_at: [ startup ]
         default: ''
         cpp_varname: 'globalSearchIndexParams.host'
         validator:
             callback: 'SearchIndexParams::onValidateHost'

There is a second use case, doing the exact same thing, in this code.



 Comments   
Comment by Dianna Hohensee (Inactive) [ 30/Mar/23 ]

I looked into the error above: here's a more complete error logging msg. The problem appears to be when this code is hit because my IDL type is a startup server parameter, not a cluster wide server parameter (note sure why these things matter), and the logic was added by SERVER-68342.

The workaround proposed doesn't appear viable, because there are some other IDL related issues. Please consider the original request.

Comment by Max Hirschhorn [ 03/Feb/23 ]

search_index_options.idl: (12, 8): ID0008: Unknown IDL node 'type' for YAML entity 'server_parameters'

dianna.hohensee@mongodb.com, I believe this error can be resolved by specifying a property named cpp_vartype rather than type (for example). I don't know if that addresses the question about the validator callback though.

Generated at Thu Feb 08 06:24:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.