Enforce initializer order for MONGO_REGISTER_TEST_COMMAND

XMLWordPrintableJSON

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

      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
            Reporter:
            Sara Golemon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: