[MXS-1202] maxadmin "show service" counters overflow Created: 2017-03-27  Updated: 2017-04-04  Resolved: 2017-04-04

Status: Closed
Project: MariaDB MaxScale
Component/s: maxadmin
Affects Version/s: 2.0.4
Fix Version/s: 2.1.3

Type: Bug Priority: Major
Reporter: Jakub Kuchta Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: maxadmin, maxscale
Environment:

CentOS 7 x64 virtual machine @ XenServer, 4vCPU, 8GB RAM


Sprint: 2017-31

 Description   

We have a fairly large-ish instance of MaxScale. At March 10, we had the following counts after running the instance for 16 hours forwarding all SQL traffic from a very large message board to three MariaDB MySQL nodes:

MaxScale> show services
[...]
 Number of queries forwarded:            152065870
        Number of queries forwarded to master:  7151735 (4.70%)
        Number of queries forwarded to slave:   144914137 (95.30%)
        Number of queries forwarded to all:     25297037 (16.64%)
 Started:                             Wed Mar  8 10:39:04 2017

Looking at the counters today, the values are negative:

MaxScale> show services
Service 0x16d6780
        Service:                             split-rw-service
        Router:                              readwritesplit (0x7f34aa8232c0)
        State:                               Started
        Number of router sessions:              270472727
        Current no. of router sessions:         105
        Number of queries forwarded:            -1842543097
        Number of queries forwarded to master:  117348154 (0.00%)
        Number of queries forwarded to slave:   -1959884562 (0.00%)
        Number of queries forwarded to all:     422237746 (0.00%)
        Started:                             Wed Mar  8 10:39:04 2017

The value of "queries forwarded to slave" is changing and goes towards zero. it seems some sort of an integer overflow happened. Is it possible to get it fixed?



 Comments   
Comment by Dipti Joshi (Inactive) [ 2017-03-27 ]

How long have you been using MaxScale ? Do you see this just in 2.0.4 or have also seen in past releases of MaxScale. Also there is a 2.0.5 version out.

Comment by Jakub Kuchta [ 2017-03-27 ]

Well, we've been using it in production since March 8th, no restarts were made since the initial start.
We haven't been using the previous releases.
https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale-205-release-notes-2017-03-10/
I don't really see any bugfixes that could (in my opinion) affect the issue of overflowing counters, but I'll try updating it tommorow to 2.0.5.

Comment by markus makela [ 2017-03-27 ]

I can confirm that the statistics use signed values which causes the numbers to overflow into negative values.

Comment by Jakub Kuchta [ 2017-03-28 ]

Won't making the variable unsigned just raise the maximum value twice? Isn't it possible to use a larger data structure for it? Otherwise it'll just overflow and roll over to zero after 6 weeks instead of 3 in our environment.

Comment by Johan Wikman [ 2017-03-29 ]

Currently the counter is a 32 bit integer. We'll increase it to 64 bit, which will make it take a while longer before that rolls over.

Generated at Thu Feb 08 04:04:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.