summaryrefslogtreecommitdiff
path: root/sql/log.h
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2008-12-04 14:07:56 +0000
committerLuis Soares <luis.soares@sun.com>2008-12-04 14:07:56 +0000
commit73326c10699f5e0239daafcd1d5e8629468c5209 (patch)
treec9152cfce6fe102fd98192800f73d1e91e4ed58c /sql/log.h
parentbe1e99281241539b34e374529716f8eb162f4786 (diff)
parentda1bf248526af2ff5037bbe92613c432eeda3b9a (diff)
downloadmariadb-git-73326c10699f5e0239daafcd1d5e8629468c5209.tar.gz
BUG#38826 Race in MYSQL_LOG::purge_logs is impossible to debug in production
BUG#39325 Server crash inside MYSQL_LOG::purge_first_log halts replicaiton The patch reverses the order of the purging and updating events for log and relay-log.info/index files respectively. This solves the problem of having holes caused by crashes happening between updating info/index files and purging logs. This patch also contains an aditional test case for testing the crashing before purge logs. NOTE1: This is a combined patch for BUG#38826 and BUG#39325. This patch is based on bugteam tree and takes into account reviewers suggestions. NOTE2: Merge from 5.0-bugteam
Diffstat (limited to 'sql/log.h')
-rw-r--r--sql/log.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/log.h b/sql/log.h
index 891134a9762..6346f38a279 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -233,6 +233,13 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
pthread_cond_t update_cond;
ulonglong bytes_written;
IO_CACHE index_file;
+ /*
+ purge_temp is a temp file used in purge_logs so that the index file
+ can be updated before deleting files from disk, yielding better crash
+ recovery. It is created on demand the first time purge_logs is called
+ and then reused for subsequent calls. It is cleaned up in cleanup().
+ */
+ IO_CACHE purge_temp;
char index_file_name[FN_REFLEN];
/*
The max size before rotation (usable only if log_type == LOG_BIN: binary