[SERVER-14364] OpCounters values should be stored/exported as 64-bit integers Created: 26/Jun/14 Updated: 06/Apr/21 Resolved: 30/Oct/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.5 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | J Rassi | Assignee: | Jacob Evans |
| Resolution: | Done | Votes: | 4 |
| Labels: | SWDI, community-team, neweng, storch | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v4.0, v3.6
|
||||||||||||||||||||||||||||||||||||
| Sprint: | Integration F (02/01/16), Integration 10 (02/22/16), Query 2018-10-22, Query 2018-11-05 | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||
| Description |
|
The counter values in the OpCounters class have type AtomicUInt32, and are exported in ServerStatus as 32-bit integers. The max value for this type is too small, and as such the class contains unnecessary overflow detection logic. The counter values should be changed to have type AtomicUInt64. |
| Comments |
| Comment by Githook User [ 30/Oct/18 ] |
|
Author: {'name': 'Jacob Evans', 'email': 'jacob.evans@10gen.com'}Message: |
| Comment by Kyle Suarez [ 01/Mar/16 ] |
|
BSON cannot handle unsigned 64-bit integers, so I'm inclined to change the counters to a (signed) AtomicInt64. |
| Comment by Bruce Lucas (Inactive) [ 08/Dec/15 ] |
|
Note by the way that this also causes tooling (such as timeseries) to compute an incorrect value for averages (e.g. average insert rate) if it crosses a wrap point, producing misleading numbers. (Yes a workaround can be added to detect wrap points and not compute averages that cross them). |
| Comment by Bruce Lucas (Inactive) [ 02/Nov/15 ] |
|
This means that these counters wrap relatively frequently - in less than an hour at heavy load - making it difficult (if you have a complete timeseries at intervals shorter than the wrap time) or impossible (if you have only a single serverStatus) to get averages over periods longer than that. There are diagnostic situations where it would be useful to answer questions like "has the mongod instance seen a large number of deletes since it was started", and 64-bit counters would allow us to answer those questions. |
| Comment by Matt Kangas [ 07/Aug/14 ] |
|
If we do this, we should still wrap at 2 53 if we wish to keep counters as exact integral values in the shell. |