percona server 5.7 super_read_only and gtid_executed table
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
New
|
Undecided
|
Unassigned |
Bug Description
Suppose that you have percona server 5.7 slave with super_read_only option enabled.
thread/
This is due to following change in handler.cc file.
In percona-server 5.7:
if (rw_trans && !ignore_
1780 {
1781 /*
1782 Acquire a metadata lock which will ensure that COMMIT is blocked
1783 by an active FLUSH TABLES WITH READ LOCK (and vice versa:
1784 COMMIT in progress blocks FTWRL).
1785
1786 We allow the owner of FTWRL to COMMIT; we assume that it knows
1787 what it does.
1788 */
1789 MDL_REQUEST_
1790 MDL_key::COMMIT, "", "", MDL_INTENTION_
1791 MDL_EXPLICIT);
1792
1793 DBUG_PRINT("debug", ("Acquire MDL commit lock"));
1794 if (thd->mdl_
1795 thd->variables.
1796 {
1797 ha_rollback_
1798 DBUG_RETURN(1);
1799 }
1800 release_mdl= true;
1801
1802 DEBUG_SYNC(thd, "ha_commit_
1803 }
1804
1805 if (rw_trans && stmt_has_
1806 && check_readonly(thd, true))
1807 {
1808 ha_rollback_
1809 error= 1;
1810 goto end;
1811 }
in mysql 5.7:
if (rw_trans && !ignore_
1747 {
1748 /*
1749 Acquire a metadata lock which will ensure that COMMIT is blocked
1750 by an active FLUSH TABLES WITH READ LOCK (and vice versa:
1751 COMMIT in progress blocks FTWRL).
1752
1753 We allow the owner of FTWRL to COMMIT; we assume that it knows
1754 what it does.
1755 */
1756 MDL_REQUEST_
1757 MDL_key::COMMIT, "", "", MDL_INTENTION_
1758 MDL_EXPLICIT);
1759
1760 DBUG_PRINT("debug", ("Acquire MDL commit lock"));
1761 if (thd->mdl_
1762 thd->variables.
1763 {
1764 ha_rollback_
1765 DBUG_RETURN(1);
1766 }
1767 release_mdl= true;
1768
1769 DEBUG_SYNC(thd, "ha_commit_
1770
1771 if (stmt_has_
1772 {
1773 ha_rollback_
1774 error= 1;
1775 goto end;
1776 }
1777 }
The problem is in this:
if (rw_trans && stmt_has_
1806 && check_readonly(thd, true))
1807 {
1808 ha_rollback_
1809 error= 1;
1810 goto end;
1811 }
it should be inside if (rw_trans && !ignore_
This bug causes huge growth of gtid_executed tables and severe IO, because due to stuck thread a lot of IO is generated to iblog files.
This is bug 1654682 (http:// bugs.mysql. com/bug. php?id= 84437), already fixed in Percona Server 5.7.17-12. Closing as duplicate - please re-open if needed