[SERVER-75277] TTL deleter attributes resource metrics across multiple databases Created: 24/Mar/23 Updated: 01/Feb/24 Resolved: 28/Mar/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 6.2.1 |
| Fix Version/s: | 7.0.0-rc0, 6.3.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Eric Milkie | Assignee: | Louis Williams |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v6.3
|
||||||||||||||||
| Steps To Reproduce: | You can see the issue if you add one invariant to ScopedMetricsCollector constructor, like this:
The TTL deleter will crash on that invariant if you have multiple collections with TTL indexes that it needs to pass over. |
||||||||||||||||
| Sprint: | Execution Team 2023-04-03 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||
| Description |
|
The ResourceConsumption::ScopedMetricsCollector constructor tells the MetricsCollector attached to the current OperationContext to begin recording metrics. The ScopedMetricsCollector destructor then tells the MetricsCollector to stop recording metrics and merges the MetricsCollector's metrics into the global map, keyed on database name. |
| Comments |
| Comment by Githook User [ 14/Apr/23 ] | ||||||||||
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: (cherry picked from commit 8e744478f8569c1ead0ffe7b725c89983c886ac6) | ||||||||||
| Comment by Haley Connelly [ 11/Apr/23 ] | ||||||||||
|
I wonder if we could keep a scoped "state" struct for the MetricsCollector to ensure next time we add a new field to the scoped state, it gets reset and cleared accordingly. | ||||||||||
| Comment by Githook User [ 28/Mar/23 ] | ||||||||||
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: | ||||||||||
| Comment by Eric Milkie [ 24/Mar/23 ] | ||||||||||
|
I also recommend adding the following debug log to merge():
|