[SERVER-67293] Allow struct-type cluster parameters to have required fields Created: 14/Jun/22  Updated: 06/Dec/22  Resolved: 31/Oct/22

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

Type: Bug Priority: Major - P3
Reporter: Romans Kasperovics Assignee: Backlog - Security Team
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Security
Operating System: ALL
Participants:

 Description   

Currently, this is possible by omitting the default-value specification for the required field:

structs:
  ExampleClusterParameterStructValueType:
    inline_chained_structs: true
    chained_structs:
      ClusterServerParameter: clusterServerParameter
    fields:
      enabled: # <-- required field
        type: bool
      expireAfterSeconds: # <-- optional field
        type: safeInt64
        default: 0

This mechanism however, requires parameter initialisation prior getClusterParameter or setClusterParameter is called. Currently, the initialisation can be specified inside the IDL, but it requires non-constexpr initialiser-function for struct types.

server_parameters:
  someClusterParam:
    set_at: cluster
    cpp_vartype: ExampleClusterParameterStructValueType
    cpp_varname: gSomeClusterParam
    default:
      expr: getSomeClusterParamDefault() # <-- initialiser function
      is_constexpr: false

The same should be possible with serverless / multi-tenancy, preferably with constexpr initialiser.



 Comments   
Comment by Elizabeth Roytburd [ 31/Oct/22 ]

The use case for this is no longer a priority so we are closing this ticket out.

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