Using GRANT for creating new user is deprecated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Percona Cluster Charm |
Triaged
|
Medium
|
Unassigned |
Bug Description
Error MSG:
2019-12-16 23:28:49 DEBUG install /var/lib/
Steps:
1. juju deploy percona-cluster
2. juju deploy -n 3 keystone
3. juju deploy hacluster
4. juju add-relation keystone:shared-db percona-
5. juju add-relation hacluster:ha keystone:ha
6. juju config keystone vip='10.5.0.77'
Topo:
$ juju status
Model Controller Cloud/Region Version SLA Timestamp
zaza-a899aced92a5 ziyiwang-
App Version Status Scale Charm Store Rev OS Notes
hacluster active 3 hacluster local 0 ubuntu
keystone 16.0.0 active 3 keystone jujucharms 468 ubuntu
percona-cluster 5.7.20 active 1 percona-cluster jujucharms 356 ubuntu
Unit Workload Agent Machine Public address Ports Message
keystone/0* active idle 1 10.5.0.19 5000/tcp Unit is ready
hacluster/0* active idle 10.5.0.19 Unit is ready and clustered
keystone/1 active idle 2 10.5.0.9 5000/tcp Unit is ready
hacluster/1 active idle 10.5.0.9 Unit is ready and clustered
keystone/2 active idle 3 10.5.0.20 5000/tcp Unit is ready
hacluster/2 active idle 10.5.0.20 Unit is ready and clustered
percona-cluster/0* active idle 0 10.5.0.7 3306/tcp Unit is ready
Machine State DNS Inst id Series AZ Message
0 started 10.5.0.7 50cdac06-
1 started 10.5.0.19 031204a7-
2 started 10.5.0.9 97af15bb-
3 started 10.5.0.20 e34d756f-
TRIAGED: confirmed.
The offending code is in hooks/percona_ utils.py at:
303:
"TO 'sstuser' @'localhost' IDENTIFIED BY '{password}'")
SQL_SST_USER_SETUP = ("GRANT {permissions} ON *.* "
SQL_SST_ USER_SETUP_ IPV6 = ("GRANT {permissions} "
" ON *.* TO 'sstuser' @'ip6-localhost ' IDENTIFIED "
" BY '{password}'")
1440:
def create_ replication_ user(slave_ address, master_password):
""" Create replication user (lp1776171)
Grants access for MySQL asynchronous replication slave.
:param slave_address: slave IP address
m_helper. connect( password= m_helper. get_mysql_ root_password( )) execute( ("GRANT REPLICATION SLAVE ON *.* TO ""'replication' @'{}' "
"IDENTIFIED BY '{}';") .format( slave_address,
master_ password) )
:type slave_address: str
:param master_password: replication password
:type master_password: str
:raises: OperationalError
"""
m_helper = get_db_helper()
try:
except OperationalError:
log("Could not connect to db", level=DEBUG)
return
m_helper.
FIX:
Replace grants with two SQL commands; one to create the user and one to grant the grant.