Commit 13dcdb0
committed
MDEV-11802 InnoDB purge does not always run when there is work to do
srv_sys_t::n_threads_active[]: Protect writes by both the mutex and by atomic memory access. srv_active_wake_master_thread_low(): Reliably wake up the master thread if there is work to do. The trick is to atomically read srv_sys->n_threads_active[]. srv_wake_purge_thread_if_not_active(): Atomically read srv_sys->n_threads_active[] (and trx_sys->rseg_history_len), so that the purge should always be triggered when there is work to do. trx_commit_in_memory(): Invoke srv_wake_purge_thread_if_not_active() whenever a transaction is committed. Purge could have been prevented by the read view of the currently committing transaction, even if it is a read-only transaction. trx_purge_add_update_undo_to_history(): Do not wake up the purge. This is only called by trx_undo_update_cleanup(), as part of trx_write_serialisation_history(), which in turn is only called by trx_commit_low() which will always call trx_commit_in_memory(). Thus, the added call in trx_commit_in_memory() will cover also this use case where a committing read-write transaction added some update_undo log to the purge queue. trx_rseg_mem_restore(): Atomically modify trx_sys->rseg_history_len.1 parent 731435a commit 13dcdb0
File tree
5 files changed
+30
-61
lines changed- storage/innobase
- include
- srv
- trx
5 files changed
+30
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
| 752 | + | |
| 753 | + | |
759 | 754 | | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
| 755 | + | |
| 756 | + | |
768 | 757 | | |
769 | | - | |
770 | | - | |
| 758 | + | |
| 759 | + | |
771 | 760 | | |
772 | 761 | | |
773 | 762 | | |
774 | 763 | | |
775 | 764 | | |
776 | 765 | | |
777 | | - | |
778 | | - | |
| 766 | + | |
779 | 767 | | |
780 | | - | |
781 | | - | |
| 768 | + | |
| 769 | + | |
782 | 770 | | |
783 | 771 | | |
784 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
652 | 654 | | |
653 | 655 | | |
654 | 656 | | |
655 | 657 | | |
656 | 658 | | |
657 | 659 | | |
658 | | - | |
| 660 | + | |
659 | 661 | | |
660 | 662 | | |
661 | 663 | | |
| |||
853 | 855 | | |
854 | 856 | | |
855 | 857 | | |
856 | | - | |
| 858 | + | |
857 | 859 | | |
858 | 860 | | |
859 | 861 | | |
| |||
894 | 896 | | |
895 | 897 | | |
896 | 898 | | |
897 | | - | |
898 | 899 | | |
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
902 | 903 | | |
903 | 904 | | |
904 | | - | |
905 | | - | |
906 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
907 | 908 | | |
908 | 909 | | |
909 | 910 | | |
| |||
958 | 959 | | |
959 | 960 | | |
960 | 961 | | |
961 | | - | |
| 962 | + | |
962 | 963 | | |
963 | 964 | | |
964 | 965 | | |
| |||
2066 | 2067 | | |
2067 | 2068 | | |
2068 | 2069 | | |
2069 | | - | |
2070 | | - | |
2071 | | - | |
2072 | | - | |
2073 | | - | |
2074 | | - | |
| 2070 | + | |
2075 | 2071 | | |
2076 | 2072 | | |
2077 | | - | |
2078 | 2073 | | |
2079 | 2074 | | |
2080 | 2075 | | |
2081 | 2076 | | |
2082 | 2077 | | |
2083 | 2078 | | |
2084 | | - | |
| 2079 | + | |
2085 | 2080 | | |
2086 | 2081 | | |
2087 | 2082 | | |
| |||
2099 | 2094 | | |
2100 | 2095 | | |
2101 | 2096 | | |
2102 | | - | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
| 2097 | + | |
2108 | 2098 | | |
2109 | | - | |
2110 | | - | |
| 2099 | + | |
2111 | 2100 | | |
2112 | 2101 | | |
2113 | 2102 | | |
2114 | 2103 | | |
2115 | | - | |
| 2104 | + | |
| 2105 | + | |
2116 | 2106 | | |
2117 | 2107 | | |
2118 | 2108 | | |
2119 | 2109 | | |
2120 | 2110 | | |
2121 | | - | |
2122 | | - | |
| 2111 | + | |
2123 | 2112 | | |
2124 | | - | |
2125 | | - | |
| 2113 | + | |
2126 | 2114 | | |
2127 | | - | |
2128 | | - | |
2129 | 2115 | | |
2130 | | - | |
2131 | 2116 | | |
2132 | 2117 | | |
2133 | 2118 | | |
| |||
2713 | 2698 | | |
2714 | 2699 | | |
2715 | 2700 | | |
2716 | | - | |
2717 | | - | |
2718 | | - | |
2719 | | - | |
2720 | | - | |
2721 | | - | |
| 2701 | + | |
| 2702 | + | |
2722 | 2703 | | |
2723 | 2704 | | |
2724 | 2705 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | 294 | | |
296 | 295 | | |
297 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1908 | 1908 | | |
1909 | 1909 | | |
1910 | 1910 | | |
| 1911 | + | |
1911 | 1912 | | |
1912 | 1913 | | |
1913 | 1914 | | |
| |||
0 commit comments