arbiter bring down the three node mongodb replica set I have a typical 3 node mongodb replica set. One primary, one secondary and one arbiter. I thought the replica set would survive one node offline but it didn't. Please help me understand what went wrong.

Here is what I observed. Are they supposed to work like this? 


When I take the arbiter offline (killing the instance), both two data nodes become secondary (they were primary and secondary).
When I take the primary offline (killing the instance), the secondary and arbiter remains secondary and  arbiter. There is no voting to select the new primary.


Thanks!

Here is the config

{
  "_id": "0",
  "version": 8,
  "protocolVersion": NumberLong(1),
  "writeConcernMajorityJournalDefault": true,
  "members": [
    {
      "_id": 3,
      "host": ":27017",
      "arbiterOnly": true,
      "buildIndexes": true,
      "hidden": false,
      "priority": 0,
      "tags": {

      },
      "slaveDelay": NumberLong(0),
      "votes": 1
    },
    {
      "_id": 4,
      "host": ":27017",
      "arbiterOnly": false,
      "buildIndexes": true,
      "hidden": false,
      "priority": 0,
      "tags": {

      },
      "slaveDelay": NumberLong(0),
      "votes": 0
    },
    {
      "_id": 5,
      "host": ":27017",
      "arbiterOnly": false,
      "buildIndexes": true,
      "hidden": false,
      "priority": 3,
      "tags": {

      },
      "slaveDelay": NumberLong(0),
      "votes": 1
    }
  ],
  "settings": {
    "chainingAllowed": true,
    "heartbeatIntervalMillis": 2000,
    "heartbeatTimeoutSecs": 10,
    "electionTimeoutMillis": 10000,
    "catchUpTimeoutMillis": 60000,
    "catchUpTakeoverDelayMillis": 30000,
    "getLastErrorModes": {

    },
    "getLastErrorDefaults": {
      "w": 1,
      "wtimeout": 0
    },
    "replicaSetId": ObjectId("")
  }
}
When I take the arbiter offline (killing the instance), both two data
  nodes become secondary (they were primary and secondary).


In this case, when the arbiter(_id = 3) goes down, The member with _id equals to 4 has Priority and votes as 0, so it cannot become primary and cannot vote in the election and the Majority(2 votes) cannot be established. So both the nodes becomes secondary.


  When I take the primary offline (killing the instance), the secondary
  and arbiter remain secondary and arbiter. There is no voting to select
  the new primary.


In this case, when the Primary(_id = 5) goes down, The member with _id equals to 4 has Priority, so it cannot become primary. Because of this the secondary
and arbiter remains as secondary and arbiter.

How to design this replica set to work better?

Make the Priority and votes of the node(_id = 4) to 1, it will fix both the scenarios.