I have Maxscale as a ReadWriteSplit for 3 Galera nodes. Node 1 is MASTER and other 2 are SLAVES.
I always create my users on master with:
mysql -e "CREATE DATABASE ${DB_NAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"
mysql -e "CREATE USER IF NOT EXISTS '${DB_NAME}'@'10.1.0.%' IDENTIFIED BY '${DB_PASS}';"
mysql -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_NAME}'@'10.1.0.%';"
Since any nod is not restarted (for MariaDB upgrades or other reasons) everything goes fine. But if the node is restarted, when any query hits the SLAVES Maxscale claims that:
error : (2648715) [mariadbbackend] Invalid authentication message from backend 'sql3'. Error code: 1044, Msg : #42000Access denied for user '${DB_NAME}'@'10.1.0.%' to database '${DB_NAME}'
warning: (2648715) [readwritesplit] Refresh rate limit (once every 30 seconds) exceeded for load of users' table.
To fix it, at MASTER, I need to GRANT ALL PRIVILEGES
again:
mysql -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_NAME}'@'10.1.0.%';"
And the error stops. Is this a bug or I'm not doing things correctly?