[SERVER-45202] Improve Command alias infrastructure Created: 17/Dec/19  Updated: 29/Oct/23  Resolved: 23/Jan/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.3, 3.6.20, 4.2.10, 4.0.21

Type: Improvement Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: neweng, save-for-sam
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-44414 failCommand fail point does not work ... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2, v4.0, v3.6
Participants:

 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.


 Comments   
Comment by Githook User [ 28/Aug/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@10gen.com'}

Message: SERVER-45202 Improve command alias infrastructure

(cherry picked from commit 3cd3a6da3fe0b6f022b721094bda0b97c3527d23)
Branch: v3.6
https://github.com/mongodb/mongo/commit/4e0bb24f64db02c8dde9967c9571e08fb16bcec3

Comment by Githook User [ 27/Aug/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@10gen.com'}

Message: SERVER-45202 Improve command alias infrastructure

(cherry picked from commit 3cd3a6da3fe0b6f022b721094bda0b97c3527d23)
Branch: v4.0
https://github.com/mongodb/mongo/commit/e743135b6c87dc61ea91959633860f867aece528

Comment by Githook User [ 26/Aug/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@10gen.com'}

Message: SERVER-45202 Improve command alias infrastructure

(cherry picked from commit 3cd3a6da3fe0b6f022b721094bda0b97c3527d23)
Branch: v4.2
https://github.com/mongodb/mongo/commit/b8f28f03d53d0f3ce722826e4eafaf09c644c53a

Comment by Githook User [ 23/Jan/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@10gen.com'}

Message: SERVER-45202 Improve command alias infrastructure
Branch: master
https://github.com/mongodb/mongo/commit/3cd3a6da3fe0b6f022b721094bda0b97c3527d23

Generated at Thu Feb 08 05:08:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.