Chapter 2 - Lecture - Reads and writes on a Replica Set

I am confused from videos as to which node is PRIMARY…

Video - 2min and 32 seconds: - Node 27012 shutdown using command db.shutdownServer()

Video - 2min and 32 seconds: - Connection command specifies port 27011 BUT connection is to 27013 which is then prompting as PRIMARY [but PRIMARY was 27011] - my assumption here is that the db.shutdownServer() of 27012 forced a ‘vote’ and 27013 took over from 27011 as primary

Video - 2min and 38 seconds: - Screen shows PRIMARY [27013] synching to 27011 [which implies 27011 is now a SECONDARY]

Video - 2min and 39 seconds: - Command db.shutdownServer() is NOT shown in video BUT was a command I was expecting to be seen

Video - 2min and 59 seconds: - I think node 27011 stepped down to become SECONDARY when node 27012 was shutdown [2min 28s] AND node 27013 then became PRIMARY

Video - 3min and 25 seconds: - Narrator details that 27011 is a SECONDARY but also implies that 27013 is a SECONDARY BUT from video at 2min 38s node 27013 IS the primary. Narrator then goes on to detail that we do not have any PRIMARY but from above I think 27013 is the PRIMARY

Please review/confirm order in which nodes shutdown and how we have ONLY SECONDARYs left at end

In the lecture, it says “If the replica set can no longer reach a majority of the nodes, all the remaining nodes in the set become secondaries.”. In this lecture’s case the replica set has only 3 nodes, one primary node, and 2 secondary nodes, when shut down 2 secondary nodes, the replica set just cannot function as a healthy one because it can no longer reach its majority of the nodes, so the primary node “strike” turn himself as secondary, and the replica set stop working.

1 Like

Then why does the connection prompt detail connection to PRIMARY [27013]?