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

Improve Command alias infrastructure

    XMLWordPrintable

Details

    • Fully Compatible
    • v4.2, v4.0, v3.6

    Description

      We currently give each Command a name and an oldName (see here). The oldName is only used to register the command into a map. This limits our command infrastructure and makes it difficult to describe commands externally (e.g. via failpoints). We should do the following:

      • Modify Commands to have a name that is used to quickly identify a Command and a list of aliases that can also be used to invoke a function. We should keep both of these locally so that a Command can list all names by which it can be invoked.
      • Add a helper to Command that checks if a given name is in its list. (Perhaps by invoking the CommandRegistry::findCommand() function and comparing pointers.)
      • Change CommandHelpers::shouldActivateFailCommandFailPoint() to take a proper Command::Invocation* and invoke the helper instead of doing a simple string comparison.

      Attachments

        Issue Links

          Activity

            People

              amirsaman.memaripour@mongodb.com Amirsaman Memaripour
              ben.caimano@mongodb.com Benjamin Caimano (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: