Need help with these replicaSet cluster logs

Hello Everyone,

Could someone explain these logs? I see these logs every sec.

2023-06-16T11:44:28.459+05:30  INFO 68004 --- [primary-1:27017] org.mongodb.driver.cluster               : Rediscovering type of existing primary mongo-stack-secondary-1:27017
2023-06-16T11:44:28.459+05:30  INFO 68004 --- [primary-1:27017] org.mongodb.driver.cluster               : Discovered replica set primary mongo-stack-primary-1:27017 with max election id 7fffffff0000000000000060 and max set version 2
2023-06-16T11:44:38.068+05:30  INFO 68004 --- [arbitar-1:27017] org.mongodb.driver.cluster               : Rediscovering type of existing primary mongo-stack-primary-1:27017
2023-06-16T11:44:38.069+05:30  INFO 68004 --- [arbitar-1:27017] org.mongodb.driver.cluster               : Discovered replica set primary mongo-stack-arbitar-1:27017 with max election id 7fffffff0000000000000060 and max set version 2
2023-06-16T11:44:38.069+05:30  INFO 68004 --- [condary-1:27017] org.mongodb.driver.cluster               : Rediscovering type of existing primary mongo-stack-arbitar-1:27017
2023-06-16T11:44:38.069+05:30  INFO 68004 --- [condary-1:27017] org.mongodb.driver.cluster               : Discovered replica set primary mongo-stack-secondary-1:27017 with max election id 7fffffff0000000000000060 and max set version 2

Hello @Raghu_Kiran_Koduri

I believe those are informational messages showing the monitoring logs for replica set. Please refer below links for more information

As per the logs shared, it seems like these logs are generated after 10 seconds, is something a miss here?
Are you facing any issues?

Regards,
Tarun

Thanks for the reply @Tarun_Gaur If these logs are expected, I think these logs statements should be at debug level as they are occurring every 10 secs. Or, since these logs are occurring very frequently is there anything which I need to worry about my replica set configuration or my cluster setup.

The below logs are from arbitar. “Discovered replica set primary mongo-stack-arbitar-1” how come arbitar become primary.

Rediscovering type of existing primary mongo-stack-primary-1:27017
2023-06-16T11:44:38.069+05:30  INFO 68004 --- [arbitar-1:27017] org.mongodb.driver.cluster               : Discovered replica set primary mongo-stack-arbitar-1:27017 with max election id 7fffffff0000000000000060 and max set version 2

From the logs I am under an impression that primary node thinks the primary is “mongo-stack-primary-1” and arbitar node thinks the primary is " mongo-stack-arbitar-1" and secondary node thinks the primary is “mongo-stack-secondary-1” all having the same election id “7fffffff0000000000000060”

As long as you don’t face any issues with your cluster or see any error in the logs, you should not worry as these messages are informational and in case something happens, these informational logs could help in determining the root case of the issue.

I think these logs are from Java driver, so you can check if there are any setting that might work for you.

Are you sure you are using PSA and not PSS as arbiter node cannot become primary, can you please share output of rs.status() and rs.conf()?