[MXS-1384] maxscale.cnf script field length limitation Created: 2017-09-01  Updated: 2017-09-05  Resolved: 2017-09-05

Status: Closed
Project: MariaDB MaxScale
Component/s: Monitor
Affects Version/s: 2.1.6
Fix Version/s: 2.1.7

Type: Bug Priority: Major
Reporter: Igor V. Lovalev Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

centos 6 x86_64



 Description   

Hi there!
I have mariadb cluster with 5 nodes and one maxscale-node... and some troubles with monitor (script-trigger) [doc. example

[max_monitor]
type=monitor
module=mysqlmon
servers=max-1,max-2,max-3,max-4,max-5
user=maxscale
#script=/usr/local/sbin/failover.py --logpath=/var/log/maxscale --event=$EVENT --initiator=$INITIATOR --nodelist=$NODELIST --ignorenodes=max-3,max-4,max-5 --repluser=replica -d
script=/usr/local/sbin/test_length.sh --event=$EVENT --initiator=$INITIATOR --nodelist=$NODELIST --very_long_string1=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 --very_long_string2=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
passwd=maxscale
monitor_interval=10000
events=master_down
detect_stale_master=true
detect_replication_lag=true
#detect_stale_slave=true

The trouble is - script string with arguments is truncated when it executed. Debug script and logs attached:

# cat /usr/local/sbin/test_length.sh
#!/bin/bash
echo $* > /tmp/test_length
 
# maxscale.log
2017-09-01 09:36:01   notice : (monitor_launch_script): Executed monitor script '/usr/local/sbin/test_length.sh --event=master_down --initiator=[max-1]:3306 --nodelist=[max-3]:3306,[max-4]:3306,[max-5]:3306 --very_long_string1=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 --very_long_string2=00000000000000000000000000'
 
# cat /tmp/test_length
--event=master_down --initiator=[max-1]:3306 --nodelist=[max-3]:3306,[max-4]:3306,[max-5]:3306 --very_long_string1=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 --very_long_string2=00000000000000000000000000
 
# cat /tmp/test_length|wc -m
262

I can't find in documentation about this limitation. It's very critical and important for me, cuz on my prod i use long DNS mysql server names :'(

Could you please remove this limitation, or defined it into documentation?



 Comments   
Comment by markus makela [ 2017-09-01 ]

The maximum line length for a configuration parameter is 16384 characters and each script appears to be limited to 126 argument strings and you should be well under these limitations. I managed to reproduce this locally and the last parameter was truncated.

Comment by Igor V. Lovalev [ 2017-09-02 ]

Hi, Markus! Thank you so much for ur reaction & solution I'll wait for 2.1.7

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