summaryrefslogtreecommitdiff
path: root/sql/semisync_master.h
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2019-04-17 15:32:30 +0300
committerAndrei Elkin <andrei.elkin@mariadb.com>2019-04-19 18:48:16 +0300
commit42c58b87da01fdf41ae5aa0d41af226d41096262 (patch)
treea27d53bd33ec0778d76093cd9a126b9a4bd30239 /sql/semisync_master.h
parent323e6cd74ce76c7811835bed640a2934e1d77f1b (diff)
downloadmariadb-git-42c58b87da01fdf41ae5aa0d41af226d41096262.tar.gz
MDEV-18096 The server would crash when has configs rpl_semi_sync_master_enabled = OFF rpl_semi_sync_master_wait_no_slave = OFF
The patch fixes a fired assert in the semisync master module. The assert caught attempt to switch semisync off (per rpl_semi_sync_master_wait_no_slave = OFF) when it was not even initialized (per rpl_semi_sync_master_enabled = OFF). The switching-off execution branch is relocated under one that executes enable_master() first. A minor cleaup is done to remove the int return from two functions that did not return anything but an error which could not happen in the functions.
Diffstat (limited to 'sql/semisync_master.h')
-rw-r--r--sql/semisync_master.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/semisync_master.h b/sql/semisync_master.h
index 3b05d9e0348..de5e3240802 100644
--- a/sql/semisync_master.h
+++ b/sql/semisync_master.h
@@ -343,11 +343,8 @@ public:
* position.
* If log_file_name is NULL, everything will be cleared: the sorted
* list and the hash table will be reset to empty.
- *
- * Return:
- * 0: success; non-zero: error
*/
- int clear_active_tranx_nodes(const char *log_file_name,
+ void clear_active_tranx_nodes(const char *log_file_name,
my_off_t log_file_pos);
/* Given a position, check to see whether the position is an active
@@ -449,7 +446,7 @@ class Repl_semi_sync_master
}
/* Switch semi-sync off because of timeout in transaction waiting. */
- int switch_off();
+ void switch_off();
/* Switch semi-sync on when slaves catch up. */
int try_switch_on(int server_id,