[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: |
|
||||||||||||||||
| 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 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: (cherry picked from commit 020703354ed815471613c8ae70fbf71c83f3bd1e) |
| Comment by Githook User [ 02/Dec/20 ] |
|
Author: {'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}Message: |
| 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. |