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

failCommand fail point does not work for ismaster

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • ALL
    • Service Arch 2019-12-16, Service Arch 2019-12-30

      If I set the fail point on isMaster, it works:

      ruby-driver-rs:SECONDARY> db.adminCommand({configureFailPoint:'failCommand',data:{failCommands:['isMaster'],closeConnection:true},mode:{times:1}})
      {
      	"ok" : 1,
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1572910119, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	},
      	"operationTime" : Timestamp(1572910119, 1)
      }
      ruby-driver-rs:SECONDARY> db.runCommand({isMaster:1})
      2019-11-04T18:28:51.464-0500 E QUERY    [thread1] Error: error doing query: failed: network error while attempting to run command 'isMaster' on host '127.0.0.1:14420'  :
      DB.prototype.runCommand@src/mongo/shell/db.js:168:1
      @(shell):1:1
      2019-11-04T18:28:51.465-0500 I NETWORK  [thread1] trying reconnect to 127.0.0.1:14420 (127.0.0.1) failed
      2019-11-04T18:28:51.466-0500 I NETWORK  [thread1] reconnect 127.0.0.1:14420 (127.0.0.1) ok
      

      If I set the same fail point on ismaster, it does not work:

      ruby-driver-rs:SECONDARY> db.adminCommand({configureFailPoint:'failCommand',data:{failCommands:['ismaster'],closeConnection:true},mode:{times:1}})
      {
      	"ok" : 1,
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1572910209, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	},
      	"operationTime" : Timestamp(1572910209, 1)
      }
      ruby-driver-rs:SECONDARY> db.runCommand({ismaster:1})
      {
      	"hosts" : [
      		"localhost:14420",
      		"localhost:14421",
      		"localhost:14422"
      	],
      	"setName" : "ruby-driver-rs",
      	"setVersion" : 19,
      	"ismaster" : false,
      	"secondary" : true,
      	"primary" : "localhost:14421",
      	"me" : "localhost:14420",
      	"lastWrite" : {
      		"opTime" : {
      			"ts" : Timestamp(1572910209, 1),
      			"t" : NumberLong(8)
      		},
      		"lastWriteDate" : ISODate("2019-11-04T23:30:09Z"),
      		"majorityOpTime" : {
      			"ts" : Timestamp(1572910209, 1),
      			"t" : NumberLong(8)
      		},
      		"majorityWriteDate" : ISODate("2019-11-04T23:30:09Z")
      	},
      	"maxBsonObjectSize" : 16777216,
      	"maxMessageSizeBytes" : 48000000,
      	"maxWriteBatchSize" : 100000,
      	"localTime" : ISODate("2019-11-04T23:30:19.453Z"),
      	"logicalSessionTimeoutMinutes" : 30,
      	"connectionId" : 6745,
      	"minWireVersion" : 0,
      	"maxWireVersion" : 8,
      	"readOnly" : false,
      	"ok" : 1,
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1572910209, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	},
      	"operationTime" : Timestamp(1572910209, 1)
      }
      ruby-driver-rs:SECONDARY> 
      

      Since "ismaster: 1" is a recognized command, I expect a fail point set on "ismaster" to affect "ismaster: 1" command.

      Although I personally strive to use consistent case, it will probably be better user experience if fail point on isMaster triggered on ismaster and vice versa.

      2019-09-13T16:46:56.464-0400 I CONTROL [initandlisten] ** NOTE: This is a development version (4.3.0-574-g6e02a4d) of MongoDB.

            Assignee:
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: