[MDEV-639] LP:966254 - connection is refused while excuting "flush privileges" Created: 2012-08-09 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System |
| Affects Version/s: | 5.1.67, 5.2.14, 5.3.12, 5.5.36, 10.0.10, 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Hickey | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
In such scenario, we hit the infinite looping of 'flush privileges' events between master and As for the "flush privileges" passing between master and slave, back and forth, could refer to The root problems caused the connection issue is due to the logic defect which explained For 'flush privileges', acl_reload()would be called, and then acl_load() is called. The But when client connections to server, acl_check_hosts() will be called, which logic is
in line 1497,we find that allow_all_hosts is used without any lock, which caused So there is a race risk, and in some special case which like we hit, that might be a How to repeat: Suggested fix:
|
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2012-03-28 ] | ||||||||||||||||||||||||||
|
Re: connection is refused while excuting "flush privileges" 1.create user xx1 root@(none) 05:10:33>grant all on . to xx1@'127.0.0.1' identified by '123'; 2. run sh: $cat flush_pri.sh for i in {1..100000}; do 3. | ||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-03-28 ] | ||||||||||||||||||||||||||
|
Re: connection is refused while excuting "flush privileges" | ||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-03-28 ] | ||||||||||||||||||||||||||
|
a simple patch for this bug. flush_priv.diff | ||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-07-30 ] | ||||||||||||||||||||||||||
|
Re: connection is refused while excuting "flush privileges" this bug was fixed in MySQL 5.7.0 Noted in 5.7.0 changelog. The server refused client connections while executing FLUSH | ||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-09-11 ] | ||||||||||||||||||||||||||
|
Re: connection is refused while excuting "flush privileges" | ||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-09-11 ] | ||||||||||||||||||||||||||
|
Launchpad bug id: 966254 | ||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-04-14 ] | ||||||||||||||||||||||||||
|
I couldn't reproduce the actual problem with refused connections; but based on the code, if it is a bug, it still exists everywhere, so I'm setting the versions accordingly. | ||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2021-02-25 ] | ||||||||||||||||||||||||||
|
It appears I was missing a step – void FLUSH PRIVILEGES don't seem to cause the effect, at least on modern versions; but if something has changed in the privileges, then the failure can be reproduced easily.
If socket is used instead of TCP, the failure doesn't happen (replace "127.0.0.1" with "localhost" in the test case to try). I'm raising the priority as we have had a practical complaint which may have had the same cause, even although it hasn't been confirmed. Please also note that starting from 10.4 the server logs a warning when it happens, and the warning is weird:
|