diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-09-09 08:33:08 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-09-09 08:33:08 +0200 |
commit | 06b7fce9f24116080168b924d17f71b979fc3a14 (patch) | |
tree | 5ff9f5684bb118abbee5a9fd3b838d0841661287 /sql/wsrep_sst.cc | |
parent | 1f2ff25eba6c089b2698cd0dab96155ccbf2afd2 (diff) | |
parent | 8494039757a2f6353cc161e7824aab4fe2312d2a (diff) | |
download | mariadb-git-06b7fce9f24116080168b924d17f71b979fc3a14.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/wsrep_sst.cc')
-rw-r--r-- | sql/wsrep_sst.cc | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index ba6bb18bf37..50f54fddc95 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -528,7 +528,7 @@ static void* sst_joiner_thread (void* a) } else { // Scan state ID first followed by wsrep_gtid_domain_id. char uuid[512]; - long int domain_id; + unsigned long int domain_id; size_t len= pos - out + 1; if (len > sizeof(uuid)) goto err; // safety check @@ -542,11 +542,11 @@ static void* sst_joiner_thread (void* a) else if (wsrep_gtid_mode) { errno= 0; /* Reset the errno */ - domain_id= strtol(pos + 1, NULL, 10); + domain_id= strtoul(pos + 1, NULL, 10); err= errno; /* Check if we received a valid gtid_domain_id. */ - if (err == EINVAL || err == ERANGE || domain_id < 0x0 || domain_id > 0xFFFF) + if (err == EINVAL || err == ERANGE) { WSREP_ERROR("Failed to get donor wsrep_gtid_domain_id."); err= EINVAL; @@ -1171,6 +1171,16 @@ wait_signal: if (!err) { sst_disallow_writes (thd.ptr, true); + /* + Lets also keep statements that modify binary logs (like RESET LOGS, + RESET MASTER) from proceeding until the files have been transferred + to the joiner node. + */ + if (mysql_bin_log.is_open()) + { + mysql_mutex_lock(mysql_bin_log.get_log_lock()); + } + locked= true; goto wait_signal; } @@ -1179,6 +1189,11 @@ wait_signal: { if (locked) { + if (mysql_bin_log.is_open()) + { + mysql_mutex_assert_owner(mysql_bin_log.get_log_lock()); + mysql_mutex_unlock(mysql_bin_log.get_log_lock()); + } sst_disallow_writes (thd.ptr, false); thd.ptr->global_read_lock.unlock_global_read_lock (thd.ptr); locked= false; @@ -1211,6 +1226,11 @@ wait_signal: if (locked) // don't forget to unlock server before return { + if (mysql_bin_log.is_open()) + { + mysql_mutex_assert_owner(mysql_bin_log.get_log_lock()); + mysql_mutex_unlock(mysql_bin_log.get_log_lock()); + } sst_disallow_writes (thd.ptr, false); thd.ptr->global_read_lock.unlock_global_read_lock (thd.ptr); } |