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

Enforce initializer order for MONGO_REGISTER_TEST_COMMAND

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • Security 2020-06-29

      The helper macro MONGO_REGISTER_TEST_COMMAND currently requests an initializer be run "whenever", that is, without prependents or dependents. Fortunately, as an implementation detail, our initializer graph interprets this as "after all the complex initializers are done. However, our implementation could just as validly do the opposite and be equally correct.

      In reality, we need these registrants to run after the `--setParameter EnableTestCommands=1` flag has been evaluated otherwise we risk test-only commands not being available when they should be if the implementation ever changes.

      Add a prerequisite to this macro to run after "EndStartupOptionHandling"
      See: https://github.com/mongodb/mongo/blob/7eab469f87e860ce9e74918fdd5a23e943eb2673/src/mongo/db/commands.h#L1004

            Assignee:
            gabriel.marks@mongodb.com Gabriel Marks
            Reporter:
            sara.golemon@mongodb.com Sara Golemon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: