What happens if a 2 node replica set lose its primary?

Hi @jia_shizhen ,

Generally, In case of two node failures in three node replica set, the remaining sole node will assume secondary role and will accommodate only reads, moreover writes will fail.

But the above scenario with 2 nodes is quite intresting, based on the output of your rs.status() comand, the node is running as standalone and we can see the absence of secondary node details in below snippet.

The reason for this is removal of unavailable node from replica set which results it to run as standalone server, of the node was not removed from replica set we will see the other node in unreachable state.