[SERVER-75091] db.getReplicationInfo() gives invalid output Created: 21/Mar/23  Updated: 03/Apr/23  Resolved: 03/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 6.0.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Wernfried Domscheit Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: replcation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Operating System: ALL
Participants:

 Description   

When you run db.getReplicationInfo() then the output is not valid. Result is like this:

{
  configuredLogSizeMB: 990,
  logSizeMB: 990,
  usedMB: 980.21,
  timeDiff: NaN,
  timeDiffHours: NaN,
  tFirst: 'Invalid Date',
  tLast: 'Invalid Date',
  now: 'Tue Mar 21 2023 16:03:39 GMT+0100 (Mitteleuropäische Normalzeit)'
}
 

timeDiff, timeDiffHours, tFirst, tLast are invalid values.

As workaround one can call rs.status() and compare optimeDate of members. However db.getReplicationInfo() should work as intended.

Kind Regards
Wernfried



 Comments   
Comment by Lingzhi Deng [ 03/Apr/23 ]

The legacy mongo shell has been deprecated in MongoDB v5.0. The replacement is mongosh (Also see here). If this is a bug report for mongosh, can you file a MONGOSH ticket? Thanks.

Generated at Thu Feb 08 06:29:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.