0

Since in my country the time was changeg to one hour "ahead". My replica set is doing something I can't understand. This is a 4.2 version and P-S-S replica set.

The Primary oplog is registering actions with the wrong time, it would register 8:00 for an action done at 9:00.

The OS time is properly set ande when I checked the time in mongo shell i got the following:

set1:PRIMARY> Date()
Mon Nov 08 2021 09:29:57 GMT+0100 (CET)
set1:PRIMARY> ISODate()
ISODate("2021-11-08T08:30:11.674Z")

Where is Mongo taking the ISODate value? Is it possible to change it?

Kakumei
  • 3
  • 1

1 Answers1

1

Your database is always using UTC timestamps, because UTC don't follow light saving time, a.k.a. summertime.

That will prevent problems when world around changes from wintertime to summertime, and back (in different dates, in different countries).

JJussi
  • 1,540
  • 12
  • 12
  • I didn't know that, thanks. I just find weird that oplog is recording actions an hour behind the real time but as long as it won't cause problems I'm cool with it – Kakumei Nov 09 '21 at 08:06
  • What you think would happen if suddenly oplog would have entries what timestamp is hour before previous timestamp? (when country changes from summer to winter)... – JJussi Nov 10 '21 at 13:35
  • Yeah, you are right, It makes total sense. Thanks for your answer! – Kakumei Nov 15 '21 at 10:46
  • ...you should mark the answer "right" then... ;-) – JJussi Nov 18 '21 at 08:12