1 / 1
Mar 2024

Hi,
I have mutiple clusters running version 3.4 to version 6.
Currenlty we are observing replication lag. the lag stays between 1-2 seconds.
My question is. Is it normal for mongodb to have lag between 1-2 seconds. As we expect the lag to stay under 400ms.
The second issue we are facing is on mongodb 6 we are checking the replication lag using coommand rs.printSecondaryReplicationInfo(). But for the same replicaset and the same primary server. we are getting two different values.
this the the result when i use mongo shell 5.0 for same server

rs_mongodb:PRIMARY> rs.printSecondaryReplicationInfo() source: 10.50.31.187:27017 syncedTo: Mon Mar 25 2024 20:47:51 GMT+0000 (UTC) 2 secs (0 hrs) behind the primary source: 10.50.30.132:27017 syncedTo: Mon Mar 25 2024 20:47:52 GMT+0000 (UTC) 1 secs (0 hrs) behind the primary

this the the result when i use Mongosh: 2.2.1 for same server

rs_mongodb[direct: primary] test> rs.printSecondaryReplicationInfo() source: 10.50.31.187:27017 { syncedTo: 'Mon Mar 25 2024 20:47:49 GMT+0000 (Coordinated Universal Time)', replLag: '-1 secs (0 hrs) behind the primary ' } --- source: 10.50.30.132:27017 { syncedTo: 'Mon Mar 25 2024 20:47:48 GMT+0000 (Coordinated Universal Time)', replLag: '-2 secs (0 hrs) behind the primary ' }

why is it showing different result in different shells. and what does negative means?
Thanks