[SERVER-70111] ShardingDataTransform Metrics Interface Does Not Indicate Returned Time Value May Be Invalid Created: 29/Sep/22 Updated: 05/Jul/23 Resolved: 05/Jul/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Brett Nawrocki | Assignee: | [DO NOT USE] Backlog - Sharding NYC |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | new-eng, sharding-nyc-subteam1 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Sharding NYC
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
ShardingDataTransformMetrics uses atomic values to store start and end times for various phases. Since AtomicWord does not support boost::optional, a special value is used to indicate a date is not yet set. The interface for accessing this date, however, makes no indication that the returned value may be invalid and instead returns it directly. This is confusing for callers, who may use the value expecting that it always represents a valid time. The following functions should be updated to clearly indicate when their values are invalid (e.g. by returning boost::none when they are set to kNoDate):
Callers of these functions should also be updated to properly consider and handle invalid values. |
| Comments |
| Comment by Brett Nawrocki [ 05/Jul/23 ] |
|
This ended up getting fixed by the implementation of WithPhaseDurationManagement. |
| Comment by Rachita Dhawan [ 21/Nov/22 ] |
|
The functions mentioned here will likely be deleted when the linked ticket(70115) is fixed |