[SERVER-79908] Cause of initial sync should be logged by default Created: 10/Aug/23  Updated: 29/Oct/23  Resolved: 18/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Matt Kneiser Assignee: Xuerui Fa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Sprint: Repl 2023-08-21, Repl 2023-09-04, Repl 2023-09-18, Repl 2023-10-02
Participants:

 Description   

From my investigation in HELP-47199, I observed that the server logs the decision to initial sync or not, but not why.

A user needs to enable debug-level replication logs to get a hint at one of the two reasons.

It should be straightforward to include more useful info by default. Since this behavior is triggered once on boot, it shouldn't meaningfully add bloat to overall server logging and can help diagnose initial sync issues quicker.

The simplest solution is to add logging of lastOpTime and isInitialSyncFlagSet to the "Initial sync required" log line. There might be some other diagnostics in this general area that would be helpful too.



 Comments   
Comment by Githook User [ 18/Sep/23 ]

Author:

{'name': 'XueruiFa', 'email': 'xuerui.fa@mongodb.com', 'username': 'XueruiFa'}

Message: SERVER-79908: Log cause of initial sync by default
Branch: master
https://github.com/mongodb/mongo/commit/70727c5c270df6b31716b4644b05524d915664db

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