It was possible that a backend server was doing authentication while the client
closed the session. The more connections the router created the more likely it
was. This caused unnecessary reloading of the database users and confusing error
messages.
With the implemented fix, there are additional checks for the session state
before the users are reloaded or error messages are logged.
Since the PCRE2 library was always going to be a part of MaxScale, there was
no real reason to have it as a shared library apart from smaller binaries.
The username matching was working as intended but the session's active value
was ignored when queries were being routed. This meant that both the username
and the IP address of the user were ignored and query replacement was always
done.
The binlog file is now always opened when it is needed and closed
when we are finished with it. That will remove any potential
file concurrency issues between different threads dealing with
the same slave.
Slave request for a log_pos behind binlog file size may result in a
disconnection or replication error:
if binlog file is latest one slave get disconnected otherwise an error
message is returned and replication stops
The maxscale service will be restarted only if the process is down because
a signal was caught or the process times out. If the process would be restarted
when it exits with a non-zero value, this would lead to infinite loops when
there is a configuration error.
Changed default number of threads to 1 instead of autoconfigured value and
added a new `auto` variable which enables autoconfiguration of thread count.
The number of threads used when autoconfiguratio fails was changed from 4 to 1.
The default value of using N threads where N is the number of CPU cores was
not optimal as the possibility of rescheduling was higher the more utility
threads there were. Due to this, N-1 is deemed to be the better autoconfigured
value for thread count.
Made some variables stack allocated so there is no change of memory leaking.
There was no real reason to allocate memory from the heap for the variables in
question since they did not need to persist outside the scope of the function.
On systems where the systemd directories exist but not the systemctl command,
installation of MaxScale would cause systemctl to be called. This would print
an error when the package is being installed.
Pre-1.2.0 configuration scripts are no longer copied and renamed.
Init scripts, ldconfig files and systemd service files are only removed if
they are found.
The postinstall script tried to create a group for the maxscale even if the
useradd command had created one. This fix removes the warning messages by
creating the group while the user is being created.
If the systemd folder wasn't located at /usr/lib/systemd/ but at /lib/systemd/
the postinstall script would not copy the file.
Also added error messages if some of the files could not be located.
Some of the data was not reset for the branch session when a query
was not duplicated which could lead to a hang. Also the COM_FIELD_LIST
duplicated to the branch session even though it doesn't change the
session state.
If a statement wasn't cloned for the Tee filter, the session would be closed
leading to a possible hang. Instead of closing the session when a statement
isn't cloned, it should not expect a response from that server for that statement.