[SERVER-9085] db.replSetInfo() issue with converting OpTimes to seconds Created: 22/Mar/13  Updated: 11/Jul/16  Resolved: 28/Mar/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.4.0
Fix Version/s: 2.4.2, 2.5.0

Type: Bug Priority: Critical - P2
Reporter: Luciano Issoe Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ubuntu 12.04 LTS + mongodb 2.4 upgraded from 2.2.2


Issue Links:
Duplicate
is duplicated by SERVER-9348 printReplicationInfo doesn't agree wi... Closed
is duplicated by SERVER-9317 db.printReplicationInfo() output has ... Closed
is duplicated by SERVER-9119 An issue with oplog and a slave in Mo... Closed
Operating System: ALL
Steps To Reproduce:

upgrade mongodb using apt-get and 10gen repositories.

use db.printReplicationInfo()...

Participants:

 Description   

When runnign db.printReplicationInfo() from the mongo shel, it returns unreal dates:

MongoDB shell version: 2.4.0
connecting to: admin
rs3:SECONDARY> db.printReplicationInfo()
configured oplog size: 150000MB
log length start to end: 431.84499999997206secs (0.12hrs)
oplog first event time: Fri Jan 16 1970 18:45:42 GMT+0000 (UTC)
oplog last event time: Fri Jan 16 1970 18:52:54 GMT+0000 (UTC)
now: Fri Mar 22 2013 17:49:06 GMT+0000 (UTC)

When connecting from a 2.2 client shell, it returns the correct dates:
MongoDB shell version: 2.2.2
connecting to: rs1-***.***.com/admin
rs3:SECONDARY> db.printReplicationInfo()
configured oplog size: 150000MB
log length start to end: 431751secs (119.93hrs)
oplog first event time: Sun Mar 17 2013 17:50:30 GMT+0000 (UTC)
oplog last event time: Fri Mar 22 2013 17:46:21 GMT+0000 (UTC)
now: Fri Mar 22 2013 17:48:32 GMT+0000 (UTC)



 Comments   
Comment by auto [ 28/Mar/13 ]

Author:

{u'date': u'2013-03-25T14:22:49Z', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-9085 fix units in tsToSeconds calculation
Branch: v2.4
https://github.com/mongodb/mongo/commit/4f26c3137e67ba98b4160c40d95c053b5905a9fe

Comment by auto [ 25/Mar/13 ]

Author:

{u'date': u'2013-03-25T14:22:49Z', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-9085 fix units in tsToSeconds calculation
Branch: master
https://github.com/mongodb/mongo/commit/5bc11809e0fe058b83defe1106a90e452caddf93

Comment by Eric Milkie [ 25/Mar/13 ]

DB.tsToSeconds() calculation is incorrect; it should no longer be dividing by 1000, since the format of the t field is already in seconds.

Generated at Thu Feb 08 03:19:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.