Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
Description
In 7a9dfdd GLOBAL and COMMIT namespaces were combined into BACKUP, which doubled load on BACKUP lock mutex.
Can be fixed by implementing something similar to MySQL WL#7306 "Improve MDL performance and scalability by implementing lock-free lock acquisition for DML".
Attachments
Issue Links
- is caused by
-
MDEV-5336 Implement BACKUP STAGE for safe external backups
-
- Closed
-
- relates to
-
MDEV-14992 BACKUP: in-server backup
-
- Open
-
I am working on the following solution (which is very much like Marko's suggestion) to remove some of the issues with BACKUP STAGE BLOCK_COMMIT;
Adding before MDL_REQUEST_INIT() in ha_commit_trans()
If (!(thd->backup_state= backup_is_running))
{ my_atomic_add32(&thd_in_commit, 1, MY_MEMORY_ORDER_RELAXED)) }else
{ MDL_REQUEST_INIT(...) }and when releasing:
if (mdl_backup.ticket)
{ .... }else if (thd->backup_state)
{ my_atomic_add32(&thd_in_commit, -1, MY_MEMORY_ORDER_RELAXED)) thd->backup_state= 0; }If we have the above, we could in BACKUP_STAGE_START do something like
backup_running= 1;
{ while (thd_in_commit) sleep(1); }do
while (some_thd_has_backup_state_set())
The effect would be to replace the MDL_backup lock in ha_commit_trans() with two atomic increment and two thread-local memory assignments when backup is not running. The cost is a slightly slower start of the backup.