I have two MongoDB instances running on two servers (instance1 and instance2) and they are configured as a replica set. Instance1 is the primary and instance2 is the secondary.
When instance1 was shut down, instance2 became the primary. However, they both had priority value set to 1. Therefore when instance1 was up again, instance2 kept being the primary node.
I changed the priority value of instance1=2 and instance2=1. If instance1 is shut down again, instance2 will become the primary. When instance1 is up again, will this new priority setting make sure that instance1 becomes the primary again?