Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-67293

Allow struct-type cluster parameters to have required fields

    • Type: Icon: Bug Bug
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Server Security
    • ALL

      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.

            Assignee:
            backlog-server-security [DO NOT USE] Backlog - Security Team
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: