[SERVER-53017] replSetGetStatus remainingInitialSyncEstimatedMillis always 0 Created: 22/Nov/20  Updated: 29/Oct/23  Resolved: 02/Dec/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0, 4.4.3

Type: Bug Priority: Major - P3
Reporter: Alex Bevilacqua Assignee: Jason Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-70686 remainingInitialSyncEstimatedMillis p... Closed
is related to SERVER-47863 Initial Sync Progress Metrics Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Repl 2020-12-14
Participants:

 Description   

This is related to the new metrics in SERVER-47863.

After calling db.adminCommand({ replSetGetStatus: 1, initialSync: 1 }).initialSyncStatus.remainingInitialSyncEstimatedMillis, sometimes this will return a value before data starts copying, but once data begins to copy the value is always 0.

Tested on mongod-4.9.0-alpha-596-g4437864



 Comments   
Comment by Githook User [ 04/Dec/20 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-53017 Make sure download rate is calculated as a double when calculating remainingInitialSyncEstimatedMillis

(cherry picked from commit 020703354ed815471613c8ae70fbf71c83f3bd1e)
Branch: v4.4
https://github.com/mongodb/mongo/commit/2508a2d18cb3c6ed85a29437a294f467f49216a0

Comment by Githook User [ 02/Dec/20 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-53017 Make sure download rate is calculated as a double when calculating remainingInitialSyncEstimatedMillis
Branch: master
https://github.com/mongodb/mongo/commit/020703354ed815471613c8ae70fbf71c83f3bd1e

Comment by Jason Chan [ 30/Nov/20 ]

Took a deeper look into this and I think I figured out the problem. We calculate remainingInitialSyncEstimatedMillis with the following operation: (totalInitialSyncElapsedMillis / approxTotalBytesCopied) * (approxTotalDataSize - approxTotalBytesCopied). We are calculating the product of (totalInitialSyncElapsedMillis / approxTotalBytesCopied) as a non-decimal type, this will return 0 when approxTotalBytesCopied is sufficiently large. We should instead calculate this step using a double so the mid-result does not round down to 0.

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