[MDEV-26277] Suspiciously high server status variable values Created: 2021-07-29 Updated: 2022-06-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Louka Dlagnekov (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
We've discovered that a few server status variables, like Ssl_ctx_verify_depth, sometimes have values that are the maximum an unsigned 64-bit integer can hold, even when those counts are not expected to get very high. For instance,
All three have values that are 2**64 - 1. Could the variables not be initialized correctly? |
| Comments |
| Comment by Daniel Black [ 2021-07-29 ] |
|
Ssl_ctx_verify_depth returns the value of the ssl library using the SSL_get_verify_depth https://www.openssl.org/docs/manmaster/man3/SSL_get_verify_depth.html where -1 is wrapped to the maximum. It does however mean the SSL default depth. It won't reach that high as you won't place an arbitrarily length CA chain on the server. The wsrep values look like an arbitrary number, however once you enable galera these will have much saner looking values. |
| Comment by Louka Dlagnekov (Inactive) [ 2021-08-04 ] |
|
Thanks so much for the info, Daniel. That makes perfect sense. |
| Comment by Louka Dlagnekov (Inactive) [ 2021-08-06 ] |
|
Sorry, reopening this, because we are sometimes seeing strange values for other variables, like Innodb_os_log_pending_writes. Sometimes the value is 0, other times it is 18446744073709552000. For an unsigned 64-bit integer, that's -384. What could explain that? |
| Comment by Marko Mäkelä [ 2022-06-15 ] |
|
The status variable Innodb_os_log_pending_writes was removed in |
| Comment by Marko Mäkelä [ 2022-06-15 ] |
|
A possible explanation for the wrap-around of InnoDB_os_log_pending_writes could be that srv_stats.os_log_pending_writes is essentially declared as size_t, not std::atomic<size_t>. So, race conditions between increment and decrement operations are possible. Theoretically, we could ‘fix’ this by always reporting the status variable as 0 in releases older than 10.8, but then someone could be upset about it. I think that using proper std::atomic declaration is out of the question, because it would very likely introduce performance degradation. |