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

Review cluster server parameter elegibility logic in cluster_server_parameter_utils JS test library

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.0.0, 8.0.0-rc0, 7.3.0, 8.1.0-rc0
    • Component/s: None
    • None
    • Catalog and Routing

      When doing integration testing via JS tests, various tests should apply to all cluster server parameters. To centralize test efforts, there is a JS tests library jstests/libs/cluster_server_parameter_utils.js that supports a dozen of individual tests. That JS test library contains a listing of the cluster server parameters. This listing also contains a series of fields (featureFlag, setParameters, serverless, standaloneIncompatible) that determine which parameters are available (and thus should be considered for testing) according to the server environment used in the tests.

      Inspecting the code for considering which cluster server parameters should be tested hints to some likely flaws:

      • The validateSetParameter function tests if a given server parameter is set by running db.runCommand({getParameter: 1, param: 1}). This will try to find a server parameter literally called "param", and thus the check always fails and cluster server parameters with a setParameters field are never considered. Most likely db.runCommand({getParameter: 1, [param]: 1}) was intended.
      • The validateStandalone function checks if the parameter definition has a standaloneIncompatible field, but never checks whether its value is true or false. Thus, cluster server parameters defined with a standaloneIncompatible: false field will still not be tested in standalone server instances. This appears to be undesired (e.g. see SERVER-79236). The final check should be most likely be !(isStandalone && cp.standaloneIncompatible).

      Review the elegibility logic in order to increase test coverage.

            Assignee:
            Unassigned Unassigned
            Reporter:
            joan.bruguera-mico@mongodb.com Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: