[SERVER-34551] Add failpoint to fail commands with network errors or arbitrary error codes Created: 18/Apr/18  Updated: 08/Jan/24  Resolved: 01/May/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Tess Avitabile (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-34187 FailPoint to hang up on client in abo... Closed
is duplicated by SERVER-34057 Update onPrimaryTransactionalWrite fa... Closed
Related
related to SERVER-5587 Command to close current connections Closed
related to SERVER-35083 Extend failCommand to return write co... Closed
is related to SERVER-34943 failCommand failpoint should ignore c... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-05-07
Participants:

 Description   

To aid testing, especially for drivers, we should have a failpoint that can induce arbitrary command failures.

Configuring such a failpoint would look like:

node.adminCommand({
  configureFailPoint: 'failCommand',
  mode: 'alwaysOn',
  data: {
    closeConnection: false, // If true, closes the current socket when the fail point is hit
    errorCode: ErrorCodes.NotMaster // If set, causes the command to return the given code without actually executing.  Incompatibile with 'closeConnection'
  }
});

This failpoint will not be triggered for isMaster, configureFailPoint, or buildinfo.



 Comments   
Comment by Githook User [ 01/May/18 ]

Author:

{'email': 'tess.avitabile@mongodb.com', 'name': 'Tess Avitabile', 'username': 'tessavitabile'}

Message: SERVER-34551 Add failpoint to fail commands with network errors or arbitrary error codes
Branch: master
https://github.com/mongodb/mongo/commit/8a36874a06f27cd4ba5391cfa48964850af9428a

Comment by Githook User [ 01/May/18 ]

Author:

{'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue', 'username': 'BillyDonahue'}

Message: SERVER-34551 refactor failCommand evaluation

The execCommandDatabase function is too large.
Branch: master
https://github.com/mongodb/mongo/commit/0d097ebf4d5c78e77d789dad3f8a45a942d37d47

Comment by A. Jesse Jiryu Davis [ 26/Apr/18 ]

Eventually mongos, but since our immediate need is to test transactions in replica sets, mongod-only is fine for now.

Comment by Tess Avitabile (Inactive) [ 26/Apr/18 ]

jesse, shane.harvey, do you need this to work on mongos as well, or just mongod?

Comment by A. Jesse Jiryu Davis [ 19/Apr/18 ]

Thanks for doing this so promptly, I think it'll meet our needs.

Comment by Spencer Brody (Inactive) [ 19/Apr/18 ]

mira.carey@mongodb.com FYI this is coming this iteration. Please let me know if you have any concerns about this approach. We will make sure to put someone on platforms on the code review.

Comment by Spencer Brody (Inactive) [ 19/Apr/18 ]

Yep, it has the same modes available as all failpoints, which includes a fixed number of failures.

Comment by A. Jesse Jiryu Davis [ 18/Apr/18 ]

Great. And besides alwaysOn we can also configure an integer number of failures?

Comment by Shane Harvey [ 18/Apr/18 ]

Yes, I believe we can use this API for those tickets.

Comment by Spencer Brody (Inactive) [ 18/Apr/18 ]

jesse shane.harvey, does the API I put in the description match your needs, and eliminate the need for SERVER-34187 and SERVER-34057?

Generated at Thu Feb 08 04:37:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.