[SERVER-70941] make SystemTickSource monotonic everywhere Created: 28/Oct/22 Updated: 29/Oct/23 Resolved: 31/Oct/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| 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 | ||||
| Sprint: | Service Arch 2022-11-14 | ||||
| Participants: | |||||
| Linked BF Score: | 160 | ||||
| Description |
|
ONLY on macOS it is not monotonic, and this has caused BFs and unpleasant surprises. https://jira.mongodb.org/browse/BF-26765 https://jira.mongodb.org/browse/SERVER-63651 This isn't hard to fix, and it's very hard to work around it. We need the consistent ability to measure small durations to implement fine-grained observability of latencies in the server (PM-2398, INIT-6). |
| Comments |
| Comment by Githook User [ 31/Oct/22 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: |
| Comment by Billy Donahue [ 29/Oct/22 ] |
|
stdlib implementations: std::chrono::steady_clock from libc++ on macOS: https://github.com/llvm/llvm-project/blob/eb536613a28b3070081900957553beb783448053/libcxx/src/chrono.cpp#L223-L233 After reviewing these, we can be pretty confident that the std::chrono::steady_clock is going to do basically the same thing we would have done by hand, on Linux, macOS, and Win32. We should just use it. It's going to do a better job than we would, and be maintained for free. macOS: libc++ Win32: libc++ Linux: These all throw std::system_error if the clock call fails. This is better than the fasserts etc we do. |