summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-05-21 17:07:17 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-05-21 17:07:17 -0400
commit0b98d2fd2ab337d95b6b502b15ea86368c441026 (patch)
tree43b49a7f5ccb94114797fcae41015ab9055685c4
parent0903e2b744f627f57a99edd5d2b6ffdec1ef4a03 (diff)
downloadmariadb-git-0b98d2fd2ab337d95b6b502b15ea86368c441026.tar.gz
bzr merge -r4065..4088 codership/5.6
-rw-r--r--scripts/wsrep_sst_mysqldump.sh2
-rw-r--r--scripts/wsrep_sst_xtrabackup-v2.sh19
-rw-r--r--sql/wsrep_applier.cc6
-rw-r--r--sql/wsrep_binlog.h3
-rw-r--r--sql/wsrep_hton.cc10
-rw-r--r--sql/wsrep_mysqld.cc10
-rw-r--r--storage/innobase/row/row0ins.cc8
-rw-r--r--storage/innobase/row/row0upd.cc7
-rw-r--r--storage/xtradb/row/row0ins.cc8
-rw-r--r--storage/xtradb/row/row0upd.cc7
10 files changed, 57 insertions, 23 deletions
diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh
index 94c6ef42955..3fce316f379 100644
--- a/scripts/wsrep_sst_mysqldump.sh
+++ b/scripts/wsrep_sst_mysqldump.sh
@@ -128,5 +128,5 @@ else
wsrep_log_info "Bypassing state dump."
echo $SET_START_POSITION | $MYSQL
fi
-wsrep_cleanup_progress_file
+
#
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh
index 61e5d111aa9..f4d133d4f8e 100644
--- a/scripts/wsrep_sst_xtrabackup-v2.sh
+++ b/scripts/wsrep_sst_xtrabackup-v2.sh
@@ -860,10 +860,27 @@ then
fi
fi
+
+ if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then
+
+ BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
+ BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG)
+
+ # To avoid comparing data directory and BINLOG_DIRNAME
+ mv $DATA/${BINLOG_FILENAME}.* $BINLOG_DIRNAME/ 2>/dev/null || true
+
+ pushd $BINLOG_DIRNAME &>/dev/null
+ for bfiles in $(ls -1 ${BINLOG_FILENAME}.*);do
+ echo ${BINLOG_DIRNAME}/${bfiles} >> ${BINLOG_FILENAME}.index
+ done
+ popd &> /dev/null
+
+ fi
+
if [[ $incremental -eq 1 ]];then
# Added --ibbackup=xtrabackup_55 because it fails otherwise citing connection issues.
INNOAPPLY="${INNOBACKUPEX_BIN} $disver --defaults-file=${WSREP_SST_OPT_CONF} \
- --ibbackup=xtrabackup_55 --apply-log $rebuildcmd --redo-only $BDATA --incremental-dir=${DATA} &>>${BDATA}/innobackup.prepare.log"
+ --ibbackup=xtrabackup_56 --apply-log $rebuildcmd --redo-only $BDATA --incremental-dir=${DATA} &>>${BDATA}/innobackup.prepare.log"
fi
wsrep_log_info "Preparing the backup at ${DATA}"
diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc
index 2d859087217..05c32da580d 100644
--- a/sql/wsrep_applier.cc
+++ b/sql/wsrep_applier.cc
@@ -62,7 +62,6 @@ err:
#include "rpl_rli.h" // class Relay_log_info;
#include "sql_base.h" // close_temporary_table()
-
static inline void
wsrep_set_apply_format(THD* thd, Format_description_log_event* ev)
{
@@ -94,7 +93,7 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
int rcode= 0;
int event= 1;
- DBUG_ENTER("wsrep_apply_rbr");
+ DBUG_ENTER("wsrep_apply_events");
if (thd->killed == KILL_CONNECTION)
{
@@ -118,7 +117,6 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
Log_event* ev= wsrep_read_log_event(&buf, &buf_len,
wsrep_get_apply_format(thd));
-
if (!ev)
{
WSREP_ERROR("applier could not read binlog event, seqno: %lld, len: %zu",
@@ -126,6 +124,7 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
rcode= 1;
goto error;
}
+
switch (ev->get_type_code()) {
case FORMAT_DESCRIPTION_EVENT:
wsrep_set_apply_format(thd, (Format_description_log_event*)ev);
@@ -368,6 +367,7 @@ wsrep_cb_status_t wsrep_commit_cb(void* const ctx,
return rcode;
}
+
wsrep_cb_status_t wsrep_unordered_cb(void* const ctx,
const void* const data,
size_t const size)
diff --git a/sql/wsrep_binlog.h b/sql/wsrep_binlog.h
index f2ff713cf67..a3d8ec6ec2c 100644
--- a/sql/wsrep_binlog.h
+++ b/sql/wsrep_binlog.h
@@ -46,6 +46,9 @@ int wsrep_write_cache (wsrep_t* wsrep,
/* Dump replication buffer to disk */
void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len);
+/* Dump replication buffer to disk without intermediate buffer */
+void wsrep_dump_rbr_direct(THD* thd, IO_CACHE* cache);
+
int wsrep_binlog_close_connection(THD* thd);
int wsrep_binlog_savepoint_set(THD *thd, void *sv);
int wsrep_binlog_savepoint_rollback(THD *thd, void *sv);
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index a1de760ad9e..48577a9b5a1 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -77,10 +77,10 @@ void wsrep_register_hton(THD* thd, bool all)
trans_register_ha(thd, all, wsrep_hton);
/* follow innodb read/write settting
- * but, as an exception: CTAS with empty result set will not be
+ * but, as an exception: CTAS with empty result set will not be
* replicated unless we declare wsrep hton as read/write here
*/
- if (i->is_trx_read_write() ||
+ if (i->is_trx_read_write() ||
(thd->lex->sql_command == SQLCOM_CREATE_TABLE &&
thd->wsrep_exec_mode == LOCAL_STATE))
{
@@ -104,7 +104,7 @@ void wsrep_post_commit(THD* thd, bool all)
if (wsrep->post_commit(wsrep, &thd->wsrep_ws_handle))
{
DBUG_PRINT("wsrep", ("set committed fail"));
- WSREP_WARN("set committed fail: %llu %d",
+ WSREP_WARN("set committed fail: %llu %d",
(long long)thd->real_id, thd->get_stmt_da()->status());
}
wsrep_cleanup_transaction(thd);
@@ -202,7 +202,7 @@ static int wsrep_rollback(handlerton *hton, THD *thd, bool all)
switch (thd->wsrep_exec_mode)
{
case TOTAL_ORDER:
- case REPL_RECV:
+ case REPL_RECV:
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
WSREP_DEBUG("Avoiding wsrep rollback for failed DDL: %s", thd->query());
DBUG_RETURN(0);
@@ -280,7 +280,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all)
int replay_round= 0;
if (thd->get_stmt_da()->is_error()) {
- WSREP_ERROR("commit issue, error: %d %s",
+ WSREP_ERROR("commit issue, error: %d %s",
thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message());
}
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 8ee157a1a89..f979a9d1a42 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -443,7 +443,7 @@ static void wsrep_synced_cb(void* app_ctx)
active_mi,
master_info_file,
relay_log_info_file,
- SLAVE_SQL)))
+ SLAVE_SQL)))
{
WSREP_WARN("Failed to create slave threads: %d", rcode);
}
@@ -1008,8 +1008,8 @@ static bool wsrep_prepare_keys_for_isolation(THD* thd,
memset(&tmp_table, 0, sizeof(tmp_table));
tmp_table.table_name= (char*)table;
tmp_table.db= (char*)db;
- tmp_table.mdl_request.init(MDL_key::GLOBAL, (db) ? db : "",
- (table) ? table : "",
+ tmp_table.mdl_request.init(MDL_key::GLOBAL, (db) ? db : "",
+ (table) ? table : "",
MDL_INTENTION_EXCLUSIVE, MDL_STATEMENT);
if (!table || !find_temporary_table(thd, &tmp_table))
@@ -1149,8 +1149,8 @@ int wsrep_to_buf_helper(
/* if there is prepare query, add event for it */
if (!ret && thd->wsrep_TOI_pre_query)
{
- Query_log_event ev(thd, thd->wsrep_TOI_pre_query,
- thd->wsrep_TOI_pre_query_len,
+ Query_log_event ev(thd, thd->wsrep_TOI_pre_query,
+ thd->wsrep_TOI_pre_query_len,
FALSE, FALSE, FALSE, 0);
if (ev.write(&tmp_io_cache)) ret= 1;
}
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index da75c833c9e..928d3435eb9 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -1937,6 +1937,10 @@ row_ins_scan_sec_index_for_duplicate(
#ifdef UNIV_SYNC_DEBUG
ut_ad(s_latch == rw_lock_own(&index->lock, RW_LOCK_SHARED));
#endif /* UNIV_SYNC_DEBUG */
+#ifdef WITH_WSREP
+ /* appliers don't need dupkey checks */
+ if (wsrep_thd_is_BF(thr_get_trx(thr)->mysql_thd, 0)) return(DB_SUCCESS);
+#endif /* WITH_WSREP */
n_unique = dict_index_get_n_unique(index);
@@ -2005,10 +2009,6 @@ row_ins_scan_sec_index_for_duplicate(
lock_type, block, rec, index, offsets, thr);
} else {
-#ifdef WITH_WSREP
- /* appliers don't need dupkey checks */
- if (!wsrep_thd_is_BF(thr_get_trx(thr)->mysql_thd, 0))
-#endif /* WITH_WSREP */
err = row_ins_set_shared_rec_lock(
lock_type, block, rec, index, offsets, thr);
}
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 6a727e16812..7cbd91b65cd 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -365,6 +365,7 @@ wsrep_row_upd_check_foreign_constraints(
ulint n_ext;
dberr_t err;
ibool got_s_lock = FALSE;
+ ibool opened = FALSE;
if (UT_LIST_GET_FIRST(table->foreign_list) == NULL) {
@@ -412,6 +413,7 @@ wsrep_row_upd_check_foreign_constraints(
dict_table_open_on_name(
foreign->referenced_table_name_lookup,
FALSE, FALSE, DICT_ERR_IGNORE_NONE);
+ opened = TRUE;
}
if (foreign->referenced_table) {
@@ -440,6 +442,11 @@ wsrep_row_upd_check_foreign_constraints(
(foreign->referenced_table
->n_foreign_key_checks_running)--;
+ if (opened == TRUE) {
+ dict_table_close(foreign->referenced_table, TRUE, FALSE);
+ opened = FALSE;
+ }
+
mutex_exit(&(dict_sys->mutex));
}
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc
index b7ffdf5e085..69ce31e1625 100644
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@ -1949,6 +1949,10 @@ row_ins_scan_sec_index_for_duplicate(
#ifdef UNIV_SYNC_DEBUG
ut_ad(s_latch == rw_lock_own(&index->lock, RW_LOCK_SHARED));
#endif /* UNIV_SYNC_DEBUG */
+#ifdef WITH_WSREP
+ /* appliers don't need dupkey checks */
+ if (wsrep_thd_is_BF(thr_get_trx(thr)->mysql_thd, 0)) return(DB_SUCCESS);
+#endif /* WITH_WSREP */
n_unique = dict_index_get_n_unique(index);
@@ -2017,10 +2021,6 @@ row_ins_scan_sec_index_for_duplicate(
lock_type, block, rec, index, offsets, thr);
} else {
-#ifdef WITH_WSREP
- /* appliers don't need dupkey checks */
- if (!wsrep_thd_is_BF(thr_get_trx(thr)->mysql_thd, 0))
-#endif /* WITH_WSREP */
err = row_ins_set_shared_rec_lock(
lock_type, block, rec, index, offsets, thr);
}
diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc
index 57bbdb877ae..4b8dff7b47f 100644
--- a/storage/xtradb/row/row0upd.cc
+++ b/storage/xtradb/row/row0upd.cc
@@ -367,6 +367,7 @@ wsrep_row_upd_check_foreign_constraints(
ulint n_ext;
dberr_t err;
ibool got_s_lock = FALSE;
+ ibool opened = FALSE;
if (UT_LIST_GET_FIRST(table->foreign_list) == NULL) {
@@ -414,6 +415,7 @@ wsrep_row_upd_check_foreign_constraints(
dict_table_open_on_name(
foreign->referenced_table_name_lookup,
FALSE, FALSE, DICT_ERR_IGNORE_NONE);
+ opened = TRUE;
}
if (foreign->referenced_table) {
@@ -442,6 +444,11 @@ wsrep_row_upd_check_foreign_constraints(
(foreign->referenced_table
->n_foreign_key_checks_running)--;
+ if (opened == TRUE) {
+ dict_table_close(foreign->referenced_table, TRUE, FALSE);
+ opened = FALSE;
+ }
+
mutex_exit(&(dict_sys->mutex));
}