MongoDB new secondary replica set node has much smaller data folder (dbPath)

mongodb

I have a 3 node replica set that's been online since mid december. Last Friday (Jan 24), we added a 4th node in our disaster recovery data center.

We used the automatic initial sync procedure as our data set is relatively small. No problems here, after a while it's status switched to secondary and rs.printSlaveReplicationInfo() tells me everyone is in sync with little lag.

A coworker asked me to confirm that the new node was up to date and my instinct was to compare the size of the data folders (dbPath).

The new node's dbPath is ~1.88GB, but the average size for the other nodes is ~3.7GB. Why is the new node's dbPath smaller?

Thanks!

Update:
The real question is, how do I figure out if a new node of the Replica Set is fully synced?

Best Answer

Running rs.printSlaveReplicationInfo() on the Primary is not helping me figure whether the new node contains a full copy of the replica set.

Running rs.printReplicationInfo() is not giving me what I'm looking for either.

The answer lies in db.stats(); by comparing the number of objects and dataSize, of the primary and the new node, the new node is smaller.

However, when comparing the new node with another secondary, the values very closely match! Real question answered! Except for that dbPath size difference.