diff options
author | Nirbhay Choubey <nirbhay@skysql.com> | 2014-02-28 13:56:08 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@skysql.com> | 2014-02-28 13:56:08 -0500 |
commit | c3a2394641e2f7b199977bcf699ad64c1bb1367f (patch) | |
tree | f8867141b6f645065820a14eb74562778ca8d0e4 | |
parent | ae6e1548cbda6cb1509f84edb57786c9520a7a6e (diff) | |
download | mariadb-git-c3a2394641e2f7b199977bcf699ad64c1bb1367f.tar.gz |
* Merged revisions 3945, 3946..3950, 3951..3961
from codership-mysql/5.5.
* Merged changes in innobase to xtradb.
* Updated WSREP_PATCH_REVNO.
-rw-r--r-- | cmake/wsrep.cmake | 2 | ||||
-rw-r--r-- | mysql-test/suite/galera/galera_2nodes.cnf | 4 | ||||
-rw-r--r-- | mysql-test/suite/wsrep/t/binlog_format.opt | 2 | ||||
-rwxr-xr-x | scripts/wsrep_sst_rsync.sh | 24 | ||||
-rw-r--r-- | sql/ha_partition.cc | 8 | ||||
-rw-r--r-- | sql/ha_partition.h | 1 | ||||
-rw-r--r-- | sql/handler.cc | 44 | ||||
-rw-r--r-- | sql/log_event.cc | 7 | ||||
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | sql/sql_partition_admin.cc | 13 | ||||
-rw-r--r-- | sql/sql_truncate.cc | 12 | ||||
-rw-r--r-- | sql/wsrep_binlog.cc | 7 | ||||
-rw-r--r-- | sql/wsrep_check_opts.cc | 13 | ||||
-rw-r--r-- | sql/wsrep_hton.cc | 19 | ||||
-rw-r--r-- | sql/wsrep_mysqld.cc | 2 | ||||
-rw-r--r-- | sql/wsrep_mysqld.h | 9 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 16 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.c | 4 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 16 | ||||
-rw-r--r-- | storage/xtradb/row/row0ins.c | 4 |
20 files changed, 130 insertions, 81 deletions
diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake index 391cf505313..a5ca4508da4 100644 --- a/cmake/wsrep.cmake +++ b/cmake/wsrep.cmake @@ -23,7 +23,7 @@ SET(WSREP_PATCH_VERSION "9") # MariaDB addition: Revision number of the last revision merged from # codership branch visible in @@visible_comment. # Branch : codership-mysql/5.5 -SET(WSREP_PATCH_REVNO "3944") # Should be updated on every merge. +SET(WSREP_PATCH_REVNO "3961") # Should be updated on every merge. # MariaDB: Obtain patch revision number: # Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set. diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf index b950ae1fe4d..1ef673e9582 100644 --- a/mysql-test/suite/galera/galera_2nodes.cnf +++ b/mysql-test/suite/galera/galera_2nodes.cnf @@ -3,12 +3,12 @@ [mysqld.1] binlog-format=row -wsrep_provider=/usr/lib/libgalera_smm.so +wsrep_provider=/usr/lib/galera/libgalera_smm.so wsrep_cluster_address='gcomm://' [mysqld.2] binlog-format=row -wsrep_provider=/usr/lib/libgalera_smm.so +wsrep_provider=/usr/lib/galera/libgalera_smm.so wsrep_cluster_address='gcomm://127.0.0.1:4567' wsrep_provider_options='gmcast.listen_addr=tcp://127.0.0.1:4568' diff --git a/mysql-test/suite/wsrep/t/binlog_format.opt b/mysql-test/suite/wsrep/t/binlog_format.opt index 901ead9a41d..771d9b05e1e 100644 --- a/mysql-test/suite/wsrep/t/binlog_format.opt +++ b/mysql-test/suite/wsrep/t/binlog_format.opt @@ -1 +1 @@ ---binlog-format=row --innodb_autoinc_lock_mode=2 --innodb_locks_unsafe_for_binlog=1 --wsrep-provider=/usr/lib/libgalera_smm.so --wsrep-cluster-address=gcomm:// --wsrep-on=1 --log-bin
\ No newline at end of file +--binlog-format=row --innodb_autoinc_lock_mode=2 --innodb_locks_unsafe_for_binlog=1 --wsrep-provider=/usr/lib/galera/libgalera_smm.so --wsrep-cluster-address=gcomm:// --wsrep-on=1 --log-bin diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index b3535480c67..4b78071542c 100755 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -67,12 +67,22 @@ check_pid_and_port() MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_sst_complete" rm -rf "$MAGIC_FILE" -SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd -P) -WSREP_LOG_DIR=${WSREP_LOG_DIR:-$($SCRIPT_DIR/my_print_defaults --defaults-file "$WSREP_SST_OPT_CONF" mysqld server mysqld-5.5 \ - | grep -- '--innodb[-_]log[-_]group[-_]home[-_]dir=' | cut -b 29- )} -if [ -n "${WSREP_LOG_DIR:-""}" ]; then +WSREP_LOG_DIR=${WSREP_LOG_DIR:-""} + +# if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf +if [ -z "$WSREP_LOG_DIR" ]; then + SCRIPT_DIR="$(cd $(dirname "$0"); pwd -P)" + WSREP_LOG_DIR=$($SCRIPT_DIR/my_print_defaults --defaults-file \ + "$WSREP_SST_OPT_CONF" mysqld server mysqld-5.5 \ + | grep -- '--innodb[-_]log[-_]group[-_]home[-_]dir=' \ + | cut -b 29- ) +fi + +if [ -n "$WSREP_LOG_DIR" ]; then + # handle both relative and absolute paths WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; mkdir -p "$WSREP_LOG_DIR"; cd $WSREP_LOG_DIR; pwd -P) else + # default to datadir WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P) fi @@ -158,7 +168,7 @@ then find . -maxdepth 1 -mindepth 1 -type d -print0 | xargs -I{} -0 -P $count \ rsync --owner --group --perms --links --specials \ --ignore-times --inplace --recursive --delete --quiet \ - $WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \ + $WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \ rsync://$WSREP_SST_OPT_ADDR/{} >&2 || RC=$? popd >/dev/null @@ -208,8 +218,6 @@ then trap "exit 3" INT TERM ABRT trap cleanup_joiner EXIT - MYUID=$(id -u) - MYGID=$(id -g) RSYNC_CONF="$WSREP_SST_OPT_DATA/$MODULE.conf" cat << EOF > "$RSYNC_CONF" @@ -217,8 +225,6 @@ pid file = $RSYNC_PID use chroot = no read only = no timeout = 300 -uid = $MYUID -gid = $MYGID [$MODULE] path = $WSREP_SST_OPT_DATA [$MODULE-log_dir] diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 0d30265ce9a..25bb6f44284 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -308,7 +308,13 @@ const char *ha_partition::table_type() const // we can do this since we only support a single engine type return m_file && m_file[0] ? m_file[0]->table_type() : "Unknown"; } - +#ifdef WITH_WSREP +int ha_partition::wsrep_db_type() const +{ + // we can do this since we only support a single engine type + return ha_legacy_type(m_file[0]->ht); +} +#endif /* WITH_WSREP */ /* Destructor method diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 68ce1e47764..db8863a36b6 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1178,6 +1178,7 @@ public: for (uint i=0; i < m_tot_parts; i++) m_file[i]->ha_start_of_new_statement(); } + virtual int wsrep_db_type() const; #endif /* WITH_WSREP */ }; diff --git a/sql/handler.cc b/sql/handler.cc index 5f12a6b5c96..dc7e3cb3084 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1302,18 +1302,27 @@ int ha_commit_trans(THD *thd, bool all) if (err) { #ifdef WITH_WSREP - if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP) - { - error= 1; - /* avoid sending error, if we need to replay */ - if (thd->wsrep_conflict_state!= MUST_REPLAY) - { - my_error(ER_LOCK_DEADLOCK, MYF(0), err); - } - } - else - { - /* not wsrep hton, bail to native mysql behavior */ + if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP) + { + error= 1; + switch (err) + { + case WSREP_TRX_SIZE_EXCEEDED: + /* give user size exeeded erro from wsrep_api.h */ + my_error(ER_ERROR_DURING_COMMIT, MYF(0), WSREP_SIZE_EXCEEDED); + break; + case WSREP_TRX_CERT_FAIL: + case WSREP_TRX_ERROR: + /* avoid sending error, if we need to replay */ + if (thd->wsrep_conflict_state!= MUST_REPLAY) + { + my_error(ER_LOCK_DEADLOCK, MYF(0), err); + } + } + } + else + { + /* not wsrep hton, bail to native mysql behavior */ #endif /* WITH_WSREP */ my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); error= 1; @@ -5119,6 +5128,17 @@ static int binlog_log_row(TABLE* table, bool error= 0; THD *const thd= table->in_use; +#ifdef WITH_WSREP + /* only InnoDB tables will be replicated through binlog emulation */ + if (WSREP_EMULATE_BINLOG(thd) && + table->file->ht->db_type != DB_TYPE_INNODB && + !(table->file->ht->db_type == DB_TYPE_PARTITION_DB && + (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB))) + // !strcmp(table->file->table_type(), "InnoDB")) + { + return 0; + } +#endif /* WITH_WSREP */ if (check_table_binlog_row_based(thd, table)) { MY_BITMAP cols; diff --git a/sql/log_event.cc b/sql/log_event.cc index 9bfeaed5ac5..5d402cdeb3a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2829,7 +2829,12 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, { time_t end_time; #ifdef WITH_WSREP - thd->wsrep_PA_safe= false; + /* + If Query_log_event will contain non trans keyword (not BEGIN, COMMIT, + SAVEPOINT or ROLLBACK) we disable PA for this transaction. + */ + if (!is_trans_keyword()) + thd->wsrep_PA_safe= false; #endif /* WITH_WSREP */ memset(&user, 0, sizeof(user)); memset(&host, 0, sizeof(host)); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8ad51a03237..4703d426b51 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4883,7 +4883,7 @@ pthread_handler_t start_wsrep_THD(void *arg) mysql_mutex_lock(&LOCK_thread_count); wsrep_running_threads++; - mysql_cond_signal(&COND_thread_count); + mysql_cond_broadcast(&COND_thread_count); mysql_mutex_unlock(&LOCK_thread_count); processor(thd); @@ -4893,7 +4893,7 @@ pthread_handler_t start_wsrep_THD(void *arg) mysql_mutex_lock(&LOCK_thread_count); wsrep_running_threads--; WSREP_DEBUG("wsrep running threads now: %lu", wsrep_running_threads); - mysql_cond_signal(&COND_thread_count); + mysql_cond_broadcast(&COND_thread_count); mysql_mutex_unlock(&LOCK_thread_count); // Note: We can't call THD destructor without crashing diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index a03dcc5c16e..bb5208a16ff 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -134,6 +134,19 @@ bool Alter_table_truncate_partition_statement::execute(THD *thd) if (check_one_table_access(thd, DROP_ACL, first_table)) DBUG_RETURN(TRUE); +#ifdef WITH_WSREP + TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); + + if ((!thd->is_current_stmt_binlog_format_row() || + !find_temporary_table(thd, first_table)) && + wsrep_to_isolation_begin( + thd, first_table->db, first_table->table_name, NULL) + ) + { + WSREP_WARN("ALTER TABLE isolation failure"); + DBUG_RETURN(TRUE); + } +#endif /* WITH_WSREP */ if (open_and_lock_tables(thd, first_table, FALSE, 0)) DBUG_RETURN(TRUE); diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 22b5b676420..c018ddc8e7c 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -449,6 +449,12 @@ bool Truncate_statement::truncate_table(THD *thd, TABLE_LIST *table_ref) { bool hton_can_recreate; +#ifdef WITH_WSREP + if (WSREP(thd) && wsrep_to_isolation_begin(thd, + table_ref->db, + table_ref->table_name, NULL)) + DBUG_RETURN(TRUE); +#endif /* WITH_WSREP */ if (lock_table(thd, table_ref, &hton_can_recreate)) DBUG_RETURN(TRUE); @@ -525,12 +531,6 @@ bool Truncate_statement::execute(THD *thd) if (check_one_table_access(thd, DROP_ACL, first_table)) DBUG_RETURN(res); -#ifdef WITH_WSREP - if (WSREP(thd) && wsrep_to_isolation_begin(thd, - first_table->db, - first_table->table_name, NULL)) - DBUG_RETURN(TRUE); -#endif /* WITH_WSREP */ if (! (res= truncate_table(thd, first_table))) my_ok(thd); DBUG_RETURN(res); diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc index a0c56ce9299..933ef3dc31f 100644 --- a/sql/wsrep_binlog.cc +++ b/sql/wsrep_binlog.cc @@ -166,6 +166,7 @@ static int wsrep_write_cache_once(wsrep_t* const wsrep, { WSREP_WARN("transaction size limit (%lu) exceeded: %zu", wsrep_max_ws_size, total_length); + err = WSREP_TRX_SIZE_EXCEEDED; goto cleanup; } @@ -177,7 +178,7 @@ static int wsrep_write_cache_once(wsrep_t* const wsrep, { WSREP_ERROR("could not (re)allocate buffer: %zu + %u", allocated, length); - err = WSREP_SIZE_EXCEEDED; + err = WSREP_TRX_SIZE_EXCEEDED; goto cleanup; } @@ -232,7 +233,7 @@ static int wsrep_write_cache_inc(wsrep_t* const wsrep, if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) { WSREP_ERROR("failed to initialize io-cache"); - return WSREP_TRX_ROLLBACK; + return WSREP_TRX_ERROR; } int err(WSREP_OK); @@ -253,7 +254,7 @@ static int wsrep_write_cache_inc(wsrep_t* const wsrep, { WSREP_WARN("transaction size limit (%lu) exceeded: %zu", wsrep_max_ws_size, total_length); - err = WSREP_SIZE_EXCEEDED; + err = WSREP_TRX_SIZE_EXCEEDED; goto cleanup; } diff --git a/sql/wsrep_check_opts.cc b/sql/wsrep_check_opts.cc index ce8a46c6bd5..5ec18c79978 100644 --- a/sql/wsrep_check_opts.cc +++ b/sql/wsrep_check_opts.cc @@ -303,19 +303,6 @@ check_opts (int const argc, const char* const argv[], struct opt opts[]) } } - long long query_cache_size, query_cache_type; - if ((err = get_long_long (opts[QUERY_CACHE_SIZE], &query_cache_size, 10))) - return err; - if ((err = get_long_long (opts[QUERY_CACHE_TYPE], &query_cache_type, 10))) - return err; - - if (0 != query_cache_size && 0 != query_cache_type) - { - WSREP_ERROR ("Query cache is not supported (size=%lld type=%lld)", - query_cache_size, query_cache_type); - rcode = EINVAL; - } - bool locked_in_memory; err = get_bool (opts[LOCKED_IN_MEMORY], &locked_in_memory); if (err) { WSREP_ERROR("get_bool error: %s", strerror(err)); return err; } diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc index be60d997265..c5627ff97fb 100644 --- a/sql/wsrep_hton.cc +++ b/sql/wsrep_hton.cc @@ -139,7 +139,7 @@ wsrep_close_connection(handlerton* hton, THD* thd) - certification test or an equivalent. As a result, the current transaction just rolls back Error codes: - WSREP_TRX_ROLLBACK, WSREP_TRX_ERROR + WSREP_TRX_CERT_FAIL, WSREP_TRX_SIZE_EXCEEDED, WSREP_TRX_ERROR - a post-certification failure makes this server unable to commit its own WS and therefore the server must abort */ @@ -160,14 +160,7 @@ static int wsrep_prepare(handlerton *hton, THD *thd, bool all) !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && (thd->variables.wsrep_on && !wsrep_trans_cache_is_empty(thd))) { - switch (wsrep_run_wsrep_commit(thd, hton, all)) - { - case WSREP_TRX_OK: - break; - case WSREP_TRX_ROLLBACK: - case WSREP_TRX_ERROR: - DBUG_RETURN(1); - } + DBUG_RETURN (wsrep_run_wsrep_commit(thd, hton, all)); } DBUG_RETURN(0); } @@ -324,7 +317,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) WSREP_INFO("innobase_commit, abort %s", (thd->query()) ? thd->query() : "void"); } - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_CERT_FAIL); } mysql_mutex_lock(&LOCK_wsrep_replaying); @@ -375,7 +368,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); WSREP_DEBUG("innobase_commit abort after replaying wait %s", (thd->query()) ? thd->query() : "void"); - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_CERT_FAIL); } thd->wsrep_query_state = QUERY_COMMITTING; @@ -388,7 +381,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) rcode = wsrep_write_cache(wsrep, thd, cache, &data_len); if (WSREP_OK != rcode) { WSREP_ERROR("rbr write fail, data_len: %zu, %d", data_len, rcode); - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_SIZE_EXCEEDED); } } @@ -510,7 +503,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) } mysql_mutex_unlock(&thd->LOCK_wsrep_thd); - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_CERT_FAIL); case WSREP_CONN_FAIL: WSREP_ERROR("connection failure"); diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 708409a40f9..5867b063426 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -126,7 +126,7 @@ static void wsrep_log_cb(wsrep_log_level_t level, const char *msg) { sql_print_error("WSREP: %s", msg); break; case WSREP_LOG_DEBUG: - if (wsrep_debug) sql_print_information ("[Debug] WSREP: %s", msg); + sql_print_information ("[Debug] WSREP: %s", msg); default: break; } diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 815990ba9d4..5cf0d9dc0c5 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -232,8 +232,9 @@ extern void wsrep_ready_wait(); enum wsrep_trx_status { WSREP_TRX_OK, - WSREP_TRX_ROLLBACK, - WSREP_TRX_ERROR, + WSREP_TRX_CERT_FAIL, /* certification failure, must abort */ + WSREP_TRX_SIZE_EXCEEDED, /* trx size exceeded */ + WSREP_TRX_ERROR, /* native mysql error */ }; extern enum wsrep_trx_status @@ -269,7 +270,7 @@ extern mysql_mutex_t LOCK_wsrep_desync; extern wsrep_aborting_thd_t wsrep_aborting_thd; extern my_bool wsrep_emulate_bin_log; extern int wsrep_to_isolation; - +#ifdef HAVE_PSI_INTERFACE extern PSI_mutex_key key_LOCK_wsrep_ready; extern PSI_mutex_key key_COND_wsrep_ready; extern PSI_mutex_key key_LOCK_wsrep_sst; @@ -284,7 +285,7 @@ extern PSI_mutex_key key_LOCK_wsrep_replaying; extern PSI_cond_key key_COND_wsrep_replaying; extern PSI_mutex_key key_LOCK_wsrep_slave_threads; extern PSI_mutex_key key_LOCK_wsrep_desync; - +#endif /* HAVE_PSI_INTERFACE */ struct TABLE_LIST; int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_, const TABLE_LIST* table_list); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index de36dedff19..bb2e94cef8b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5665,7 +5665,9 @@ ha_innobase::write_row( || sql_command == SQLCOM_CREATE_INDEX #ifdef WITH_WSREP || (wsrep_on(user_thd) && wsrep_load_data_splitting && - sql_command == SQLCOM_LOAD) + sql_command == SQLCOM_LOAD && + !thd_test_options( + user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) #endif /* WITH_WSREP */ || sql_command == SQLCOM_DROP_INDEX) && num_write_row >= 10000) { @@ -5713,7 +5715,8 @@ no_commit: { case WSREP_TRX_OK: break; - case WSREP_TRX_ROLLBACK: + case WSREP_TRX_SIZE_EXCEEDED: + case WSREP_TRX_CERT_FAIL: case WSREP_TRX_ERROR: DBUG_RETURN(1); } @@ -5737,7 +5740,8 @@ no_commit: { case WSREP_TRX_OK: break; - case WSREP_TRX_ROLLBACK: + case WSREP_TRX_SIZE_EXCEEDED: + case WSREP_TRX_CERT_FAIL: case WSREP_TRX_ERROR: DBUG_RETURN(1); } @@ -7478,9 +7482,6 @@ ha_innobase::wsrep_append_keys( dict_table_get_referenced_constraint(tab, idx)) || (!tab && referenced_by_foreign_key()))) { - if (key_info->flags & HA_NOSAME || shared) - key_appended = true; - len = wsrep_store_key_val_for_row( table, i, key0, key_info->key_length, record0, &is_null); @@ -7489,6 +7490,9 @@ ha_innobase::wsrep_append_keys( thd, trx, table_share, table, keyval0, len+1, shared); if (rcode) DBUG_RETURN(rcode); + + if (key_info->flags & HA_NOSAME || shared) + key_appended = true; } else { diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c index 67cc68738a9..c5857492fc4 100644 --- a/storage/innobase/row/row0ins.c +++ b/storage/innobase/row/row0ins.c @@ -1757,6 +1757,10 @@ 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/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 696a426cdd2..8179852005e 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -6629,7 +6629,9 @@ ha_innobase::write_row( || sql_command == SQLCOM_CREATE_INDEX #ifdef WITH_WSREP || (wsrep_on(user_thd) && wsrep_load_data_splitting && - sql_command == SQLCOM_LOAD) + sql_command == SQLCOM_LOAD && + !thd_test_options( + user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) #endif /* WITH_WSREP */ || sql_command == SQLCOM_DROP_INDEX) && num_write_row >= 10000) { @@ -6677,7 +6679,8 @@ no_commit: { case WSREP_TRX_OK: break; - case WSREP_TRX_ROLLBACK: + case WSREP_TRX_SIZE_EXCEEDED: + case WSREP_TRX_CERT_FAIL: case WSREP_TRX_ERROR: DBUG_RETURN(1); } @@ -6701,7 +6704,8 @@ no_commit: { case WSREP_TRX_OK: break; - case WSREP_TRX_ROLLBACK: + case WSREP_TRX_SIZE_EXCEEDED: + case WSREP_TRX_CERT_FAIL: case WSREP_TRX_ERROR: DBUG_RETURN(1); } @@ -8521,9 +8525,6 @@ ha_innobase::wsrep_append_keys( dict_table_get_referenced_constraint(tab, idx)) || (!tab && referenced_by_foreign_key()))) { - if (key_info->flags & HA_NOSAME || shared) - key_appended = true; - len = wsrep_store_key_val_for_row( table, i, key0, key_info->key_length, record0, &is_null); @@ -8532,6 +8533,9 @@ ha_innobase::wsrep_append_keys( thd, trx, table_share, table, keyval0, len+1, shared); if (rcode) DBUG_RETURN(rcode); + + if (key_info->flags & HA_NOSAME || shared) + key_appended = true; } else { diff --git a/storage/xtradb/row/row0ins.c b/storage/xtradb/row/row0ins.c index 077730ab1ce..579d279a906 100644 --- a/storage/xtradb/row/row0ins.c +++ b/storage/xtradb/row/row0ins.c @@ -1769,6 +1769,10 @@ 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); } |