WL#14084: Lock improvements for ACL DDLs

Affects: Server-8.0   —   Status: Complete

At present ACL DDLs and FLUSH operation use very strong locks for ACL tables. These locks make sure that no other connection can interfere with DDL/Flush operation. However, depending on isolation level and autocommit status, these operations may be blocked by other connections holding lower but incompatible locks on these tables.

The later is more problematic because it allows a user with only SELECT privilege on mysql database OR ACL tables to completely block all user management DDLs. Such a SELECT privilege is necessary for taking backup(logical or otherwise).

This worklog will modify current locking mechanism to improve user management DDLs and FLUSH operation in a situation where other connections are holding locks on ACL tables.