MDEV-37136 allowed connections by default if wsrep_schema is
not initialized, but this allows and process to connect to a
node which is joining to the cluster and receiving SST (i.e.
all incoming connections are allowed until the storage engines
get initialized). We need to allow all connections by default
to maintain upgradability if nothing else is configured.
However, if user has given wsrep_allowlist string or stored
allowed connections to mysql.wsrep_allowlist table used
address should be checked.
When node is joining to the cluster and receiving SST InnoDB
storage engine is not initialized, thus mysq.wsrep_allowlist
table is not available and wsrep_schema is not intialized.
In this case we still should check has user configured
allowed connections using wsrep_allowlist configuration
variable. If wsrep_allowlist configuration variable contains
list of allowed addressed, we check is address used in
new connection in this list. If it is not connection is not
allowed.
Problem was that we used wsrep_schema pointer before it was
initialized. Fix is to allow all connections when wsrep_schema
is not yet initialized and check allowed connections
only when wsrep_schema has been initialized.
Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
sets mysys_var pointer to NULL, so the next THD::THD will crash.
Removed my_thread_init()/end() pairs and because
Wsrep_allowlist_service::allowlist_cb is not always called from a
new thread added a thread to do so.
Fix co-authored by Sergei Golubchik <serg@mariadb.org>
and mkaruza <mario.karuza@galeracluster.com>
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>