[SERVER-81506] configureFailPoint failCommand closeConnection:true may override times:0 mode Created: 27/Sep/23  Updated: 03/Oct/23  Resolved: 03/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Jeremy Mikola Assignee: Backlog - Service Architecture
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Service Arch
Operating System: ALL
Participants:

 Description   

While investigating CLOUDP-202309, I observed that configureFailPoint seems to ignore times: 0 when closeConnection: true is specified in the data field for the failCommand fail point.

db = db.getSiblingDB('test');
db.test.drop();
db.createCollection('test', { writeConcern: { w: 'majority' }});
 
db.adminCommand({
    configureFailPoint: 'failCommand',
    mode: { times: 0 },
    data: {
        failCommands: ['insert'],
        closeConnection: true,
    }
});
 
coll = db.test;
 
try {
    coll.insertOne({ _id: 1 }, );
} catch (e) {
    print(e);
}
 
print(coll.findOne());

With closeConnection: true omitted, the fail point is never triggered and the document is successfully inserted. This seems incorrect, as I would expect the top-level mode parameter to take priority over any fail point-specific options under data.

I ran this script using a local 7.0 replica set with retryable writes disabled (lest the insert succeed on a retry attempt):

mongosh mongodb://127.0.0.1:27070/?retryWrites=false script.js



 Comments   
Comment by Jason Chan [ 03/Oct/23 ]

Closing as Won't Fix because we don't think times: 0 is a use case that we expect to have much value. Please re-open if there are disagreements.

Comment by Jeremy Mikola [ 27/Sep/23 ]

I'm lowering the priority of this issue as it does not impact drivers (none of our spec tests utilize times: 0).

Generated at Thu Feb 08 06:46:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.