[SERVER-25495] use local times in repl log messages Created: 08/Aug/16  Updated: 17/Mar/20  Resolved: 17/Mar/20

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

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Tess Avitabile (Inactive)
Resolution: Duplicate Votes: 0
Labels: ds-neweng-2016, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-46389 Improve replication log line style Closed
Related
related to SERVER-4587 Be consistent with time zones Backlog
related to SERVER-46389 Improve replication log line style Closed
Operating System: ALL
Sprint: Repl 2020-03-23
Participants:

 Description   

One place in repl calls dateToISOStringUTC() instead of dateToISOStringLocal(); I think it was just an oversight.

LOG(2) << "Scheduling heartbeat to " << target << " at " << dateToISOStringUTC(when);



 Comments   
Comment by Tess Avitabile (Inactive) [ 11/Mar/20 ]

Planning to close this as a duplicate of SERVER-46389.

Comment by Andy Schwerin [ 05/Mar/20 ]

When you convert this message to structured logging, just log the Date_t without any stringification call, and let the logging subsystem handle it.

Comment by Judah Schvimer [ 06/Jan/20 ]

This code still exists. This could be an easy change to something that may confuse users.

Comment by Andy Schwerin [ 25/Aug/16 ]

When a Date_t represents a date before the epoch, Date_t::toString() writes out Date(<a negative integer number of milliseconds>), while dateToISOStringLocal looks like it depends on the behavior of libc on the system in question.

Comment by Eric Milkie [ 25/Aug/16 ]

That is my sentiment as well.
How does the default Date_t::toString output compare with dateToISOStringLocal output?

Comment by Andy Schwerin [ 25/Aug/16 ]

milkie, when logging I think we pretty much always should just stream the Date_t object into the log, and let its own toString() implementation sort it out. That is, there should be no calls to dateToISOStringUTC or dateToISOStringLocal in logs. It looks like repl is the only code that needs changing, in any event.

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