[MXS-1618] Maxadmin Binary Hangs on a Big endian Platform Created: 2018-01-18  Updated: 2018-04-24  Resolved: 2018-04-24

Status: Closed
Project: MariaDB MaxScale
Component/s: maxadmin
Affects Version/s: 2.2
Fix Version/s: 2.1.17, 2.2.5

Type: Bug Priority: Major
Reporter: Chandranana Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ub 16.04 , arch=s390x



 Description   

Hi ,

I have reached this forum as i face issues using maxadmin on ub 16.04 , s390x platform.
I am pasting below configuration of maxscale for your reference so that you can point me out if i am doing anythg wrong in the config

I have build maxscale v2.2 and able to start maxscale server and also get it connected to a master MariaDB DB, i can also use clients to pass queries in and out via maxscale
The only issue that i get is using maxadmin which simple hangs even when i invoke it like below
maxadmin -h 127.0.0.1 ( some help on this would be very helpful)

contents of maxscale.cnf
[maxscale]
threads=1

[server1]
type=server
address=<some IP>
port=3306
protocol=MySQLBackend

[server2]
type=server
address=<some IP>
port=3306
protocol=MySQLBackend

[MySQL Monitor]
type=monitor
module=mysqlmon
servers=server1,server2
user=maxuser
passwd=maxpwd
monitor_interval=10000

[Read-Only Service]
type=service
router=readconnroute
servers=server1,server2
user=maxuser
passwd=maxpwd
router_options=slave

[Read-Write Service]
type=service
router=readwritesplit
servers=server1,server2
user=maxuser
passwd=maxpwd
max_slave_connections=100%

[MaxAdmin Service]
type=service
router=cli

[Read-Only Listener]
type=listener
service=Read-Only Service
protocol=MySQLClient
port=4008

[Read-Write Listener]
type=listener
service=Read-Write Service
protocol=MySQLClient
port=4006

[MaxAdmin Listener]
type=listener
service=MaxAdmin Service
protocol=maxscaled
address=localhost
port=6603



 Comments   
Comment by Johan Wikman [ 2018-01-18 ]

Downgraded to major as it is not one of our officially supported platforms. We are of course interested in getting MaxScale to run on that as well.

Please add

log_info=1

to your configuration file and restart MaxScale. Is anything logged when you attempt to connect with maxadmin?

log_debug=1

will cause even more to be logged.

Comment by Chandranana [ 2018-01-18 ]

Tried adding both the parameters as mentioned above still no logs related to maxadmin could be seen except for below which is logged when we start maxscale : Listening for connections at [localhost]:6603 with protocol MaxScale Admin

Comment by Johan Wikman [ 2018-01-18 ]

Have you tried using a Unix domain socket instead?
https://github.com/mariadb-corporation/MaxScale/blob/2.2/Documentation/Reference/MaxAdmin.md#configuring-mariadb-maxscale-for-maxadmin

Note that in that case you initially have to be root when using maxscale. Once you have been able to connect you can enable other users as explained here:
https://github.com/mariadb-corporation/MaxScale/blob/2.2/Documentation/Reference/MaxAdmin.md#enabling-a-linux-account

Comment by Johan Wikman [ 2018-01-18 ]

And you could also try with

[MaxAdmin Listener]
type=listener
service=MaxAdmin Service
protocol=maxscaled
address=0.0.0.0
port=6603

Comment by Chandranana [ 2018-01-18 ]

Yes - with Unix domain socket also it did not work - same issue as before.
We could not get MaxScale command interface(which is seen once maxadmin starts), so could not try enabling other user for maxadmin.

Changing address=0.0.0.0 - same issue is seen.

Comment by Chandranana [ 2018-01-19 ]

Any update on this? It will be helpful for us to proceed if we get some pointers on this.

Comment by Chandranana [ 2018-01-29 ]

Please provide further help on this, as its blocking our Maxscale use case verification.

Comment by Chandranana [ 2018-01-30 ]

Any pointers on this?

Comment by Chandranana [ 2018-02-06 ]

Hi team,

Please let us know what more we can try from our side to get maxadmin work.

Comment by A. Gokhan YAVUZ [ 2018-04-23 ]

Hi to all,

I have faced the same issue. Aftersome debugging I was able to figure out the cause. This issue is actually related to parsing the command line arguments and the problem is also applicable to the maxbinlogcheck binary. Both maxadmin and maxbinlogcheck use getopt_long to parse the command line argumets, but unfortunately the return value is stored in the variable 'c' defined as char, which causes an infinite while loop when parsing the options. According to GNU documentation the return type of getopt_long should be int. I havent investigated the problem further but during assignment of int into a char the actual return value is lost and hence the infinite loop. So, when you change the type of the variable 'c' to int everything works fine. related files are "./clients/maxadmin.c" and "./server/modules/routing/binlogrouter/maxbinlogcheck.c" You have to build everything fresh. Hope this helps.

Comment by Chandranana [ 2018-04-24 ]

Yes Thank you A. Gokhan YAVUZ for sharing the information . We have debugged and resolved this issue.

Comment by Johan Wikman [ 2018-04-24 ]

aligokhan Thanks for detecting this, we will include this fix.

Comment by Johan Wikman [ 2018-04-24 ]

Now correct return type is used.

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