summaryrefslogtreecommitdiff
path: root/sql/log.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-10-21 14:57:00 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-10-21 14:57:00 +0300
commit489ef007bec398c3b7b628325b225c3a015922cf (patch)
tree7d1d5b1ea2c55d608f8697377776b9777fa622be /sql/log.h
parentd10c42b42541deed899dd1d1e04b69475339196c (diff)
parentd5bcccdabbf1a23c75ab4ee0c14149eb6ed27d98 (diff)
downloadmariadb-git-489ef007bec398c3b7b628325b225c3a015922cf.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/log.h')
-rw-r--r--sql/log.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/log.h b/sql/log.h
index 8994d536298..b7ac4fa5196 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -938,6 +938,20 @@ public:
void unlock_binlog_end_pos() { mysql_mutex_unlock(&LOCK_binlog_end_pos); }
mysql_mutex_t* get_binlog_end_pos_lock() { return &LOCK_binlog_end_pos; }
+ /*
+ Ensures the log's state is either LOG_OPEN or LOG_CLOSED. If something
+ failed along the desired path and left the log in invalid state, i.e.
+ LOG_TO_BE_OPENED, forces the state to be LOG_CLOSED.
+ */
+ void try_fix_log_state()
+ {
+ mysql_mutex_lock(get_log_lock());
+ /* Only change the log state if it is LOG_TO_BE_OPENED */
+ if (log_state == LOG_TO_BE_OPENED)
+ log_state= LOG_CLOSED;
+ mysql_mutex_unlock(get_log_lock());
+ }
+
int wait_for_update_binlog_end_pos(THD* thd, struct timespec * timeout);
/*