The build scripts now download Node.js 6.11.2 for building and packaging
MaxCtrl. The client package is also created when the extra packages are
built.
Only the protocol, port and address of the listener were used to check if
a listener exists. The check should also use the name of the listener to
be sure that each name is unique.
Expanded tests to check that the creation of duplicate listeners is
detected. Did minor improvements to related test code.
The `cluster diff` command is now tested by doing add/alter/remove
operations on servers. As the same methods are used for all objects, they
should detect all sorts of modifications between two Maxscales.
The check that the two MaxScales have the same services is now in a common
function. Added more details into the error message as to why the command
failed. The hosts and their extra services are logged for both the source
and target of the command.
The `cluster diff` command could display the extra services in the diff
but this could be interpreted as a sign that MaxScale could act on that
part of the diff. Returning an error instead of silently ignoring the
extra services should allow for a more consistent user experience.
The `execute` command now returns the output of the command instead of
printint it. This allows the tests to actually test the output of the
commands instead manually verifying that it is correct. It also allows the
library part to be used as an actual library that only returns data.
The configuration wrongly spelled `secondary` as `secodary` causing a
failure to start the secondary MaxScale. The startup script didn't create
the log directory and removed the wrong maxadmin socket file.
The resource collection modification times weren't updated when an
individual resource was updated. By tracking back the path of a resource
and updating the modification times, all nodes in the path will get the
correct modification time.
The checks whether a request body is present are now done at a higher
level. This removes the need to do the checks at the resource handler
callback, removing duplicated code.
The checks are done by adding constraints to resources that must be
fulfilled by each request.
Added debug assertions to make sure that the core logic of the REST API
resource system works.
The call to MHD_basic_auth_get_username_password allocates memory for both
the password and the username.
mxs_json_add_relation leaked a reference to a JSON object by using
json_array_append instead of json_array_append_new.
The messages now show where the request failed and what was
requested. This should help resolve both develper and end-user problems.
Also fixed the missing logging of the output string in the `parse`
callback of the main function and cleaned up the POSTed server body.
By moving the repurposing of the servers under the global server lock, the
repurposing of a server and allocation of a new server behave in the same
way.
Also fixed the wrong error message on server creation failure referring to
invalid server relationships.
The monitors should only be reused if they have the same name and they use
the same module. This way the only difference is in configuration.
Fixed MaxCtrl detection of bad options and altered monitor creation test
to expect correct results. Also improved some of the error messages.
If a destroyed monitor is created again, it will be reused. This should
prevent excessive memory growth when the same monitor is created and
destroyed again.
The test tests the internals of the cluster diff generation
algorithms. This should guarantee that the diff calculation and the
resulting synchronization will work as expected without having to test it
on a live cluster.
The `cluster sync` command synchronizes a MaxScale cluster with one
server. This allows new MaxScale instances to be synchronized with an old
instance by using the same configuration file and performing a cluster
sync.
The `cluster diff` command prints out the difference between the source
and target MaxScale. This allows users to detect changes that have
happened on one MaxScale but not on the other.
Moved MaxCtrl into a separate package to simplify packaging and
distribution process. Having the client as a separate component allows one
set of packages to be used on multiple platforms.
The "parser" of compare cannot handle the following:
prepare stmt1 from "
with t as (select a from t1 where b >= 'c')
select * from t2,t where t2.c=t.a;
";
That is, that a line *not* terminating the full statement (the
line 'select * from t2,t where t2.c=t.a;' above) ends with a ';'.
Thus, it needs to be changed into e.g.
prepare stmt1 from "
with t as (select a from t1 where b >= 'c')
select * from t2,t where t2.c=t.a;";
In the context of subselects and CTEs it is somewhat difficult to
make qc_sqlite and qc_mysqlembedded to agree upon in what context
a particular field is used. As that information is not used anywhere,
a usage discrepancy is for now treated as a warning.
All callbacks called by sqlite now only access the thread specific
QcSqliteInfo and call the corresponding function on that instance.
This is the first step in making qc_sqlite exception safe from the
point of view of sqlite3.
As the diff is confusing, basically the ONLY thing that has been
done is:
BEFORE:
-------
class QcSqliteInfo
{
...
};
static void some_helper(...) { ... }
void mxs_someCallback(...)
{
QC_TRACE();
QcSqliteInfo* info = this_thread.pInfo;
ss_dassert(info);
info->m_status = ...;
some_helper(info, ...);
}
AFTER:
------
class QcSqliteInfo
{
...
void some_helper(...) { ... }
void mxs_someCallback(...)
{
m_status = ...;
some_helper(this, ...);
}
};
void mxs_someCallback(...)
{
QC_TRACE();
QcSqliteInfo* pInfo = this_thread.pInfo;
ss_dassert(pInfo);
pInfo->mxs_someCallback(...);
}
With this change, for a statement like
SELECT t2.a FROM t1 t2;
the affected field is reported as t1.a and not as t2.a, as it
was before.
For a statement like
SELECT t.f FROM d.t;
qc_mysqlembedded will now return "d.t.f" as the affected field,
while qc_sqlite will still return "t.f" as both implementations did
before. In qc_mysqlembedded's case that is a side-effect of the
alias handling. To get qc_sqlite to return the same (which would
be good), the table names would have to be collected in a smarter
way than they are now.
Divided functionality into classes, fixed comments +
various other cleanup. BackenAuth no longer increments
sequence on sending password. SQLite busy timeout shortened
to 1 second.
This includes the client and backend authenticators. Currently,
only a simple password-based scheme with the SQL-client "dialog" plugin
is supported. In this mode, the server sends the first PAM message
with the AuthSwitchRequest packet and the client responds with the
password. No further authentication messages are supported. If the
connection is not encrypted, the password is sent in plaintext. The
client password is used as is for logging in to backends.
PURGE BINARY LOGS; deletes all files in binlogdir and GTID maps repo
but keeps current binlog file.
PURGE BINARY LOGS TO ‘file’; deletes all files in binlogdir and GTID
maps repo up to specified file.
mariadb10_slave_gtid=On option is needed in order to keep the list of
binlog files.