Write Concern Question

If you setup up write concern for “majority” how do you know which secondary got the write and which one didn’t, if the primary went down. If a secondary was promoted to primary and didn’t get the write - won’t you get a lost of data?

Do I check the rs.oplogs on each of the secondary?

Hi @hwong,

In this case, the most recently updated secondary nodes will participate in election to become primary.
After the primary is elected, all the secondaries will sync their oplogs with the newly elected primary node.

Please refer to the following doc to get more detail about the election:

Please let me know, if you have any questions.


Thank you for the documentation.