[MXS-275] Error with comments in maxscale.cnf Created: 2015-07-17  Updated: 2019-07-09  Resolved: 2015-07-21

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 1.2.0
Fix Version/s: 1.2.0

Type: New Feature Priority: Minor
Reporter: Christian Roser Assignee: markus makela
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

I have following config for my galera monitor:

type     = monitor
module   = galeramon
servers   = galera1,galera2,galera3 #,galera4

The fourth node is currently offline so I commented it out. This worked since MaxScale 1.1.

Now I get an error like this

Error: Unable to find server 'galera3 #' that is configured as part of service 'galera_router'

just write a comment if you need more information.

Christian



 Comments   
Comment by martin brampton (Inactive) [ 2015-07-17 ]

I wonder whether we should really support commenting of part lines - it is supported in some ini file implementations but isn't part of the generally applicable syntax rules.

Comment by Christian Roser [ 2015-07-17 ]

Why not? In MariaDB/MySQL's my.cnf this is implemented, too. This is not an absolut must-have but I was just wondering why it stopped working with the MaxScale 1.2 Release.

Comment by martin brampton (Inactive) [ 2015-07-17 ]

Purely to keep options open. It seems very much of a "nice to have" for some people - others would never expect it. Where possible, it is nice to either standardise on as few parsing algorithms as possible or to use standard libraries for analysing stuff like the config. Also bearing in mind platform support. But I can't say I've done any research on actual resources.

Comment by markus makela [ 2015-07-20 ]

I tested with the following config in MaxScale 1.1.1.

[maxscale]
threads=4
 
[monitor]
type=monitor
module=mysqlmon
servers=server1 #,server2
user=maxuser
passwd=maxpwd
 
[rw]
type=service
router=readconnroute
servers=server1,server2
user=maxuser
passwd=maxpwd
 
[rw_listener]
type=listener
service=rw
protocol=MySQLClient
port=3306
 
[server1]
type=server
address=10.0.2.2
port=3000
protocol=MySQLBackend
 
[server2]
type=server
address=10.0.2.2
port=3001
protocol=MySQLBackend

Here is the relevant line in the error log.
2015-07-20 09:26:38 Error: Unable to find server 'server1 #' that is configured in the monitor 'monitor'.

This was tested with the 1.1.1 RPM on Centos 6.

Comment by markus makela [ 2015-07-21 ]

croser Did you use 1.1.1 or 1.1 when you tested this?

Comment by Christian Roser [ 2015-07-21 ]

I used 1.1.1 but now I'm not able to reproduce it. I always get the same error like you did when testing with 1.1.1.

Comment by Sidney Harrell [ 2019-07-09 ]

This is definitely still an issue. This

log_info=0  #turn this off unless debugging

Will turn on logging of info messages.
It's clearly documented in the wiki:

"Comments are defined by prefixing a row with a hash (#). Trailing comments are not supported."

And obviously still out of alignment with every other mariadb or mysql project. Please consider reopening as a feature request to improve or replace the config file parser.

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