Commit 01095c8
committed
MDEV-40063 Corruption due to race in SET GLOBAL innodb_log_archive=ON
There was a race condition between log_t::write_checkpoint() and
the execution of SET GLOBAL innodb_log_archive=ON (enabling log archiving).
We had wrongly allowed the concurrent execution of log_t::set_archive()
and log_t::write_checkpoint(). The result was that
log_sys.next_checkpoint_no was corrupted. This could have broken
crash recovery.
log_t::write_checkpoint(): When we are releasing log_sys.latch while
durably writing the checkpoint header block, assign log_sys.resize_log
to log_sys.log to inform other threads that a checkpoint is in progress.
Previously, we only did this when innodb_log_archive=ON holds.
log_t::resize_start(): Relax a debug assertion for the logic change.
Tested by: Matthias Leich1 parent 72e0f9c commit 01095c8
2 files changed
Lines changed: 16 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1993 | 1993 | | |
1994 | 1994 | | |
1995 | 1995 | | |
1996 | | - | |
1997 | | - | |
1998 | 1996 | | |
1999 | 1997 | | |
2000 | 1998 | | |
| |||
2029 | 2027 | | |
2030 | 2028 | | |
2031 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
2032 | 2032 | | |
2033 | 2033 | | |
2034 | 2034 | | |
| |||
2059 | 2059 | | |
2060 | 2060 | | |
2061 | 2061 | | |
| 2062 | + | |
2062 | 2063 | | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
2063 | 2074 | | |
2064 | 2075 | | |
2065 | 2076 | | |
| |||
2080 | 2091 | | |
2081 | 2092 | | |
2082 | 2093 | | |
2083 | | - | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
2088 | | - | |
2089 | | - | |
2090 | | - | |
| 2094 | + | |
| 2095 | + | |
2091 | 2096 | | |
2092 | 2097 | | |
2093 | 2098 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
| 996 | + | |
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
| |||
0 commit comments