[Commits] a72d32f18de: Merge remote-tracking branch 'wsrep/10.4-wsrep_api-26' into 10.4
revision-id: a72d32f18de7f236a50dd6c63b538d6bae743cac (mariadb-10.3.6-179-ga72d32f18de) parent(s): c4a20357024aeb370056913225ba1b7e0a5d64ae 725fe316eb5df878a089261527cd5880e82902f8 author: Jan Lindström committer: Jan Lindström timestamp: 2018-10-30 13:09:47 +0200 message: Merge remote-tracking branch 'wsrep/10.4-wsrep_api-26' into 10.4 Conflicts: include/mysql/service_wsrep.h include/wsrep.h mysql-test/suite/galera/r/galera_defaults.result mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result mysql-test/suite/galera/r/galera_kill_ddl.result mysql-test/suite/galera/r/galera_kill_largechanges.result mysql-test/suite/galera/r/galera_kill_smallchanges.result mysql-test/suite/galera/r/galera_var_slave_threads.result mysql-test/suite/galera/r/galera_wan.result mysql-test/suite/galera/suite.pm mysql-test/suite/galera/t/galera_var_slave_threads.test mysql-test/suite/galera_3nodes/r/galera_pc_weight.result mysql-test/suite/galera_3nodes/t/galera_pc_weight.test sql/handler.cc sql/mysqld.cc sql/sql_alter.cc sql/sql_base.cc sql/sql_parse.cc sql/sql_plugin_services.ic sql/table_cache.cc sql/wsrep_applier.cc sql/wsrep_mysqld.cc sql/wsrep_mysqld.h sql/wsrep_sst.cc sql/wsrep_var.cc storage/innobase/handler/ha_innodb.cc .gitmodules | 4 + CMakeLists.txt | 10 +- cmake/wsrep.cmake | 13 +- extra/mariabackup/CMakeLists.txt | 2 +- extra/mariabackup/wsrep.cc | 4 +- include/mysql/service_wsrep.h | 237 +- include/thr_lock.h | 6 +- include/wsrep.h | 36 +- mysql-test/include/check-testcase.test | 46 + mysql-test/include/galera_cluster.inc | 6 + .../galera => }/include/galera_have_debug_sync.inc | 0 mysql-test/include/galera_wait_sync_point.inc | 11 + mysql-test/include/have_ipv6.inc | 20 + mysql-test/include/kill_galera.inc | 20 + mysql-test/include/mtr_warnings.sql | 46 + mysql-test/include/restart_mysqld.inc | 1 - mysql-test/include/wait_until_connected_again.inc | 2 +- mysql-test/include/wait_wsrep_ready.inc | 13 + mysql-test/include/wsrep_wait_disconnect.inc | 20 + mysql-test/lib/My/ConfigFactory.pm | 6 +- mysql-test/r/mysqld--help-notwin.result | 1472 +++++++++++ mysql-test/r/query_cache_size_functionality.result | 226 ++ mysql-test/r/query_cache_type_functionality.result | 250 ++ mysql-test/suite/galera/disabled.def | 2 +- mysql-test/suite/galera/galera_2nodes.cnf | 25 +- .../suite/galera/galera_2nodes_as_master.cnf | 12 + mysql-test/suite/galera/galera_2nodes_as_slave.cnf | 47 +- mysql-test/suite/galera/galera_3nodes_as_slave.cnf | 59 +- mysql-test/suite/galera/galera_4nodes.cnf | 15 + .../suite/galera/include/galera_load_provider.inc | 68 + mysql-test/suite/galera/include/galera_resume.inc | 2 +- .../suite/galera/include/galera_sst_restore.inc | 2 +- .../suite/galera/include/galera_st_clean_slave.inc | 1 + .../galera/include/galera_st_disconnect_slave.inc | 8 + .../galera/include/galera_unload_provider.inc | 8 + mysql-test/suite/galera/r/GAL-382.result | 2 + mysql-test/suite/galera/r/GAL-401.result | 2 + mysql-test/suite/galera/r/GAL-480.result | 2 + mysql-test/suite/galera/r/GCF-1081.result | 47 + mysql-test/suite/galera/r/GCF-939.result | 13 + mysql-test/suite/galera/r/MDEV-15443.result | 2 + mysql-test/suite/galera/r/MW-252.result | 2 + mysql-test/suite/galera/r/MW-258.result | 2 + mysql-test/suite/galera/r/MW-259.result | 2 + mysql-test/suite/galera/r/MW-284.result | 4 + mysql-test/suite/galera/r/MW-285.result | 2 + mysql-test/suite/galera/r/MW-292.result | 27 +- mysql-test/suite/galera/r/MW-309.result | 2 + mysql-test/suite/galera/r/MW-313.result | 2 + mysql-test/suite/galera/r/MW-328A.result | 18 +- mysql-test/suite/galera/r/MW-328B.result | 2 + mysql-test/suite/galera/r/MW-328C.result | 2 + mysql-test/suite/galera/r/MW-328D.result | 2 + mysql-test/suite/galera/r/MW-328E.result | 2 + mysql-test/suite/galera/r/MW-329.result | 9 +- mysql-test/suite/galera/r/MW-336.result | 2 + mysql-test/suite/galera/r/MW-357.result | 2 + mysql-test/suite/galera/r/MW-360.result | 41 + mysql-test/suite/galera/r/MW-369.result | 65 +- mysql-test/suite/galera/r/MW-388.result | 6 +- mysql-test/suite/galera/r/MW-402.result | 76 +- mysql-test/suite/galera/r/MW-416.result | 6 +- mysql-test/suite/galera/r/MW-86-wait1.result | 17 +- mysql-test/suite/galera/r/MW-86-wait8.result | 16 +- mysql-test/suite/galera/r/MW-86.result | 78 + mysql-test/suite/galera/r/basic.result | 2 + mysql-test/suite/galera/r/binlog_checksum.result | 2 + mysql-test/suite/galera/r/create.result | 2 + .../suite/galera/r/enforce_storage_engine.result | 2 + .../suite/galera/r/enforce_storage_engine2.result | 2 + mysql-test/suite/galera/r/ev51914.result | 2 + mysql-test/suite/galera/r/fk.result | 2 + mysql-test/suite/galera/r/galera#414.result | 2 + mysql-test/suite/galera/r/galera#500.result | 6 + mysql-test/suite/galera/r/galera_admin.result | 2 + .../galera/r/galera_alter_engine_innodb.result | 2 + .../galera/r/galera_alter_engine_myisam.result | 2 + .../suite/galera/r/galera_alter_table_force.result | 2 + .../galera/r/galera_applier_ftwrl_table.result | 2 + .../r/galera_applier_ftwrl_table_alter.result | 2 + mysql-test/suite/galera/r/galera_as_master.result | 4 + .../suite/galera/r/galera_as_master_gtid.result | 44 +- .../suite/galera/r/galera_as_master_large.result | 2 + .../suite/galera/r/galera_as_slave_autoinc.result | 4 + .../suite/galera/r/galera_as_slave_gtid.result | 2 + .../r/galera_as_slave_gtid_replicate_do_db.result | 160 ++ .../galera_as_slave_gtid_replicate_do_db_cc.result | 315 +++ .../suite/galera/r/galera_as_slave_nonprim.result | 18 + .../galera/r/galera_autoinc_sst_xtrabackup.result | 2 + mysql-test/suite/galera/r/galera_bf_abort.result | 4 +- .../r/galera_bf_abort_flush_for_export.result | 2 + .../galera/r/galera_bf_abort_for_update.result | 6 +- .../suite/galera/r/galera_bf_abort_ftwrl.result | 2 + .../suite/galera/r/galera_bf_abort_get_lock.result | 4 +- .../galera/r/galera_bf_abort_group_commit.result | 685 +++++ .../galera/r/galera_bf_abort_lock_table.result | 2 + .../suite/galera/r/galera_bf_abort_shutdown.result | 9 + .../suite/galera/r/galera_bf_abort_sleep.result | 4 +- .../r/galera_bf_background_statistics.result | 4 +- .../suite/galera/r/galera_bf_lock_wait.result | 2 + .../suite/galera/r/galera_binlog_cache_size.result | 2 + .../suite/galera/r/galera_binlog_checksum.result | 2 + .../r/galera_binlog_event_max_size_max.result | 2 + .../r/galera_binlog_event_max_size_min.result | 2 + .../suite/galera/r/galera_binlog_row_image.result | 2 + .../suite/galera/r/galera_commit_empty.result | 15 + .../suite/galera/r/galera_create_function.result | 2 + .../suite/galera/r/galera_create_procedure.result | 2 + .../galera/r/galera_create_table_as_select.result | 103 + .../suite/galera/r/galera_create_table_like.result | 2 + .../suite/galera/r/galera_create_trigger.result | 2 + .../suite/galera/r/galera_ddl_multiline.result | 2 + mysql-test/suite/galera/r/galera_defaults.result | 18 +- .../suite/galera/r/galera_delete_limit.result | 2 + .../suite/galera/r/galera_desync_overlapped.result | 2 + mysql-test/suite/galera/r/galera_drop_multi.result | 2 + .../suite/galera/r/galera_encrypt_tmp_files.result | 2 + mysql-test/suite/galera/r/galera_enum.result | 4 +- mysql-test/suite/galera/r/galera_events.result | 2 + .../suite/galera/r/galera_fk_cascade_delete.result | 2 + .../suite/galera/r/galera_fk_cascade_update.result | 2 + .../suite/galera/r/galera_fk_conflict.result | 4 +- .../suite/galera/r/galera_fk_mismatch.result | 2 + .../suite/galera/r/galera_fk_multicolumn.result | 2 + .../suite/galera/r/galera_fk_multitable.result | 2 + mysql-test/suite/galera/r/galera_fk_no_pk.result | 2 + .../galera/r/galera_fk_selfreferential.result | 2 + mysql-test/suite/galera/r/galera_fk_setnull.result | 2 + .../suite/galera/r/galera_flush_local.result | 2 + .../galera/r/galera_forced_binlog_format.result | 20 +- mysql-test/suite/galera/r/galera_ftwrl.result | 2 + .../suite/galera/r/galera_ftwrl_drain.result | 2 + mysql-test/suite/galera/r/galera_fulltext.result | 2 + .../r/galera_gcache_recover_full_gcache.result | 2 +- .../suite/galera/r/galera_gcs_fc_limit.result | 2 + .../suite/galera/r/galera_gcs_fragment.result | 2 +- .../galera/r/galera_gcs_max_packet_size.result | 2 + mysql-test/suite/galera/r/galera_gra_log.result | 2 + mysql-test/suite/galera/r/galera_gtid.result | 2 + mysql-test/suite/galera/r/galera_gtid_slave.result | 11 +- .../galera/r/galera_gtid_slave_sst_rsync.result | 106 +- .../suite/galera/r/galera_insert_ignore.result | 2 + .../suite/galera/r/galera_insert_multi.result | 4 +- .../galera/r/galera_ist_innodb_flush_logs.result | 22 + .../suite/galera/r/galera_ist_progress.result | 5 + .../suite/galera/r/galera_ist_recv_bind.result | 2 + .../galera/r/galera_ist_restart_joiner.result | 3 +- mysql-test/suite/galera/r/galera_ist_rsync.result | 2 + .../suite/galera/r/galera_ist_xtrabackup-v2.result | 38 + mysql-test/suite/galera/r/galera_kill_ddl.result | 3 +- .../suite/galera/r/galera_kill_largechanges.result | 3 +- .../suite/galera/r/galera_kill_smallchanges.result | 3 +- mysql-test/suite/galera/r/galera_lock_table.result | 2 + mysql-test/suite/galera/r/galera_log_bin.result | 4 + .../suite/galera/r/galera_log_output_csv.result | 2 + .../suite/galera/r/galera_many_columns.result | 4 +- .../suite/galera/r/galera_many_indexes.result | 4 +- mysql-test/suite/galera/r/galera_many_rows.result | 4 +- .../suite/galera/r/galera_many_tables_nopk.result | 4 +- .../suite/galera/r/galera_many_tables_pk.result | 4 +- mysql-test/suite/galera/r/galera_mdev_10812.result | 2 + mysql-test/suite/galera/r/galera_mdev_13787.result | 2 + mysql-test/suite/galera/r/galera_mdl_race.result | 4 +- .../suite/galera/r/galera_multi_database.result | 2 + .../suite/galera/r/galera_myisam_autocommit.result | 2 + .../galera/r/galera_myisam_transactions.result | 2 + mysql-test/suite/galera/r/galera_nopk_bit.result | 4 +- mysql-test/suite/galera/r/galera_nopk_blob.result | 4 +- .../galera/r/galera_nopk_large_varchar.result | 4 +- .../suite/galera/r/galera_nopk_unicode.result | 4 +- .../r/galera_parallel_apply_lock_table.result | 8 +- .../r/galera_parallel_autoinc_largetrx.result | 4 +- .../r/galera_parallel_autoinc_manytrx.result | 4 +- .../suite/galera/r/galera_parallel_simple.result | 2 + .../suite/galera/r/galera_pk_bigint_signed.result | 4 +- .../galera/r/galera_pk_bigint_unsigned.result | 4 +- .../galera/r/galera_prepared_statement.result | 2 + .../suite/galera/r/galera_query_cache.result | 2 + .../galera/r/galera_query_cache_sync_wait.result | 2 + mysql-test/suite/galera/r/galera_read_only.result | 2 + .../galera/r/galera_repl_key_format_flat16.result | 2 + .../suite/galera/r/galera_repl_max_ws_size.result | 4 +- .../suite/galera/r/galera_restart_nochanges.result | 2 + .../r/galera_restart_on_unknown_option.result | 2 + mysql-test/suite/galera/r/galera_rsu_add_pk.result | 2 + .../suite/galera/r/galera_rsu_drop_pk.result | 2 + mysql-test/suite/galera/r/galera_rsu_error.result | 2 + mysql-test/suite/galera/r/galera_rsu_simple.result | 2 + .../suite/galera/r/galera_rsu_wsrep_desync.result | 2 + mysql-test/suite/galera/r/galera_sbr.result | 2 + mysql-test/suite/galera/r/galera_sbr_binlog.result | 2 + .../galera/r/galera_schema_dirty_reads.result | 2 + .../suite/galera/r/galera_serializable.result | 8 +- mysql-test/suite/galera/r/galera_server.result | 2 + .../suite/galera/r/galera_sql_log_bin_zero.result | 2 + mysql-test/suite/galera/r/galera_ssl.result | 2 + .../suite/galera/r/galera_ssl_compression.result | 2 + .../suite/galera/r/galera_sst_mysqldump.result | 114 + mysql-test/suite/galera/r/galera_sst_rsync.result | 2 +- .../galera/r/galera_sst_rsync_data_dir.result | 2 + .../suite/galera/r/galera_sst_xtrabackup-v2.result | 110 + ...alera_sst_xtrabackup-v2_encrypt_with_key.result | 2 + .../suite/galera/r/galera_status_cluster.result | 2 + .../galera/r/galera_status_local_index.result | 2 + .../galera/r/galera_status_local_state.result | 2 + .../suite/galera/r/galera_suspend_slave.result | 2 + .../suite/galera/r/galera_sync_wait_show.result | 2 + .../r/galera_toi_alter_auto_increment.result | 2 + .../suite/galera/r/galera_toi_ddl_error.result | 5 + .../suite/galera/r/galera_toi_ddl_fk_update.result | 2 + .../suite/galera/r/galera_toi_ddl_locking.result | 32 +- .../galera/r/galera_toi_ddl_nonconflicting.result | 2 + .../galera/r/galera_toi_ddl_sequential.result | 2 + .../suite/galera/r/galera_toi_drop_database.result | 6 +- mysql-test/suite/galera/r/galera_toi_ftwrl.result | 2 + .../galera/r/galera_toi_lock_exclusive.result | 4 +- .../suite/galera/r/galera_toi_lock_shared.result | 2 + .../suite/galera/r/galera_toi_truncate.result | 4 +- .../galera/r/galera_transaction_read_only.result | 2 + .../galera/r/galera_transaction_replay.result | 96 +- mysql-test/suite/galera/r/galera_truncate.result | 2 + .../galera/r/galera_truncate_temporary.result | 2 + .../galera/r/galera_unicode_identifiers.result | 2 + mysql-test/suite/galera/r/galera_unicode_pk.result | 6 +- .../suite/galera/r/galera_update_limit.result | 2 + .../suite/galera/r/galera_v1_row_events.result | 2 + .../suite/galera/r/galera_var_OSU_method.result | 2 + .../suite/galera/r/galera_var_OSU_method2.result | 2 + .../r/galera_var_auto_inc_control_off.result | 4 +- .../galera/r/galera_var_auto_inc_control_on.result | 2 + .../galera/r/galera_var_certify_nonPK_off.result | 2 + .../galera/r/galera_var_cluster_address.result | 8 +- .../suite/galera/r/galera_var_desync_on.result | 2 + .../suite/galera/r/galera_var_dirty_reads.result | 4 +- .../suite/galera/r/galera_var_fkchecks.result | 2 + .../galera/r/galera_var_gtid_domain_id.result | 2 + .../galera/r/galera_var_ignore_apply_errors.result | 154 ++ .../r/galera_var_innodb_disallow_writes.result | 2 + .../galera/r/galera_var_load_data_splitting.result | 2 + .../suite/galera/r/galera_var_log_bin.result | 2 + .../suite/galera/r/galera_var_max_ws_rows.result | 2 + .../suite/galera/r/galera_var_max_ws_size.result | 4 +- .../r/galera_var_mysql_replication_bundle.result | 2 + .../suite/galera/r/galera_var_node_address.result | 2 + .../galera/r/galera_var_reject_queries.result | 2 + .../r/galera_var_replicate_myisam_off.result | 2 + .../galera/r/galera_var_replicate_myisam_on.result | 2 + .../suite/galera/r/galera_var_slave_threads.result | 207 +- .../suite/galera/r/galera_var_sst_auth.result | 2 + .../suite/galera/r/galera_var_sync_wait.result | 2 + .../suite/galera/r/galera_var_wsrep_on_off.result | 2 + mysql-test/suite/galera/r/galera_wan.result | 6 +- .../suite/galera/r/galera_wan_restart_ist.result | 2 + .../suite/galera/r/galera_wan_restart_sst.result | 2 + .../galera/r/galera_wsrep_desync_wsrep_on.result | 2 + .../galera/r/galera_wsrep_log_conficts.result | 4 +- .../suite/galera/r/galera_wsrep_new_cluster.result | 2 + .../r/galera_wsrep_provider_options_syntax.result | 2 + .../galera/r/galera_zero_length_column.result | 2 + mysql-test/suite/galera/r/grant.result | 2 + mysql-test/suite/galera/r/lp1276424.result | 2 + mysql-test/suite/galera/r/lp1347768.result | 2 + mysql-test/suite/galera/r/lp1376747-2.result | 2 + mysql-test/suite/galera/r/lp1376747-3.result | 2 + mysql-test/suite/galera/r/lp1376747-4.result | 2 + mysql-test/suite/galera/r/lp1376747.result | 2 + mysql-test/suite/galera/r/lp1438990.result | 2 + mysql-test/suite/galera/r/lp959512.result | 2 + mysql-test/suite/galera/r/mdev_10518.result | 2 + mysql-test/suite/galera/r/mdev_9290.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#110.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#198.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#201.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#216.result | 11 + mysql-test/suite/galera/r/mysql-wsrep#237.result | 4 +- mysql-test/suite/galera/r/mysql-wsrep#247.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#31.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#90.result | 2 + mysql-test/suite/galera/r/partition.result | 6 +- mysql-test/suite/galera/r/pxc-421.result | 2 + mysql-test/suite/galera/r/query_cache.result | 2 + mysql-test/suite/galera/r/rename.result | 2 + mysql-test/suite/galera/r/rpl_row_annotate.result | 8 +- mysql-test/suite/galera/r/sql_log_bin.result | 2 + mysql-test/suite/galera/r/unique_key.result | 2 + mysql-test/suite/galera/r/view.result | 2 + .../galera/r/wsrep_trx_fragment_size_non_sr.result | 25 + .../galera/r/wsrep_trx_fragment_size_sr.result | 15 + mysql-test/suite/galera/suite.pm | 2 + mysql-test/suite/galera/t/GAL-419.test | 4 +- mysql-test/suite/galera/t/GCF-1081.test | 72 + mysql-test/suite/galera/t/GCF-939.test | 31 + mysql-test/suite/galera/t/MW-284.test | 2 + mysql-test/suite/galera/t/MW-292.test | 50 +- mysql-test/suite/galera/t/MW-328A.test | 40 +- mysql-test/suite/galera/t/MW-329.test | 28 +- mysql-test/suite/galera/t/MW-336.test | 9 +- mysql-test/suite/galera/t/MW-360-master.opt | 2 + mysql-test/suite/galera/t/MW-360.test | 100 + mysql-test/suite/galera/t/MW-369.inc | 7 +- mysql-test/suite/galera/t/MW-369.test | 1 - mysql-test/suite/galera/t/MW-388.test | 5 +- mysql-test/suite/galera/t/MW-402.test | 56 +- mysql-test/suite/galera/t/MW-416.test | 8 +- mysql-test/suite/galera/t/MW-86-master.opt | 1 + mysql-test/suite/galera/t/MW-86-wait1.test | 13 +- mysql-test/suite/galera/t/MW-86-wait8.test | 11 +- mysql-test/suite/galera/t/MW-86.test | 193 ++ mysql-test/suite/galera/t/disabled.def | 13 + .../t/galera_applier_ftwrl_table_alter-master.opt | 2 +- mysql-test/suite/galera/t/galera_as_master.test | 2 + .../suite/galera/t/galera_as_master_gtid.cnf | 2 - .../suite/galera/t/galera_as_master_gtid.test | 24 +- .../t/galera_as_master_gtid_change_master.cnf | 2 - .../t/galera_as_master_gtid_change_master.test | 2 + mysql-test/suite/galera/t/galera_as_slave.test | 19 +- .../suite/galera/t/galera_as_slave_autoinc.test | 20 +- .../suite/galera/t/galera_as_slave_gtid.test | 21 +- .../t/galera_as_slave_gtid_replicate_do_db.cnf | 17 + .../t/galera_as_slave_gtid_replicate_do_db.test | 150 ++ .../t/galera_as_slave_gtid_replicate_do_db_cc.test | 176 ++ .../suite/galera/t/galera_as_slave_nonprim.test | 28 +- .../suite/galera/t/galera_as_slave_preordered.test | 19 +- .../t/galera_as_slave_replication_bundle.test | 13 +- .../galera/t/galera_autoinc_sst_xtrabackup.cnf | 2 +- .../galera/t/galera_bf_abort_group_commit.cnf | 15 + .../galera/t/galera_bf_abort_group_commit.test | 76 + .../suite/galera/t/galera_bf_abort_shutdown.test | 22 + mysql-test/suite/galera/t/galera_commit_empty.test | 35 + .../galera/t/galera_create_table_as_select.test | 145 ++ mysql-test/suite/galera/t/galera_defaults.test | 4 +- .../galera/t/galera_forced_binlog_format.test | 5 +- mysql-test/suite/galera/t/galera_ftwrl_drain.test | 2 +- .../t/galera_gcache_recover_full_gcache.test | 4 +- mysql-test/suite/galera/t/galera_gcs_fragment.test | 4 +- mysql-test/suite/galera/t/galera_gtid-master.opt | 2 +- mysql-test/suite/galera/t/galera_gtid_slave.test | 14 + .../galera/t/galera_gtid_slave_sst_rsync.test | 109 +- .../galera/t/galera_ist_innodb_flush_logs.cnf | 2 +- mysql-test/suite/galera/t/galera_ist_progress.test | 4 +- .../suite/galera/t/galera_ist_restart_joiner.test | 2 +- .../suite/galera/t/galera_ist_xtrabackup-v2.cnf | 2 +- mysql-test/suite/galera/t/galera_kill_applier.test | 1 - mysql-test/suite/galera/t/galera_log_bin.test | 2 + mysql-test/suite/galera/t/galera_migrate.cnf | 2 + .../galera/t/galera_parallel_apply_lock_table.test | 6 +- .../galera/t/galera_parallel_autoinc_manytrx.test | 2 +- .../suite/galera/t/galera_parallel_simple.test | 2 +- mysql-test/suite/galera/t/galera_pc_recovery.test | 93 + mysql-test/suite/galera/t/galera_split_brain.test | 6 +- mysql-test/suite/galera/t/galera_ssl_upgrade.test | 4 + mysql-test/suite/galera/t/galera_sst_mysqldump.cnf | 6 +- .../suite/galera/t/galera_sst_mysqldump.test | 3 +- .../galera/t/galera_sst_mysqldump_with_key.cnf | 4 + .../galera/t/galera_sst_xtrabackup-v2-options.cnf | 2 +- .../suite/galera/t/galera_sst_xtrabackup-v2.cnf | 2 +- .../galera_sst_xtrabackup-v2_encrypt_with_key.cnf | 2 +- .../suite/galera/t/galera_toi_ddl_error.test | 5 + .../suite/galera/t/galera_toi_ddl_locking.test | 53 +- .../suite/galera/t/galera_transaction_replay.test | 201 +- .../suite/galera/t/galera_var_cluster_address.test | 11 +- .../suite/galera/t/galera_var_dirty_reads.test | 6 +- .../galera/t/galera_var_ignore_apply_errors.test | 235 ++ mysql-test/suite/galera/t/galera_var_log_bin.cnf | 5 + .../galera/t/galera_var_retry_autocommit.test | 18 +- .../suite/galera/t/galera_var_slave_threads.test | 121 +- .../galera/t/galera_vote_drop_temporary-master.opt | 1 + .../suite/galera/t/galera_wsrep_new_cluster.test | 1 - .../suite/galera/t/mysql-wsrep#198-master.opt | 1 + mysql-test/suite/galera/t/mysql-wsrep#237.test | 4 +- mysql-test/suite/galera/t/partition.test | 16 +- mysql-test/suite/galera/t/rpl_row_annotate.test | 6 +- .../galera/t/wsrep_trx_fragment_size_non_sr.test | 26 + .../suite/galera/t/wsrep_trx_fragment_size_sr.test | 22 + mysql-test/suite/galera_3nodes/galera_3nodes.cnf | 1 + .../suite/galera_3nodes/include/galera_suspend.inc | 2 +- .../r/galera_certification_ccc.result | 2 + .../r/galera_certification_double_failure.result | 5 +- .../r/galera_ipv6_xtrabackup-v2.result | 3 - .../r/galera_ist_gcache_rollover.result | 2 + .../r/galera_parallel_apply_3nodes.result | 4 +- .../galera_3nodes/r/galera_pc_bootstrap.result | 13 + .../suite/galera_3nodes/r/galera_pc_weight.result | 4 - .../galera_3nodes/r/galera_wsrep_schema.result | 77 + mysql-test/suite/galera_3nodes/t/GAL-501.test | 6 + .../t/galera_certification_double_failure.test | 2 + .../t/galera_evs_suspect_timeout.test | 6 +- mysql-test/suite/galera_3nodes/t/galera_garbd.test | 5 +- .../galera_3nodes/t/galera_ipv6_mysqldump.cnf | 6 + .../galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf | 4 + .../galera_3nodes/t/galera_ipv6_xtrabackup-v2.test | 30 +- .../t/galera_ist_gcache_rollover.test | 2 +- .../t/galera_parallel_apply_3nodes.test | 2 +- .../suite/galera_3nodes/t/galera_pc_weight.cnf | 8 +- .../suite/galera_3nodes/t/galera_pc_weight.test | 29 +- .../t/galera_slave_options_ignore.test | 1 + .../suite/galera_3nodes/t/galera_wsrep_schema.test | 74 + .../suite/galera_3nodes_ee/galera_3nodes.cnf | 1 + .../include/galera_check_voting_recovery.inc | 58 + mysql-test/suite/galera_3nodes_ee/my.cnf | 1 + mysql-test/suite/galera_3nodes_ee/r/GCF-354.result | 23 + mysql-test/suite/galera_3nodes_ee/r/GCF-361.result | 16 + mysql-test/suite/galera_3nodes_ee/r/GCF-363.result | 31 + mysql-test/suite/galera_3nodes_ee/r/GCF-376.result | 48 + .../galera_3nodes_ee/r/galera-features#115.result | 21 + .../galera_3nodes_ee/r/galera-features#119.result | 19 + .../galera_3nodes_ee/r/galera-features#79.result | 32 + .../r/galera_nbo_kill_master.result | 27 + .../r/galera_nbo_kill_slave_ist.result | 35 + .../r/galera_nbo_kill_slave_sst.result | 33 + .../r/galera_nbo_master_majority_failure.result | 46 + .../r/galera_nbo_master_majority_success.result | 50 + .../r/galera_nbo_master_minority_failure.result | 52 + .../r/galera_nbo_master_minority_success.result | 52 + .../r/galera_nbo_master_non_prim_failure.result | 42 + .../r/galera_nbo_master_non_prim_success.result | 32 + .../r/galera_nbo_shutdown_slave_ist.result | 28 + .../r/galera_nbo_slave_non_prim.result | 35 + .../galera_3nodes_ee/r/galera_toi_vote.result | 19 + .../r/galera_vote_rejoin_mysqldump.result | 60 + .../suite/galera_3nodes_ee/r/galera_vote_sr.result | 52 + .../r/mysql-wsrep-features#131.result | 12 + mysql-test/suite/galera_3nodes_ee/t/GCF-354.cnf | 4 + mysql-test/suite/galera_3nodes_ee/t/GCF-354.test | 59 + mysql-test/suite/galera_3nodes_ee/t/GCF-361.cnf | 4 + mysql-test/suite/galera_3nodes_ee/t/GCF-361.test | 47 + mysql-test/suite/galera_3nodes_ee/t/GCF-363.cnf | 8 + mysql-test/suite/galera_3nodes_ee/t/GCF-363.test | 68 + mysql-test/suite/galera_3nodes_ee/t/GCF-376.cnf | 4 + mysql-test/suite/galera_3nodes_ee/t/GCF-376.test | 84 + .../galera_3nodes_ee/t/galera-features#115.cnf | 4 + .../galera_3nodes_ee/t/galera-features#115.test | 67 + .../galera_3nodes_ee/t/galera-features#119.test | 61 + .../galera_3nodes_ee/t/galera-features#79.test | 75 + .../galera_3nodes_ee/t/galera_nbo_kill_master.test | 73 + .../t/galera_nbo_kill_slave_ist.test | 73 + .../t/galera_nbo_kill_slave_sst.cnf | 11 + .../t/galera_nbo_kill_slave_sst.test | 70 + .../t/galera_nbo_master_majority_failure.cnf | 4 + .../t/galera_nbo_master_majority_failure.test | 38 + .../t/galera_nbo_master_majority_success.cnf | 4 + .../t/galera_nbo_master_majority_success.test | 38 + .../t/galera_nbo_master_minority_failure.cnf | 4 + .../t/galera_nbo_master_minority_failure.test | 35 + .../t/galera_nbo_master_minority_success.cnf | 4 + .../t/galera_nbo_master_minority_success.test | 41 + .../t/galera_nbo_master_non_prim_failure.test | 92 + .../t/galera_nbo_master_non_prim_success.test | 80 + .../t/galera_nbo_shutdown_slave_ist.test | 66 + .../t/galera_nbo_slave_non_prim.test | 69 + .../suite/galera_3nodes_ee/t/galera_toi_vote.cnf | 4 + .../suite/galera_3nodes_ee/t/galera_toi_vote.test | 63 + .../t/galera_vote_rejoin_mysqldump.cnf | 4 + .../t/galera_vote_rejoin_mysqldump.test | 80 + .../galera_3nodes_ee/t/galera_vote_sr-master.opt | 2 + .../suite/galera_3nodes_ee/t/galera_vote_sr.test | 87 + .../t/mysql-wsrep-features#131.test | 39 + .../suite/galera_3nodes_sr/galera_3nodes.cnf | 1 + mysql-test/suite/galera_3nodes_sr/my.cnf | 1 + mysql-test/suite/galera_3nodes_sr/r/GCF-336.result | 26 + mysql-test/suite/galera_3nodes_sr/r/GCF-582.result | 23 + mysql-test/suite/galera_3nodes_sr/r/GCF-606.result | 23 + mysql-test/suite/galera_3nodes_sr/r/GCF-609.result | 20 + .../suite/galera_3nodes_sr/r/GCF-810A.result | 256 ++ .../suite/galera_3nodes_sr/r/GCF-810B.result | 100 + .../suite/galera_3nodes_sr/r/GCF-810C.result | 177 ++ mysql-test/suite/galera_3nodes_sr/r/GCF-817.result | 33 + mysql-test/suite/galera_3nodes_sr/r/GCF-832.result | 15 + .../r/galera_sr_isolate_master.result | 62 + .../galera_3nodes_sr/r/galera_sr_join_slave.result | 25 + .../r/galera_sr_kill_master.result | 22 + .../r/galera_sr_kill_slave_after_apply.result | 38 + ...alera_sr_kill_slave_after_apply_rollback.result | 44 + ...lera_sr_kill_slave_after_apply_rollback2.result | 31 + .../r/galera_sr_kill_slave_before_apply.result | 27 + .../r/galera_sr_threeway_split.result | 84 + mysql-test/suite/galera_3nodes_sr/t/GCF-336.test | 47 + mysql-test/suite/galera_3nodes_sr/t/GCF-582.test | 39 + mysql-test/suite/galera_3nodes_sr/t/GCF-606.test | 80 + mysql-test/suite/galera_3nodes_sr/t/GCF-609.test | 30 + mysql-test/suite/galera_3nodes_sr/t/GCF-810A.test | 137 + mysql-test/suite/galera_3nodes_sr/t/GCF-810B.test | 49 + mysql-test/suite/galera_3nodes_sr/t/GCF-810C.test | 70 + mysql-test/suite/galera_3nodes_sr/t/GCF-817.test | 101 + mysql-test/suite/galera_3nodes_sr/t/GCF-832.test | 36 + mysql-test/suite/galera_3nodes_sr/t/disabled.def | 0 .../t/galera_sr_isolate_master.test | 127 + .../galera_3nodes_sr/t/galera_sr_join_slave.test | 56 + .../galera_3nodes_sr/t/galera_sr_kill_master.test | 56 + .../t/galera_sr_kill_slave_after_apply.test | 75 + .../galera_sr_kill_slave_after_apply_rollback.test | 76 + ...galera_sr_kill_slave_after_apply_rollback2.test | 56 + .../t/galera_sr_kill_slave_before_apply.test | 71 + .../t/galera_sr_threeway_split.cnf | 5 + .../t/galera_sr_threeway_split.test | 169 ++ mysql-test/suite/galera_ee/galera_2nodes.cnf | 1 + mysql-test/suite/galera_ee/galera_4nodes.cnf | 1 + mysql-test/suite/galera_ee/my.cnf | 1 + mysql-test/suite/galera_ee/r/GCF-329A.result | 30 + mysql-test/suite/galera_ee/r/GCF-329B.result | 16 + mysql-test/suite/galera_ee/r/GCF-360.result | 416 ++++ mysql-test/suite/galera_ee/r/GCF-421.result | 14 + mysql-test/suite/galera_ee/r/GCF-546.result | 28 + mysql-test/suite/galera_ee/r/GCF-563.result | 52 + mysql-test/suite/galera_ee/r/GCF-849.result | 11 + mysql-test/suite/galera_ee/r/GCF-854.result | 16 + .../suite/galera_ee/r/galera-features#117.result | 29 + .../r/galera_nbo_alter_conflicting.result | 14 + .../suite/galera_ee/r/galera_nbo_alter_copy.result | 44 + .../galera_ee/r/galera_nbo_alter_engine.result | 22 + .../r/galera_nbo_alter_error_duplicate.result | 30 + .../galera_ee/r/galera_nbo_alter_exclusive.result | 37 + .../galera_ee/r/galera_nbo_alter_inplace.result | 39 + .../galera_ee/r/galera_nbo_alter_multi.result | 11 + .../r/galera_nbo_alter_nonconflicting.result | 29 + .../galera_ee/r/galera_nbo_alter_parallel.result | 45 + .../galera_ee/r/galera_nbo_alter_partition.result | 26 + .../galera_ee/r/galera_nbo_alter_rename.result | 19 + .../suite/galera_ee/r/galera_nbo_alter_toi.result | 38 + .../galera_ee/r/galera_nbo_create_index.result | 36 + .../suite/galera_ee/r/galera_nbo_ddl_error.result | 22 + .../galera_ee/r/galera_nbo_error_on_all.result | 13 + .../suite/galera_ee/r/galera_nbo_local_mdl.result | 12 + .../galera_ee/r/galera_nbo_processlist.result | 35 + .../suite/galera_ee/r/galera_nbo_sst_slave.result | 23 + .../galera_ee/r/galera_nbo_temporary_table.result | 14 + .../galera_ee/r/galera_nbo_unsupported.result | 26 + .../galera_ee/r/galera_vote_rejoin_ddl.result | 44 + .../galera_ee/r/galera_vote_rejoin_dml.result | 47 + .../galera_ee/r/mysql-wsrep-features#127.result | 5 + .../galera_ee/r/mysql-wsrep-features#128.result | 7 + .../galera_ee/r/mysql-wsrep-features#131.result | 12 + .../galera_ee/r/mysql-wsrep-features#132.result | 18 + mysql-test/suite/galera_ee/t/GCF-329A.test | 42 + mysql-test/suite/galera_ee/t/GCF-329B.test | 53 + mysql-test/suite/galera_ee/t/GCF-360.cnf | 17 + mysql-test/suite/galera_ee/t/GCF-360.test | 64 + mysql-test/suite/galera_ee/t/GCF-421.test | 46 + mysql-test/suite/galera_ee/t/GCF-546.test | 47 + mysql-test/suite/galera_ee/t/GCF-563.test | 63 + mysql-test/suite/galera_ee/t/GCF-849.test | 39 + mysql-test/suite/galera_ee/t/GCF-854.test | 42 + .../suite/galera_ee/t/galera-features#117.cnf | 4 + .../suite/galera_ee/t/galera-features#117.test | 37 + .../galera_ee/t/galera_nbo_alter_conflicting.test | 57 + .../suite/galera_ee/t/galera_nbo_alter_copy.test | 67 + .../suite/galera_ee/t/galera_nbo_alter_engine.test | 31 + .../t/galera_nbo_alter_error_duplicate.test | 34 + .../galera_ee/t/galera_nbo_alter_exclusive.test | 64 + .../galera_ee/t/galera_nbo_alter_inplace.test | 67 + .../suite/galera_ee/t/galera_nbo_alter_multi.test | 15 + .../t/galera_nbo_alter_nonconflicting.test | 57 + .../galera_ee/t/galera_nbo_alter_parallel.test | 65 + .../galera_ee/t/galera_nbo_alter_partition.test | 29 + .../suite/galera_ee/t/galera_nbo_alter_rename.test | 31 + .../suite/galera_ee/t/galera_nbo_alter_toi.test | 53 + .../suite/galera_ee/t/galera_nbo_create_index.test | 34 + .../suite/galera_ee/t/galera_nbo_ddl_error.test | 38 + .../suite/galera_ee/t/galera_nbo_error_on_all.test | 21 + .../suite/galera_ee/t/galera_nbo_local_mdl.test | 55 + .../suite/galera_ee/t/galera_nbo_processlist.test | 81 + .../suite/galera_ee/t/galera_nbo_sst_slave.test | 89 + .../t/galera_nbo_temporary_table-master.opt | 2 + .../galera_ee/t/galera_nbo_temporary_table.test | 37 + .../suite/galera_ee/t/galera_nbo_unsupported.test | 42 + .../suite/galera_ee/t/galera_vote_rejoin_ddl.cnf | 5 + .../suite/galera_ee/t/galera_vote_rejoin_ddl.test | 87 + .../suite/galera_ee/t/galera_vote_rejoin_dml.cnf | 4 + .../suite/galera_ee/t/galera_vote_rejoin_dml.test | 91 + .../galera_ee/t/mysql-wsrep-features#127.test | 16 + .../t/mysql-wsrep-features#128-master.opt | 1 + .../galera_ee/t/mysql-wsrep-features#128.test | 11 + .../galera_ee/t/mysql-wsrep-features#131.test | 38 + .../galera_ee/t/mysql-wsrep-features#132.test | 39 + mysql-test/suite/galera_sr/galera_2nodes.cnf | 1 + mysql-test/suite/galera_sr/my.cnf | 1 + mysql-test/suite/galera_sr/r/GCF-1008.result | 70 + mysql-test/suite/galera_sr/r/GCF-1018.result | 15 + mysql-test/suite/galera_sr/r/GCF-1018B.result | 8 + mysql-test/suite/galera_sr/r/GCF-1043A.result | 21 + mysql-test/suite/galera_sr/r/GCF-1043B.result | 15 + mysql-test/suite/galera_sr/r/GCF-1051.result | 46 + mysql-test/suite/galera_sr/r/GCF-1060.result | 15 + mysql-test/suite/galera_sr/r/GCF-437.result | 12 + mysql-test/suite/galera_sr/r/GCF-561.result | 42 + mysql-test/suite/galera_sr/r/GCF-571.result | 67 + mysql-test/suite/galera_sr/r/GCF-572.result | 37 + mysql-test/suite/galera_sr/r/GCF-574.result | 11 + mysql-test/suite/galera_sr/r/GCF-580.result | 13 + mysql-test/suite/galera_sr/r/GCF-585.result | 25 + mysql-test/suite/galera_sr/r/GCF-597.result | 15 + mysql-test/suite/galera_sr/r/GCF-620.result | 14 + mysql-test/suite/galera_sr/r/GCF-623.result | 22 + mysql-test/suite/galera_sr/r/GCF-627.result | 18 + mysql-test/suite/galera_sr/r/GCF-845.result | 14 + mysql-test/suite/galera_sr/r/GCF-851.result | 24 + mysql-test/suite/galera_sr/r/GCF-867.result | 2 + mysql-test/suite/galera_sr/r/GCF-889.result | 18 + mysql-test/suite/galera_sr/r/GCF-900.result | 13 + .../suite/galera_sr/r/galera-features#56.result | 32 + .../suite/galera_sr/r/galera_sr_bf_abort.result | 448 ++++ mysql-test/suite/galera_sr/r/galera_sr_blob.result | 15 + .../suite/galera_sr/r/galera_sr_cc_master.result | 45 + .../suite/galera_sr/r/galera_sr_cc_slave.result | 46 + .../suite/galera_sr/r/galera_sr_concurrent.result | 28 + .../suite/galera_sr/r/galera_sr_conflict.result | 14 + .../r/galera_sr_conflict_on_commit.result | 22 + .../r/galera_sr_conflict_on_commit2.result | 19 + .../galera_sr_conflict_with_rollback_master.result | 22 + .../suite/galera_sr/r/galera_sr_ddl_master.result | 41 + .../suite/galera_sr/r/galera_sr_ddl_schema.result | 18 + .../suite/galera_sr/r/galera_sr_ddl_slave.result | 42 + .../galera_sr/r/galera_sr_ddl_unrelated.result | 34 + .../galera_sr/r/galera_sr_dupkey_error.result | 36 + .../suite/galera_sr/r/galera_sr_fk_conflict.result | 34 + mysql-test/suite/galera_sr/r/galera_sr_gtid.result | 57 + .../galera_sr/r/galera_sr_insert_select.result | 11 + .../r/galera_sr_kill_all_nobootstrap.result | 21 + .../r/galera_sr_kill_all_norecovery.result | 22 + .../r/galera_sr_kill_all_pcrecovery.result | 22 + .../galera_sr/r/galera_sr_kill_connection.result | 25 + .../suite/galera_sr/r/galera_sr_kill_query.result | 17 + .../suite/galera_sr/r/galera_sr_kill_slave.result | 39 + .../galera_sr/r/galera_sr_large_fragment.result | 28 + .../suite/galera_sr/r/galera_sr_load_data.result | 8 + .../r/galera_sr_load_data_splitting.result | 9 + .../suite/galera_sr/r/galera_sr_log_bin.result | 124 + .../galera_sr/r/galera_sr_many_fragments.result | 28 + .../suite/galera_sr/r/galera_sr_myisam.result | 11 + .../galera_sr/r/galera_sr_mysqldump_sst.result | 40 + .../galera_sr/r/galera_sr_parallel_apply.result | 26 + .../suite/galera_sr/r/galera_sr_rollback.result | 29 + .../galera_sr/r/galera_sr_rollback_retry.result | 26 + .../r/galera_sr_rollback_savepoint.result | 33 + .../r/galera_sr_rollback_statement.result | 22 + mysql-test/suite/galera_sr/r/galera_sr_sbr.result | 16 + .../galera_sr/r/galera_sr_shutdown_master.result | 20 + .../galera_sr/r/galera_sr_shutdown_slave.result | 29 + .../galera_sr/r/galera_sr_small_gcache.result | 10 + .../galera_sr/r/galera_sr_table_contents.result | 198 ++ .../r/galera_sr_transaction_replay.result | 101 + .../galera_sr/r/galera_sr_unit_statements.result | 18 + .../galera_sr/r/galera_sr_v1_row_events.result | 20 + .../suite/galera_sr/r/galera_sr_ws_size.result | 29 + .../suite/galera_sr/r/galera_sr_ws_size2.result | 28 + .../r/galera_var_ignore_apply_errors_sr.result | 22 + .../suite/galera_sr/r/mysql-wsrep#215.result | 88 + .../galera_sr/r/mysql-wsrep-features#136.result | 65 + .../galera_sr/r/mysql-wsrep-features#138.result | 17 + .../galera_sr/r/mysql-wsrep-features#14.result | 8 + .../galera_sr/r/mysql-wsrep-features#148.result | 27 + .../galera_sr/r/mysql-wsrep-features#15.result | 8 + .../galera_sr/r/mysql-wsrep-features#165.result | 752 ++++++ .../galera_sr/r/mysql-wsrep-features#213.result | 26 + .../galera_sr/r/mysql-wsrep-features#214.result | 46 + .../galera_sr/r/mysql-wsrep-features#22.result | 26 + .../galera_sr/r/mysql-wsrep-features#27.result | 17 + .../galera_sr/r/mysql-wsrep-features#29.result | 14 + .../galera_sr/r/mysql-wsrep-features#32.result | 27 + .../galera_sr/r/mysql-wsrep-features#35.result | 26 + .../galera_sr/r/mysql-wsrep-features#8.result | 27 + .../galera_sr/r/mysql-wsrep-features#9.result | 12 + .../galera_sr/r/mysql-wsrep-features#93.result | 15 + .../galera_sr/r/mysql-wsrep-features#96.result | 26 + mysql-test/suite/galera_sr/t/GCF-1008.inc | 36 + mysql-test/suite/galera_sr/t/GCF-1008.test | 18 + mysql-test/suite/galera_sr/t/GCF-1018.test | 38 + mysql-test/suite/galera_sr/t/GCF-1018B.test | 40 + mysql-test/suite/galera_sr/t/GCF-1043A.test | 13 + mysql-test/suite/galera_sr/t/GCF-1043B.test | 13 + mysql-test/suite/galera_sr/t/GCF-1051.test | 52 + mysql-test/suite/galera_sr/t/GCF-1060.test | 9 + mysql-test/suite/galera_sr/t/GCF-437.test | 21 + mysql-test/suite/galera_sr/t/GCF-561.test | 65 + mysql-test/suite/galera_sr/t/GCF-571.test | 54 + mysql-test/suite/galera_sr/t/GCF-572.test | 54 + mysql-test/suite/galera_sr/t/GCF-574.test | 27 + mysql-test/suite/galera_sr/t/GCF-580.test | 27 + mysql-test/suite/galera_sr/t/GCF-585.test | 44 + mysql-test/suite/galera_sr/t/GCF-597.test | 29 + mysql-test/suite/galera_sr/t/GCF-620.test | 22 + mysql-test/suite/galera_sr/t/GCF-623.test | 31 + mysql-test/suite/galera_sr/t/GCF-627.test | 30 + mysql-test/suite/galera_sr/t/GCF-845.test | 30 + mysql-test/suite/galera_sr/t/GCF-851.test | 24 + mysql-test/suite/galera_sr/t/GCF-867.test | 42 + mysql-test/suite/galera_sr/t/GCF-889.test | 28 + mysql-test/suite/galera_sr/t/GCF-900.test | 28 + mysql-test/suite/galera_sr/t/disabled.def | 4 + .../suite/galera_sr/t/galera-features#56.test | 55 + .../suite/galera_sr/t/galera_sr_bf_abort.inc | 145 ++ .../suite/galera_sr/t/galera_sr_bf_abort.test | 48 + mysql-test/suite/galera_sr/t/galera_sr_blob.test | 38 + .../suite/galera_sr/t/galera_sr_cc_master.test | 87 + .../suite/galera_sr/t/galera_sr_cc_slave.test | 86 + .../suite/galera_sr/t/galera_sr_concurrent.test | 45 + .../suite/galera_sr/t/galera_sr_conflict.test | 45 + .../galera_sr/t/galera_sr_conflict_on_commit.test | 45 + .../galera_sr/t/galera_sr_conflict_on_commit2.test | 46 + .../t/galera_sr_conflict_with_rollback_master.test | 44 + .../suite/galera_sr/t/galera_sr_ddl_master.test | 63 + .../suite/galera_sr/t/galera_sr_ddl_schema.test | 43 + .../suite/galera_sr/t/galera_sr_ddl_slave.test | 65 + .../suite/galera_sr/t/galera_sr_ddl_unrelated.test | 53 + .../suite/galera_sr/t/galera_sr_dupkey_error.test | 59 + .../suite/galera_sr/t/galera_sr_fk_conflict.test | 62 + .../suite/galera_sr/t/galera_sr_gtid-master.opt | 1 + mysql-test/suite/galera_sr/t/galera_sr_gtid.test | 46 + .../suite/galera_sr/t/galera_sr_insert_select.test | 33 + .../t/galera_sr_kill_all_nobootstrap.test | 52 + .../galera_sr/t/galera_sr_kill_all_norecovery.cnf | 4 + .../galera_sr/t/galera_sr_kill_all_norecovery.test | 53 + .../galera_sr/t/galera_sr_kill_all_pcrecovery.test | 54 + .../galera_sr/t/galera_sr_kill_connection.test | 59 + .../suite/galera_sr/t/galera_sr_kill_query.test | 53 + .../suite/galera_sr/t/galera_sr_kill_slave.cnf | 4 + .../suite/galera_sr/t/galera_sr_kill_slave.test | 80 + .../t/galera_sr_large_fragment-master.opt | 1 + .../galera_sr/t/galera_sr_large_fragment.test | 58 + .../suite/galera_sr/t/galera_sr_load_data.test | 39 + .../galera_sr/t/galera_sr_load_data_splitting.test | 50 + .../suite/galera_sr/t/galera_sr_log_bin-master.opt | 1 + .../suite/galera_sr/t/galera_sr_log_bin.test | 70 + .../galera_sr/t/galera_sr_many_fragments.test | 53 + mysql-test/suite/galera_sr/t/galera_sr_myisam.test | 29 + .../suite/galera_sr/t/galera_sr_mysqldump_sst.cnf | 11 + .../suite/galera_sr/t/galera_sr_mysqldump_sst.test | 79 + .../galera_sr/t/galera_sr_parallel_apply.test | 59 + .../suite/galera_sr/t/galera_sr_rollback.test | 76 + .../galera_sr/t/galera_sr_rollback_retry.test | 55 + .../galera_sr/t/galera_sr_rollback_savepoint.test | 51 + .../galera_sr/t/galera_sr_rollback_statement.test | 61 + mysql-test/suite/galera_sr/t/galera_sr_sbr.test | 31 + .../galera_sr/t/galera_sr_shutdown_master.test | 45 + .../galera_sr/t/galera_sr_shutdown_slave.test | 63 + .../suite/galera_sr/t/galera_sr_small_gcache.cnf | 6 + .../suite/galera_sr/t/galera_sr_small_gcache.test | 21 + .../galera_sr/t/galera_sr_table_contents.test | 49 + .../galera_sr/t/galera_sr_transaction_replay.test | 260 ++ .../galera_sr/t/galera_sr_unit_statements.test | 47 + .../galera_sr/t/galera_sr_v1_row_events-master.opt | 1 + .../suite/galera_sr/t/galera_sr_v1_row_events.test | 27 + .../suite/galera_sr/t/galera_sr_ws_size.test | 70 + .../suite/galera_sr/t/galera_sr_ws_size2.test | 62 + .../t/galera_var_ignore_apply_errors_sr.test | 37 + mysql-test/suite/galera_sr/t/mysql-wsrep#215.test | 161 ++ .../t/mysql-wsrep-features#136-master.opt | 1 + .../galera_sr/t/mysql-wsrep-features#136.test | 41 + .../galera_sr/t/mysql-wsrep-features#138.test | 25 + .../suite/galera_sr/t/mysql-wsrep-features#14.test | 21 + .../galera_sr/t/mysql-wsrep-features#148.test | 60 + .../suite/galera_sr/t/mysql-wsrep-features#15.test | 17 + .../suite/galera_sr/t/mysql-wsrep-features#165.inc | 104 + .../galera_sr/t/mysql-wsrep-features#165.test | 41 + .../galera_sr/t/mysql-wsrep-features#213.test | 63 + .../galera_sr/t/mysql-wsrep-features#214.test | 86 + .../suite/galera_sr/t/mysql-wsrep-features#22.test | 47 + .../suite/galera_sr/t/mysql-wsrep-features#27.test | 29 + .../suite/galera_sr/t/mysql-wsrep-features#29.test | 23 + .../galera_sr/t/mysql-wsrep-features#32-master.opt | 1 + .../suite/galera_sr/t/mysql-wsrep-features#32.test | 44 + .../suite/galera_sr/t/mysql-wsrep-features#35.test | 46 + .../suite/galera_sr/t/mysql-wsrep-features#8.test | 63 + .../suite/galera_sr/t/mysql-wsrep-features#9.test | 44 + .../suite/galera_sr/t/mysql-wsrep-features#93.test | 29 + .../suite/galera_sr/t/mysql-wsrep-features#96.test | 45 + .../suite/innodb/r/innodb-index-online-fk.result | 10 +- mysql-test/suite/innodb/t/galera.skip | 53 + .../suite/innodb/t/innodb-index-online-fk.test | 10 +- packaging/deb-in/CMakeLists.txt | 357 +++ plugin/wsrep_info/plugin.cc | 2 + scripts/mysqld_safe.sh | 11 +- scripts/wsrep_sst_mysqldump.sh | 1 + scripts/wsrep_sst_xtrabackup-v2.sh | 2 +- sql/CMakeLists.txt | 20 +- sql/event_data_objects.cc | 13 +- sql/events.cc | 1 - sql/ha_partition.cc | 7 + sql/ha_partition.h | 3 + sql/handler.cc | 290 ++- sql/handler.h | 6 + sql/item_create.cc | 101 + sql/item_func.cc | 5 +- sql/item_strfunc.cc | 99 + sql/item_strfunc.h | 51 + sql/lock.cc | 82 +- sql/log.cc | 263 +- sql/log.h | 15 +- sql/log_event.cc | 38 +- sql/mdl.cc | 79 +- sql/mysqld.cc | 94 +- sql/protocol.cc | 22 +- sql/service_wsrep.cc | 335 +++ sql/slave.cc | 122 +- sql/sp_head.cc | 33 +- sql/sql_acl.cc | 5 +- sql/sql_alter.cc | 8 +- sql/sql_base.cc | 28 +- sql/sql_basic_types.h | 2 + sql/sql_class.cc | 138 +- sql/sql_class.h | 150 +- sql/sql_connect.cc | 31 +- sql/sql_insert.cc | 92 +- sql/sql_lex.cc | 5 +- sql/sql_load.cc | 9 +- sql/sql_parse.cc | 692 +++--- sql/sql_parse.h | 6 + sql/sql_plugin.cc | 4 +- sql/sql_plugin_services.ic | 29 +- sql/sql_prepare.cc | 48 - sql/sql_repl.cc | 11 + sql/sql_table.cc | 32 +- sql/sql_trigger.cc | 2 +- sql/sql_truncate.cc | 12 + sql/sys_vars.cc | 40 +- sql/table.cc | 7 + sql/table_cache.cc | 32 +- sql/transaction.cc | 55 +- sql/wsrep_applier.cc | 314 +-- sql/wsrep_applier.h | 66 +- sql/wsrep_binlog.cc | 349 ++- sql/wsrep_binlog.h | 64 +- sql/wsrep_client_service.cc | 300 +++ sql/wsrep_client_service.h | 64 + sql/wsrep_client_state.h | 47 + sql/wsrep_condition_variable.h | 54 + sql/wsrep_dummy.cc | 36 +- sql/wsrep_high_priority_service.cc | 681 +++++ sql/wsrep_high_priority_service.h | 118 + sql/wsrep_hton.cc | 1 + sql/wsrep_mutex.h | 50 + sql/wsrep_mysqld.cc | 2623 +++++++++++--------- sql/wsrep_mysqld.h | 507 +++- sql/wsrep_notify.cc | 1 + sql/wsrep_plugin.cc | 53 + sql/wsrep_priv.h | 13 +- sql/wsrep_schema.cc | 1319 ++++++++++ sql/wsrep_schema.h | 167 ++ sql/wsrep_server_service.cc | 277 +++ sql/wsrep_server_service.h | 75 + sql/wsrep_server_state.cc | 78 + sql/wsrep_server_state.h | 68 + sql/wsrep_sst.cc | 417 +--- sql/wsrep_sst.h | 30 +- sql/wsrep_storage_service.cc | 244 ++ sql/wsrep_storage_service.h | 48 + sql/wsrep_tc.h | 0 sql/wsrep_thd.cc | 708 ++---- sql/wsrep_thd.h | 220 +- sql/wsrep_thd_pool.cc | 125 + sql/wsrep_thd_pool.h | 37 + sql/wsrep_trans_observer.h | 369 +++ sql/wsrep_types.h | 29 + sql/wsrep_utils.cc | 2 + sql/wsrep_utils.h | 32 + sql/wsrep_var.cc | 258 +- sql/wsrep_var.h | 11 +- sql/wsrep_xid.cc | 113 +- sql/wsrep_xid.h | 18 +- storage/innobase/buf/buf0dump.cc | 5 +- storage/innobase/handler/ha_innodb.cc | 422 ++-- storage/innobase/handler/ha_innodb.h | 33 +- storage/innobase/include/ha_prototypes.h | 10 +- storage/innobase/include/trx0trx.h | 17 + storage/innobase/lock/lock0lock.cc | 47 +- storage/innobase/lock/lock0wait.cc | 12 +- storage/innobase/row/row0ins.cc | 50 +- storage/innobase/row/row0sel.cc | 14 + storage/innobase/row/row0upd.cc | 22 +- storage/innobase/srv/srv0conc.cc | 7 +- storage/innobase/srv/srv0srv.cc | 5 +- storage/innobase/trx/trx0roll.cc | 5 + storage/innobase/trx/trx0rseg.cc | 17 +- storage/innobase/trx/trx0trx.cc | 3 + wsrep-lib | 1 + wsrep/CMakeLists.txt | 26 - wsrep/wsrep_api.h | 539 ++-- wsrep/wsrep_dummy.c | 114 +- wsrep/wsrep_gtid.c | 2 +- wsrep/wsrep_listener.c | 261 ++ wsrep/wsrep_loader.c | 28 +- wsrep/wsrep_uuid.c | 11 + 882 files changed, 34957 insertions(+), 4977 deletions(-) diff --cc include/mysql/service_wsrep.h index cefba6303fe,0f6d2a46108..d47c6dc3dc8 --- a/include/mysql/service_wsrep.h +++ b/include/mysql/service_wsrep.h @@@ -80,43 -69,32 +69,33 @@@ extern struct wsrep_service_st my_bool (*get_wsrep_load_data_splitting_func)(); my_bool (*get_wsrep_log_conflicts_func)(); long (*get_wsrep_protocol_version_func)(); - my_bool (*wsrep_aborting_thd_contains_func)(THD *thd); - void (*wsrep_aborting_thd_enqueue_func)(THD *thd); bool (*wsrep_consistency_check_func)(THD *thd); - int (*wsrep_is_wsrep_xid_func)(const struct xid_t *xid); + int (*wsrep_is_wsrep_xid_func)(const void *xid); long long (*wsrep_xid_seqno_func)(const struct xid_t *xid); const unsigned char* (*wsrep_xid_uuid_func)(const struct xid_t *xid); - void (*wsrep_lock_rollback_func)(); - int (*wsrep_on_func)(MYSQL_THD); - void (*wsrep_post_commit_func)(THD* thd, bool all); - bool (*wsrep_prepare_key_func)(const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*); - enum wsrep_trx_status (*wsrep_run_wsrep_commit_func)(THD *thd, bool all); - void (*wsrep_thd_LOCK_func)(THD *thd); - void (*wsrep_thd_UNLOCK_func)(THD *thd); - void (*wsrep_thd_awake_func)(THD *thd, my_bool signal); - enum wsrep_conflict_state (*wsrep_thd_conflict_state_func)(MYSQL_THD, my_bool); - const char * (*wsrep_thd_conflict_state_str_func)(THD *thd); - enum wsrep_exec_mode (*wsrep_thd_exec_mode_func)(THD *thd); - const char * (*wsrep_thd_exec_mode_str_func)(THD *thd); - enum wsrep_conflict_state (*wsrep_thd_get_conflict_state_func)(MYSQL_THD); - my_bool (*wsrep_thd_is_BF_func)(MYSQL_THD , my_bool); - my_bool (*wsrep_thd_is_wsrep_func)(MYSQL_THD thd); - char * (*wsrep_thd_query_func)(THD *thd); - enum wsrep_query_state (*wsrep_thd_query_state_func)(THD *thd); - const char * (*wsrep_thd_query_state_str_func)(THD *thd); + my_bool (*wsrep_on_func)(const void *); + bool (*wsrep_prepare_key_for_innodb_func)(THD* thd, const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*); + void (*wsrep_thd_LOCK_func)(const void* thd_ptr); + void (*wsrep_thd_UNLOCK_func)(const void* thd_ptr); + void (*wsrep_thd_awake_func)(const void* thd, my_bool signal); + my_thread_id (*wsrep_thd_thread_id_func)(const void* thd); + my_bool (*wsrep_thd_is_wsrep_on_func)(const void* thd); + const char * (*wsrep_thd_query_func)(const void* thd); int (*wsrep_thd_retry_counter_func)(THD *thd); - void (*wsrep_thd_set_conflict_state_func)(THD *thd, enum wsrep_conflict_state state); bool (*wsrep_thd_ignore_table_func)(THD *thd); - long long (*wsrep_thd_trx_seqno_func)(THD *thd); - struct wsrep_ws_handle * (*wsrep_thd_ws_handle_func)(THD *thd); - int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd); - int (*wsrep_trx_order_before_func)(MYSQL_THD, MYSQL_THD); - void (*wsrep_unlock_rollback_func)(); + long long (*wsrep_thd_trx_seqno_func)(const void* thd); + my_bool (*wsrep_thd_is_aborting_func)(const void* thd); + my_bool (*wsrep_trx_order_before_func)(const void* left_ptr, const void* right_ptr); + void (*wsrep_thd_xid_func)(const void *thd_ptr, void *xid, size_t xid_size); + void (*wsrep_set_data_home_dir_func)(const char *data_dir); } *wsrep_service; + #define MYSQL_SERVICE_WSREP_INCLUDED + #endif + #ifdef MYSQL_DYNAMIC_PLUGIN - #define get_wsrep() wsrep_service->get_wsrep_func() + + #define MYSQL_SERVICE_WSREP_DYNAMIC_INCLUDED #define get_wsrep_certify_nonPK() wsrep_service->get_wsrep_certify_nonPK_func() #define get_wsrep_debug() wsrep_service->get_wsrep_debug_func() #define get_wsrep_drupal_282555_workaround() wsrep_service->get_wsrep_drupal_282555_workaround_func() @@@ -138,33 -111,16 +112,17 @@@ #define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T) #define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T) #define wsrep_thd_awake(T,S) wsrep_service->wsrep_thd_awake_func(T,S) - #define wsrep_thd_conflict_state(T,S) wsrep_service->wsrep_thd_conflict_state_func(T,S) - #define wsrep_thd_conflict_state_str(T) wsrep_service->wsrep_thd_conflict_state_str_func(T) - #define wsrep_thd_exec_mode(T) wsrep_service->wsrep_thd_exec_mode_func(T) - #define wsrep_thd_exec_mode_str(T) wsrep_service->wsrep_thd_exec_mode_str_func(T) - #define wsrep_thd_get_conflict_state(T) wsrep_service->wsrep_thd_get_conflict_state_func(T) - #define wsrep_thd_is_BF(T,S) wsrep_service->wsrep_thd_is_BF_func(T,S) - #define wsrep_thd_is_wsrep(T) wsrep_service->wsrep_thd_is_wsrep_func(T) + #define wsrep_thd_thread_id(T) wsrep_service->wsrep_thd_thread_id_func(T) + #define wsrep_thd_is_wsrep_on(T) wsrep_service->wsrep_thd_is_wsrep_on_func(T) #define wsrep_thd_query(T) wsrep_service->wsrep_thd_query_func(T) - #define wsrep_thd_query_state(T) wsrep_service->wsrep_thd_query_state_func(T) - #define wsrep_thd_query_state_str(T) wsrep_service->wsrep_thd_query_state_str_func(T) #define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T) - #define wsrep_thd_set_conflict_state(T,S) wsrep_service->wsrep_thd_set_conflict_state_func(T,S) #define wsrep_thd_ignore_table(T) wsrep_service->wsrep_thd_ignore_table_func(T) #define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T) - #define wsrep_thd_ws_handle(T) wsrep_service->wsrep_thd_ws_handle_func(T) - #define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T) #define wsrep_trx_order_before(T1,T2) wsrep_service->wsrep_trx_order_before_func(T1,T2) - #define wsrep_unlock_rollback() wsrep_service->wsrep_unlock_rollback_func() + #define wsrep_thd_xid(T,X,S) wsrep_service->wsrep_thd_xid_func(T,X,S) +#define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A) - #define wsrep_debug get_wsrep_debug() - #define wsrep_log_conflicts get_wsrep_log_conflicts() - #define wsrep_certify_nonPK get_wsrep_certify_nonPK() - #define wsrep_load_data_splitting get_wsrep_load_data_splitting() - #define wsrep_drupal_282555_workaround get_wsrep_drupal_282555_workaround() - #define wsrep_recovery get_wsrep_recovery() - #define wsrep_protocol_version get_wsrep_protocol_version() + #define wsrep_thd_is_BF(T,S) wsrep_service->wsrep_thd_is_BF_func(T,S) #else @@@ -203,27 -149,97 +151,98 @@@ my_bool get_wsrep_recovery() my_bool get_wsrep_load_data_splitting(); my_bool get_wsrep_log_conflicts(); my_bool wsrep_aborting_thd_contains(THD *thd); - my_bool wsrep_thd_is_BF(MYSQL_THD thd, my_bool sync); - my_bool wsrep_thd_is_wsrep(MYSQL_THD thd); - struct wsrep *get_wsrep(); struct wsrep_ws_handle *wsrep_thd_ws_handle(THD *thd); void wsrep_aborting_thd_enqueue(THD *thd); - void wsrep_lock_rollback(); void wsrep_post_commit(THD* thd, bool all); - void wsrep_thd_LOCK(THD *thd); - void wsrep_thd_UNLOCK(THD *thd); - void wsrep_thd_awake(THD *thd, my_bool signal); - void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state); bool wsrep_thd_ignore_table(THD *thd); - void wsrep_unlock_rollback(); +void wsrep_set_data_home_dir(const char *data_dir); - #endif + /* from mysql wsrep-lib */ + #include "my_global.h" + #include "my_pthread.h" + /* Must match to definition in sql/mysqld.h */ + typedef int64 query_id_t; + + extern "C" my_bool wsrep_global_on(); + + /* Return true if wsrep is enabled for a thd. This means that + wsrep is enabled globally and the thd has wsrep on */ + extern "C" my_bool wsrep_on(const void* thd); + /* Lock thd wsrep lock */ + extern "C" void wsrep_thd_LOCK(const void* thd); + /* Unlock thd wsrep lock */ + extern "C" void wsrep_thd_UNLOCK(const void* thd); + + /* Return true if thd has wsrep_on */ + extern "C" my_bool wsrep_thd_is_wsrep_on(const void* thd); + /* Return thd id */ + extern "C" my_thread_id wsrep_thd_thread_id(const void* thd); + + /* Return thd client state string */ + extern "C" const char* wsrep_thd_client_state_str(const void* thd); + /* Return thd client mode string */ + extern "C" const char* wsrep_thd_client_mode_str(const void* thd); + /* Return thd transaction state string */ + extern "C" const char* wsrep_thd_transaction_state_str(const void* thd); + + /* Return current query id */ + extern "C" query_id_t wsrep_thd_query_id(const void* thd); + /* Return current transaction id */ + extern "C" query_id_t wsrep_thd_transaction_id(const void* thd); + /* Mark thd own transaction as aborted */ + extern "C" void wsrep_thd_self_abort(void *thd); + /* Return true if thd is in replicating mode */ + extern "C" my_bool wsrep_thd_is_local(const void *thd); + /* Return true if thd is in high priority mode */ + /* todo: rename to is_high_priority() */ + extern "C" my_bool wsrep_thd_is_applying(const void *thd); + /* Return true if thd is in TOI mode */ + extern "C" my_bool wsrep_thd_is_toi(const void* thd); + /* Return true if thd is in replicating TOI mode */ + extern "C" my_bool wsrep_thd_is_local_toi(const void* thd); + /* Return true if thd is in RSU mode */ + extern "C" my_bool wsrep_thd_is_in_rsu(const void* thd); + /* Return true if thd is in BF mode, either high_priority or TOI */ + extern "C" my_bool wsrep_thd_is_BF(const void* thd, my_bool sync); + /* Return true if thd is streaming */ + extern "C" my_bool wsrep_thd_is_SR(const void* thd); + extern "C" void wsrep_handle_SR_rollback(void *BF_thd_ptr, void *victim_thd_ptr); + /* Return XID associated to thd */ + extern "C" void wsrep_thd_xid(const void* thd, void* xid, size_t size); + /* Return thd retry counter */ + extern "C" int wsrep_thd_retry_counter(THD*); + /* Signal thd to awake from wait */ + extern "C" void wsrep_thd_awake(const void* thd, my_bool signal); + /* BF abort victim_thd */ + extern "C" my_bool wsrep_thd_bf_abort(const void* bf_thd, void* victim_thd, + my_bool signal); + /* Return true if left thd is ordered before right thd */ + extern "C" my_bool wsrep_thd_order_before(const void* left, const void* right); + /* Return true if thd should skip locking. This means that the thd + is operating on shared resource inside commit order critical section. */ + extern "C" my_bool wsrep_thd_skip_locking(const void*); + /* Return true if thd is aborting */ + extern "C" my_bool wsrep_thd_is_aborting(const void*); + + + enum Wsrep_key_type + { + wsrep_key_shared, + wsrep_key_semi_shared, + wsrep_key_semi_exclusive, + wsrep_key_exclusive + }; + struct wsrep_key; + struct wsrep_key_array; + extern "C" int wsrep_thd_append_key(void*, + const struct wsrep_key* key, + int n_keys, + enum Wsrep_key_type); #ifdef __cplusplus - } - #endif + #include <string> + extern const std::string sr_table_name_full_str; + #endif /* __cplusplus */ - #define MYSQL_SERVICE_WSREP_INCLUDED #endif - + #endif /* MYSQL_SERVICE_WSREP_INCLUDED */ diff --cc include/wsrep.h index c7f598906bb,9dd99b92056..abe3bcc7b8c --- a/include/wsrep.h +++ b/include/wsrep.h @@@ -28,12 -28,14 +28,15 @@@ goto error; #define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_) \ - if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, \ - table_list_, alter_info_)) \ - if (WSREP(thd) && wsrep_thd_is_local(thd) && \ - wsrep_to_isolation_begin(thd, db_, table_, \ ++ if (WSREP_ON && WSREP(thd) && wsrep_thd_is_local(thd) && \ ++ wsrep_to_isolation_begin(thd, db_, table_, \ + table_list_, alter_info_)) \ goto error; - #define WSREP_TO_ISOLATION_END \ - if (WSREP_ON && (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER))) \ + #define WSREP_TO_ISOLATION_END \ - if ((WSREP(thd) && thd && wsrep_thd_is_local_toi(thd)) || \ - wsrep_thd_is_in_rsu(thd)) \ ++ if (WSREP_ON && WSREP(thd) && \ ++ (wsrep_thd_is_local_toi(thd) || \ ++ wsrep_thd_is_in_rsu(thd))) \ wsrep_to_isolation_end(thd); /* diff --cc mysql-test/suite/galera/r/MW-336.result index e35044d872b,6db86b4f28a..5961d1f3e24 --- a/mysql-test/suite/galera/r/MW-336.result +++ b/mysql-test/suite/galera/r/MW-336.result @@@ -1,5 -1,6 +1,7 @@@ + connection node_2; + connection node_1; CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; +INSERT INTO t1 values(0); connection node_1; SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 1; diff --cc mysql-test/suite/galera/r/galera_defaults.result index 8083784bb01,381b334908e..83188c2687a --- a/mysql-test/suite/galera/r/galera_defaults.result +++ b/mysql-test/suite/galera/r/galera_defaults.result @@@ -52,4 -60,79 +60,6 @@@ WSREP_SST_DONO WSREP_SST_DONOR_REJECTS_QUERIES OFF WSREP_SST_METHOD rsync WSREP_SYNC_WAIT 15 - <BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = no; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GM CAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; <REPL_PROTO_MAX>;socket.checksum = 2; socket.recv_buf_size = 212992; + WSREP_TRX_FRAGMENT_SIZE 0 + WSREP_TRX_FRAGMENT_UNIT bytes + <BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 1; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = yes; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <G MCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; <REPL_PROTO_MAX>; socket.checksum = 2; socket.recv_buf_size = 212992; -SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS -WHERE VARIABLE_NAME LIKE 'wsrep_%' -AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'; -COUNT(*) -63 -SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS -WHERE VARIABLE_NAME LIKE 'wsrep_%' -AND VARIABLE_NAME != 'wsrep_debug_sync_waiters' -ORDER BY VARIABLE_NAME; -VARIABLE_NAME -WSREP_APPLY_OOOE -WSREP_APPLY_OOOL -WSREP_APPLY_WINDOW -WSREP_CAUSAL_READS -WSREP_CERT_DEPS_DISTANCE -WSREP_CERT_INDEX_SIZE -WSREP_CERT_INTERVAL -WSREP_CLUSTER_CAPABILITIES -WSREP_CLUSTER_CONF_ID -WSREP_CLUSTER_SIZE -WSREP_CLUSTER_STATE_UUID -WSREP_CLUSTER_STATUS -WSREP_CLUSTER_WEIGHT -WSREP_COMMIT_OOOE -WSREP_COMMIT_OOOL -WSREP_COMMIT_WINDOW -WSREP_CONNECTED -WSREP_DESYNC_COUNT -WSREP_EVS_DELAYED -WSREP_EVS_EVICT_LIST -WSREP_EVS_REPL_LATENCY -WSREP_EVS_STATE -WSREP_FLOW_CONTROL_PAUSED -WSREP_FLOW_CONTROL_PAUSED_NS -WSREP_FLOW_CONTROL_RECV -WSREP_FLOW_CONTROL_SENT -WSREP_GCOMM_UUID -WSREP_INCOMING_ADDRESSES -WSREP_LAST_COMMITTED -WSREP_LOCAL_BF_ABORTS -WSREP_LOCAL_CACHED_DOWNTO -WSREP_LOCAL_CERT_FAILURES -WSREP_LOCAL_COMMITS -WSREP_LOCAL_INDEX -WSREP_LOCAL_RECV_QUEUE -WSREP_LOCAL_RECV_QUEUE_AVG -WSREP_LOCAL_RECV_QUEUE_MAX -WSREP_LOCAL_RECV_QUEUE_MIN -WSREP_LOCAL_REPLAYS -WSREP_LOCAL_SEND_QUEUE -WSREP_LOCAL_SEND_QUEUE_AVG -WSREP_LOCAL_SEND_QUEUE_MAX -WSREP_LOCAL_SEND_QUEUE_MIN -WSREP_LOCAL_STATE -WSREP_LOCAL_STATE_COMMENT -WSREP_LOCAL_STATE_UUID -WSREP_OPEN_CONNECTIONS -WSREP_OPEN_TRANSACTIONS -WSREP_PROTOCOL_VERSION -WSREP_PROVIDER_CAPABILITIES -WSREP_PROVIDER_NAME -WSREP_PROVIDER_VENDOR -WSREP_PROVIDER_VERSION -WSREP_READY -WSREP_RECEIVED -WSREP_RECEIVED_BYTES -WSREP_REPLICATED -WSREP_REPLICATED_BYTES -WSREP_REPL_DATA_BYTES -WSREP_REPL_KEYS -WSREP_REPL_KEYS_BYTES -WSREP_REPL_OTHER_BYTES -WSREP_THREAD_COUNT diff --cc mysql-test/suite/galera/r/galera_enum.result index a2a6317e2a0,92b72fc69c0..40fc6931f6a --- a/mysql-test/suite/galera/r/galera_enum.result +++ b/mysql-test/suite/galera/r/galera_enum.result @@@ -38,14 -40,9 +40,14 @@@ connection node_1 COMMIT; connection node_2; COMMIT; - ERROR 40001: Deadlock: wsrep aborted transaction + ERROR 40001: Deadlock found when trying to get lock; try restarting transaction connection node_1; -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three'; -COUNT(*) = 1 +SELECT COUNT(*) FROM t1 WHERE f1 = 'three'; +COUNT(*) 1 +SELECT * FROM t1; +f1 +one +two +three DROP TABLE t1; diff --cc mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result index e3bf407ddaa,cad00aaee48..146cae1e896 --- a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result +++ b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result @@@ -86,3 -96,111 +96,15 @@@ COUNT(*) = DROP TABLE t1; COMMIT; SET AUTOCOMMIT=ON; -Performing State Transfer on a server that has been killed and restarted -while a DDL was in progress on it + connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); + connection node_2; -START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -COMMIT; -SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; + connection node_1; -ALTER TABLE t1 ADD COLUMN f2 INTEGER; + connection node_2; -SET wsrep_sync_wait = 0; -Killing server ... + connection node_1; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -COMMIT; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); + connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); + connection node_2; -Performing --wsrep-recover ... + connection node_2; -Starting server ... -Using --wsrep-start-position when starting mysqld ... -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -COMMIT; + connection node_1; -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -COMMIT; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -COMMIT; + connection node_1a_galera_st_kill_slave_ddl; -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -ROLLBACK; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -COUNT(*) = 2 -1 -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 -SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -COUNT(*) = 0 -1 -COMMIT; -SET AUTOCOMMIT=ON; + connection node_1; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -COUNT(*) = 2 -1 -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 -SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -COUNT(*) = 0 -1 -DROP TABLE t1; -COMMIT; -SET AUTOCOMMIT=ON; + SET GLOBAL debug_dbug = $debug_orig; diff --cc mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result index 099d944d491,579370fb25c..f9fdc70e9d0 --- a/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result +++ b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result @@@ -259,3 -285,111 +285,15 @@@ COUNT(*) = DROP TABLE t1; COMMIT; SET AUTOCOMMIT=ON; -Performing State Transfer on a server that has been killed and restarted -while a DDL was in progress on it + connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); + connection node_2; -START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -COMMIT; -SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; + connection node_1; -ALTER TABLE t1 ADD COLUMN f2 INTEGER; + connection node_2; -SET wsrep_sync_wait = 0; -Killing server ... + connection node_1; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -COMMIT; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); + connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); + connection node_2; -Performing --wsrep-recover ... + connection node_2; -Starting server ... -Using --wsrep-start-position when starting mysqld ... -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -COMMIT; + connection node_1; -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -COMMIT; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -COMMIT; + connection node_1a_galera_st_kill_slave_ddl; -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -ROLLBACK; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -COUNT(*) = 2 -1 -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 -SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -COUNT(*) = 0 -1 -COMMIT; -SET AUTOCOMMIT=ON; + connection node_1; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -COUNT(*) = 2 -1 -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 -SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -COUNT(*) = 0 -1 -DROP TABLE t1; -COMMIT; -SET AUTOCOMMIT=ON; + SET GLOBAL debug_dbug = $debug_orig; diff --cc mysql-test/suite/galera/r/galera_var_slave_threads.result index c28cc091ae9,6196e6b1b78..e774e620ccd --- a/mysql-test/suite/galera/r/galera_var_slave_threads.result +++ b/mysql-test/suite/galera/r/galera_var_slave_threads.result @@@ -23,12 -28,89 +28,25 @@@ connection node_2 SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 + SELECT COUNT(*) = @@wsrep_slave_threads + 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND COMMAND != 'Daemon'; + COUNT(*) = @@wsrep_slave_threads + 2 + 0 + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; + COUNT(*) = 1 + 1 SET GLOBAL wsrep_slave_threads = 1; connection node_1; -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); -INSERT INTO t2 VALUES (DEFAULT); connection node_2; - SELECT COUNT(*) FROM t2; - COUNT(*) - 64 + SELECT COUNT(*) = 64 FROM t2; + COUNT(*) = 64 + 1 + SET wsrep_sync_wait=0; + SELECT COUNT(*) = @@wsrep_slave_threads + 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND COMMAND != 'Daemon'; + COUNT(*) = @@wsrep_slave_threads + 2 + 1 + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; + COUNT(*) = 1 + 1 SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; COUNT(*) 1 diff --cc mysql-test/suite/galera/suite.pm index 233aa020a94,b5510480a2c..62d89f70dac --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@@ -81,8 -81,8 +81,10 @@@ push @::global_suppressions qr|WSREP: .*core_handle_uuid_msg.*|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|, + qr(WSREP: Failed to remove page file .*), + qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), + qr|Query apply failed:*|, + qr(WSREP: Ignoring error*), ); $ENV{PATH}="$epath:$ENV{PATH}"; diff --cc mysql-test/suite/galera/t/MW-328A.test index 09aad1bcf60,268ce28f734..097d4ac4ff6 --- a/mysql-test/suite/galera/t/MW-328A.test +++ b/mysql-test/suite/galera/t/MW-328A.test @@@ -3,11 -3,15 +3,16 @@@ # # - # Attempt to insert into t2 and check if insert actually inserted rows if - # a success was reported. + # test phase 1 is not deterministic + # + # Here we attempt to insert into t2 and check if insert actually + # inserted rows if a success was reported. + # + # However, deadlocks may or may not happen in this test execution + # it all depends on timing. # +--source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc --source suite/galera/t/MW-328-header.inc diff --cc mysql-test/suite/galera/t/galera_var_slave_threads.test index 80edcb2aff9,db8a8879415..30c1295b627 --- a/mysql-test/suite/galera/t/galera_var_slave_threads.test +++ b/mysql-test/suite/galera/t/galera_var_slave_threads.test @@@ -33,13 -34,15 +34,19 @@@ SET GLOBAL wsrep_slave_threads = 64 INSERT INTO t1 VALUES (1); --connection node_2 +--let $wait_timeout=600 +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc + SELECT COUNT(*) = 1 FROM t1; - --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); + # + # note, in wsrep API #26, we have 2 rollbacker threads, counted as system user's + # + SELECT COUNT(*) = @@wsrep_slave_threads + 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND COMMAND != 'Daemon'; + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; + + --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); --source include/wait_condition.inc # @@@ -59,13 -60,15 +66,17 @@@ while ($count INSERT INTO t2 VALUES (DEFAULT); --dec $count } +--enable_query_log +--enable_result_log --connection node_2 - SELECT COUNT(*) FROM t2; + SELECT COUNT(*) = 64 FROM t2; + SET wsrep_sync_wait=0; - --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%') + SELECT COUNT(*) = @@wsrep_slave_threads + 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND COMMAND != 'Daemon'; + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; + + --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%') --source include/wait_condition.inc SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; diff --cc mysql-test/suite/galera_3nodes/t/galera_pc_weight.test index 0a94e7cd85d,eeb75392f0d..575f84d1f32 --- a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test +++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test @@@ -5,15 -6,11 +6,14 @@@ --source include/big_test.inc --source include/galera_cluster.inc - --source include/have_innodb.inc --connection node_1 +SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight'; SET GLOBAL wsrep_provider_options = 'pc.weight=3'; ---source include/galera_suspend.inc ---sleep 10 +SELECT VARIABLE_VALUE = 5 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight'; + +# Isolate node_1 from the cluster. +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; --connection node_2 # Do not wait for causality as we are no longer in the primary component @@@ -53,8 -44,14 +53,11 @@@ SHOW STATUS LIKE 'wsrep_local_state' SHOW STATUS LIKE 'wsrep_local_state_comment'; --connection node_1 ---source include/galera_resume.inc ---sleep 10 ---source include/wait_until_connected_again.inc # For Node #1, we expect a primary component of size 1 + # (NOTE: this is a bit racy as nodes 2 and 3 will try to reconnect ASAP. + # to avoid the raice they should be suspended first as well, but that's + # not currently possible) --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc @@@ -66,28 -62,19 +69,18 @@@ SELECT VARIABLE_VALUE = 'ON' FROM INFOR SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; - SET GLOBAL wsrep_provider_options = 'pc.weight=1'; + # wait for nodes 2 and 3 to reconnect +SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight'; - # Resume cluster connectivity on node_1 - --connection node_1 - SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; - - --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' - --source include/wait_condition.inc - --connection node_2 - --source include/wait_condition.inc + --source include/galera_wait_ready.inc --connection node_3 - --source include/wait_condition.inc + --source include/galera_wait_ready.inc -# On all nodes, we now expect a Primary component of size 3, Synced and ready - --connection node_1 - --source include/wait_condition.inc - - # On all nodes, we now expect a Primary component of size 3, weight 3, Synced and ready + --source include/galera_wait_ready.inc SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; - SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight'; SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; diff --cc sql/sql_alter.cc index 06147a52004,fb89e0bc5b2..958fc2c9566 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@@ -499,12 -497,10 +499,10 @@@ bool Sql_cmd_alter_table::execute(THD * DBUG_RETURN(result); #ifdef WITH_WSREP -error: +error: /* Used by WSREP_TO_ISOLATION_BEGIN_ALTER */ - #endif - { - WSREP_WARN("ALTER TABLE isolation failure"); - DBUG_RETURN(TRUE); - } + // Jump to error may happen from WSREP_TO_ISOLATION_BEGIN + DBUG_RETURN(TRUE); + #endif /* WITH_WSREP */ } bool Sql_cmd_discard_import_tablespace::execute(THD *thd) diff --cc sql/sql_base.cc index 220fcf6cc34,829c8dc9efc..61976aabe2e --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@@ -3857,10 -3828,10 +3870,10 @@@ lock_table_names(THD *thd, const DDL_op mdl_requests.push_front(&global_request); if (create_table) - #ifdef WITH_WSREP - if (thd->lex->sql_command != SQLCOM_CREATE_TABLE && +#ifdef WITH_WSREP + if (thd->lex->sql_command != SQLCOM_CREATE_TABLE && - thd->wsrep_exec_mode != REPL_RECV) + !thd->wsrep_applier) - #endif +#endif lock_wait_timeout= 0; // Don't wait for timeout } diff --cc sql/sql_parse.cc index aa669f42c6f,78fa984f270..2ea3fb74d4c --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@@ -7848,106 -7952,59 +7952,61 @@@ static bool wsrep_mysql_parse(THD *thd bool is_com_multi, bool is_next_command) { - #ifdef WITH_WSREP bool is_autocommit= !thd->in_multi_stmt_transaction_mode() && - thd->wsrep_conflict_state == NO_CONFLICT && - !thd->wsrep_applier; - + wsrep_read_only_option(thd, thd->lex->query_tables); + bool retry_autocommit; do { - if (thd->wsrep_conflict_state== RETRY_AUTOCOMMIT) - { - thd->wsrep_conflict_state= NO_CONFLICT; - /* Performance Schema Interface instrumentation, begin */ - thd->m_statement_psi= MYSQL_REFINE_STATEMENT(thd->m_statement_psi, - com_statement_info[thd->get_command()].m_key); - MYSQL_SET_STATEMENT_TEXT(thd->m_statement_psi, thd->query(), - thd->query_length()); - - DBUG_EXECUTE_IF("sync.wsrep_retry_autocommit", - { - const char act[]= - "now " - "SIGNAL wsrep_retry_autocommit_reached " - "WAIT_FOR wsrep_retry_autocommit_continue"; - DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); - }); + retry_autocommit= false; + DBUG_EXECUTE_IF("sync.wsrep_retry_autocommit", + { + const char act[]= + "now " + "SIGNAL wsrep_retry_autocommit_reached " + "WAIT_FOR wsrep_retry_autocommit_continue"; + DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); + }); - mysql_parse(thd, rawbuf, length, parser_state, is_com_multi, is_next_command); + WSREP_DEBUG("Retry autocommit query: %s", thd->query()); - } ++ mysql_parse(thd, rawbuf, length, parser_state, is_com_multi, is_next_command); + - mysql_parse(thd, rawbuf, length, parser_state, is_com_multi, - is_next_command); - if (WSREP(thd)) { - /* wsrep BF abort in query exec phase */ - mysql_mutex_lock(&thd->LOCK_thd_data); - if (thd->wsrep_conflict_state == MUST_ABORT) { - wsrep_client_rollback(thd); - - WSREP_DEBUG("abort in exec query state, avoiding autocommit"); - } + /* + Convert all ER_QUERY_INTERRUPTED errors to ER_LOCK_DEADLOCK + if the transaction was BF aborted. This can happen when the + transaction is being BF aborted via thd->awake() while it is + still executing. - if (thd->wsrep_conflict_state == MUST_REPLAY) - { - mysql_mutex_unlock(&thd->LOCK_thd_data); - if (thd->lex->explain) - delete_explain_query(thd->lex); - mysql_mutex_lock(&thd->LOCK_thd_data); + Note that this must be done before wsrep_after_statement() call + since it clears the transaction for autocommit queries. + */ + if (((thd->get_stmt_da()->is_error() && + thd->get_stmt_da()->sql_errno() == ER_QUERY_INTERRUPTED) || + !thd->get_stmt_da()->is_set()) && + thd->wsrep_trx().bf_aborted()) + { + WSREP_DEBUG("overriding error: %d with DEADLOCK", + (thd->get_stmt_da()->is_error()) ? + thd->get_stmt_da()->sql_errno() : 0); - wsrep_replay_transaction(thd); - } + thd->killed = NOT_KILLED; + wsrep_override_error(thd, ER_LOCK_DEADLOCK); + } - /* setting error code for BF aborted trxs */ - if (thd->wsrep_conflict_state == ABORTED || - thd->wsrep_conflict_state == CERT_FAILURE) + if (wsrep_after_statement(thd) && is_autocommit) + { + thd->reset_for_next_command(); + thd->killed= NOT_KILLED; + if (is_autocommit && + thd->lex->sql_command != SQLCOM_SELECT && + thd->wsrep_retry_counter < thd->variables.wsrep_retry_autocommit) { - thd->reset_for_next_command(); - if (is_autocommit && - thd->lex->sql_command != SQLCOM_SELECT && - (thd->wsrep_retry_counter < thd->variables.wsrep_retry_autocommit)) - { - mysql_mutex_unlock(&thd->LOCK_thd_data); - WSREP_DEBUG("wsrep retrying AC query: %s", - (thd->query()) ? thd->query() : "void"); - - /* Performance Schema Interface instrumentation, end */ - MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da()); - thd->m_statement_psi= NULL; - thd->m_digest= NULL; - // Released thd->LOCK_thd_data above as below could end up - // close_thread_tables()/close_open_tables()/close_thread_table()/mysql_mutex_lock(&thd->LOCK_thd_data) - close_thread_tables(thd); - - mysql_mutex_lock(&thd->LOCK_thd_data); - thd->wsrep_conflict_state= RETRY_AUTOCOMMIT; - thd->wsrep_retry_counter++; // grow - wsrep_copy_query(thd); - thd->set_time(); - parser_state->reset(rawbuf, length); - mysql_mutex_unlock(&thd->LOCK_thd_data); - } - else - { - mysql_mutex_unlock(&thd->LOCK_thd_data); - // This does dirty read to wsrep variables but it is only a debug code - WSREP_DEBUG("%s, thd: %lld is_AC: %d, retry: %lu - %lu SQL: %s", - (thd->wsrep_conflict_state == ABORTED) ? - "BF Aborted" : "cert failure", - (longlong) thd->thread_id, is_autocommit, - thd->wsrep_retry_counter, - thd->variables.wsrep_retry_autocommit, thd->query()); - my_message(ER_LOCK_DEADLOCK, "Deadlock: wsrep aborted transaction", - MYF(0)); - - mysql_mutex_lock(&thd->LOCK_thd_data); - thd->wsrep_conflict_state= NO_CONFLICT; - if (thd->wsrep_conflict_state != REPLAYING) - thd->wsrep_retry_counter= 0; // reset - mysql_mutex_unlock(&thd->LOCK_thd_data); - } - - thd->reset_killed(); + WSREP_DEBUG("wsrep retrying AC query: %lu %s", + thd->wsrep_retry_counter, WSREP_QUERY(thd)); + wsrep_prepare_for_autocommit_retry(thd, rawbuf, length, parser_state); + if (thd->lex->explain) + delete_explain_query(thd->lex); + retry_autocommit= true; } else { diff --cc sql/sql_plugin_services.ic index 8de53aa2161,422e6b12e16..9e3b61ff4ea --- a/sql/sql_plugin_services.ic +++ b/sql/sql_plugin_services.ic @@@ -164,25 -158,15 +158,16 @@@ static struct wsrep_service_st wsrep_ha wsrep_thd_LOCK, wsrep_thd_UNLOCK, wsrep_thd_awake, - wsrep_thd_conflict_state, - wsrep_thd_conflict_state_str, - wsrep_thd_exec_mode, - wsrep_thd_exec_mode_str, - wsrep_thd_get_conflict_state, - wsrep_thd_is_BF, - wsrep_thd_is_wsrep, + wsrep_thd_thread_id, + wsrep_thd_is_wsrep_on, wsrep_thd_query, - wsrep_thd_query_state, - wsrep_thd_query_state_str, wsrep_thd_retry_counter, - wsrep_thd_set_conflict_state, wsrep_thd_ignore_table, wsrep_thd_trx_seqno, - wsrep_thd_ws_handle, - wsrep_trx_is_aborting, + wsrep_thd_is_aborting, wsrep_trx_order_before, - wsrep_unlock_rollback, - wsrep_thd_xid ++ wsrep_thd_xid, + wsrep_set_data_home_dir }; static struct thd_specifics_service_st thd_specifics_handler= diff --cc sql/sql_trigger.cc index fd128f8dc1c,9f26bff3321..a14f3473c12 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@@ -515,11 -515,7 +515,11 @@@ bool mysql_create_or_drop_trigger(THD * if (err_status) goto end; } - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL); + +#ifdef WITH_WSREP - if (thd->wsrep_exec_mode == LOCAL_STATE) ++ // if (thd->wsrep_exec_mode == LOCAL_STATE) + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL); +#endif /* We should have only one table in table list. */ DBUG_ASSERT(tables->next_global == 0); diff --cc sql/table_cache.cc index 682f9455d26,70af7a4dd6d..8b8f66c057f --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@@ -1141,10 -1142,42 +1141,40 @@@ bool tdc_remove_table(THD *thd, enum_td All_share_tables_list::Iterator it(element->all_tables); while ((table= it++)) { - if (table->in_use == thd) + #ifdef WITH_WSREP + if (remove_type == TDC_RT_REMOVE_ALL || + remove_type == TDC_RT_REMOVE_NOT_OWN || + remove_type == TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE) + { + if (table->in_use != thd) + { + /* + We may end up here if we were granted some MDL + lock even if another thd was already granted. + In that case we expect their wsrep_conflict_state + to be either ABORTING or CERT_FAILURE. + See wsrep_grant_mdl_exception() + */ + enum wsrep::transaction::state state= + table->in_use->wsrep_trx().state(); + if (state == wsrep::transaction::s_cert_failed || + state == wsrep::transaction::s_aborting) + { + WSREP_DEBUG("Table_cache_manager::free_table assert skipped"); + } + else + { + DBUG_ASSERT(0); + } + } + } + my_refs++; + #else - my_refs++; - DBUG_ASSERT(table->in_use == thd); + my_refs++; + + #endif /* WITH_WSREP */ } } - DBUG_ASSERT(element->all_tables.is_empty() || remove_type != TDC_RT_REMOVE_ALL); mysql_mutex_unlock(&element->LOCK_table_share); while ((table= purge_tables.pop_front())) diff --cc sql/wsrep_applier.cc index 1f50ee55711,52746408198..4321d332215 --- a/sql/wsrep_applier.cc +++ b/sql/wsrep_applier.cc @@@ -146,10 -183,6 +183,7 @@@ int wsrep_apply_events(THD* thd /* Use the original server id for logging. */ thd->set_server_id(ev->server_id); thd->set_time(); // time the query + thd->transaction.start_time.reset(thd); - wsrep_xid_init(&thd->transaction.xid_state.xid, - thd->wsrep_trx_meta.gtid.uuid, - thd->wsrep_trx_meta.gtid.seqno); thd->lex->current_select= 0; if (!ev->when) { diff --cc sql/wsrep_mysqld.cc index d667d59b14f,c35079bef85..ae8907ee4b4 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@@ -82,9 -93,10 +90,9 @@@ my_bool wsrep_certify_nonPK my_bool wsrep_recovery; // Recovery my_bool wsrep_replicate_myisam; // Enable MyISAM replication my_bool wsrep_log_conflicts; - my_bool wsrep_load_data_splitting; // Commit load data every 10K intervals + my_bool wsrep_load_data_splitting= 0; // Commit load data every 10K intervals my_bool wsrep_slave_UK_checks; // Slave thread does UK checks my_bool wsrep_slave_FK_checks; // Slave thread does FK checks -my_bool wsrep_sst_donor_rejects_queries; my_bool wsrep_restart_slave; // Should mysql slave thread be // restarted, when node joins back? my_bool wsrep_desync; // De(re)synchronize the node from the @@@ -578,87 -481,47 +477,50 @@@ static void wsrep_init_position( WSREP_WARN("Initial position was provided by configuration or SST, " "avoiding override"); } + #endif } - extern char* my_bind_addr_str; - - int wsrep_init() + /**************************************************************************** + Helpers for wsrep_init() + ****************************************************************************/ + static std::string wsrep_server_name() { - int rcode= -1; - DBUG_ASSERT(wsrep_inited == 0); - - if (strcmp(wsrep_start_position, WSREP_START_POSITION_ZERO) && - wsrep_start_position_init(wsrep_start_position)) - { - return 1; - } - - wsrep_sst_auth_init(); - - wsrep_ready_set(FALSE); - assert(wsrep_provider); + std::string ret(wsrep_node_name ? wsrep_node_name : ""); + return ret; + } - wsrep_init_position(); + static std::string wsrep_server_id() + { + #ifdef WSREP_TODO + std::stringstream ss; + ss << server_id; + return(ss.str()); + #endif + /* using empty server_id, which enables view change handler to + set final server_id later on + */ + std::string ret(""); + return ret; + } - if ((rcode= wsrep_load(wsrep_provider, &wsrep, wsrep_log_cb)) != WSREP_OK) - { - if (strcasecmp(wsrep_provider, WSREP_NONE)) - { - WSREP_ERROR("wsrep_load(%s) failed: %s (%d). Reverting to no provider.", - wsrep_provider, strerror(rcode), rcode); - strcpy((char*)wsrep_provider, WSREP_NONE); // damn it's a dirty hack - return wsrep_init(); - } - else /* this is for recursive call above */ - { - WSREP_ERROR("Could not revert to no provider: %s (%d). Need to abort.", - strerror(rcode), rcode); - unireg_abort(1); - } - } + static std::string wsrep_server_node_address() + { - if (!WSREP_PROVIDER_EXISTS) + std::string ret; + WSREP_INFO("node_address ptr %p", wsrep_node_address); + if (wsrep_node_address) { - // enable normal operation in case no provider is specified - wsrep_ready_set(TRUE); - wsrep_inited= 1; - global_system_variables.wsrep_on = 0; - wsrep_init_args args; - args.logger_cb = wsrep_log_cb; - args.options = (wsrep_provider_options) ? - wsrep_provider_options : ""; - rcode = wsrep->init(wsrep, &args); - if (rcode) - { - DBUG_PRINT("wsrep",("wsrep::init() failed: %d", rcode)); - WSREP_ERROR("wsrep::init() failed: %d, must shutdown", rcode); - wsrep->free(wsrep); - free(wsrep); - wsrep = NULL; - } - return rcode; + WSREP_INFO("node_address %s", wsrep_node_address); } - else + if (!(wsrep_node_address && strlen(wsrep_node_address))) { - global_system_variables.wsrep_on = 1; - strncpy(provider_name, - wsrep->provider_name, sizeof(provider_name) - 1); - strncpy(provider_version, - wsrep->provider_version, sizeof(provider_version) - 1); - strncpy(provider_vendor, - wsrep->provider_vendor, sizeof(provider_vendor) - 1); - } - + if (!wsrep_data_home_dir || strlen(wsrep_data_home_dir) == 0) + wsrep_data_home_dir = mysql_real_data_home; + - /* Initialize node address */ - char node_addr[512]= { 0, }; - size_t const node_addr_max= sizeof(node_addr) - 1; - if (!wsrep_node_address || !strcmp(wsrep_node_address, "")) - { - size_t const ret= wsrep_guess_ip(node_addr, node_addr_max); - if (!(ret > 0 && ret < node_addr_max)) + char node_addr[512] = {0, }; + const size_t node_addr_max= sizeof(node_addr) - 1; + size_t guess_ip_ret= wsrep_guess_ip(node_addr, node_addr_max); + if (!(guess_ip_ret > 0 && guess_ip_ret < node_addr_max)) { WSREP_WARN("Failed to guess base node address. Set it explicitly via " "wsrep_node_address."); @@@ -1073,117 -1139,57 +1138,120 @@@ void wsrep_keys_free(wsrep_key_arr_t* k */ static bool wsrep_prepare_key_for_isolation(const char* db, - const char* table, - wsrep_buf_t* key, - size_t* key_len) + const char* table, + wsrep_buf_t* key, + size_t* key_len) { - if (*key_len < 2) return false; + if (*key_len < 2) return false; - switch (wsrep_protocol_version) - { - case 0: - *key_len= 0; - break; - case 1: - case 2: - case 3: + switch (wsrep_protocol_version) + { + case 0: + *key_len= 0; + break; + case 1: + case 2: + case 3: + case 4: + { + *key_len= 0; + if (db) { - *key_len= 0; - if (db) - { - // sql_print_information("%s.%s", db, table); - if (db) - { - key[*key_len].ptr= db; - key[*key_len].len= strlen(db); - ++(*key_len); - if (table) - { - key[*key_len].ptr= table; - key[*key_len].len= strlen(table); - ++(*key_len); - } - } - } - break; + // sql_print_information("%s.%s", db, table); + key[*key_len].ptr= db; + key[*key_len].len= strlen(db); + ++(*key_len); + if (table) + { + key[*key_len].ptr= table; + key[*key_len].len= strlen(table); + ++(*key_len); + } } - default: + break; + } + default: + assert(0); + WSREP_ERROR("Unsupported protocol version: %ld", wsrep_protocol_version); + unireg_abort(1); + return false; + } + return true; +} + + +static bool wsrep_prepare_key_for_isolation(const char* db, + const char* table, + wsrep_key_arr_t* ka) +{ + wsrep_key_t* tmp; + + if (!ka->keys) + tmp= (wsrep_key_t*)my_malloc((ka->keys_len + 1) * sizeof(wsrep_key_t), + MYF(0)); + else + tmp= (wsrep_key_t*)my_realloc(ka->keys, + (ka->keys_len + 1) * sizeof(wsrep_key_t), - MYF(0)); - ++ MY_ALLOW_ZERO_PTR); + if (!tmp) + { + WSREP_ERROR("Can't allocate memory for key_array"); + return false; + } + ka->keys= tmp; + if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*) + my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) + { + WSREP_ERROR("Can't allocate memory for key_parts"); + return false; + } + ka->keys[ka->keys_len].key_parts_num= 2; + ++ka->keys_len; + if (!wsrep_prepare_key_for_isolation(db, table, + (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts, + &ka->keys[ka->keys_len - 1].key_parts_num)) + { + WSREP_ERROR("Preparing keys for isolation failed"); + return false; + } + + return true; +} + + +static bool wsrep_prepare_keys_for_alter_add_fk(const char* child_table_db, + Alter_info* alter_info, + wsrep_key_arr_t* ka) +{ + Key *key; + List_iterator<Key> key_iterator(alter_info->key_list); + while ((key= key_iterator++)) + { + if (key->type == Key::FOREIGN_KEY) + { + Foreign_key *fk_key= (Foreign_key *)key; + const char *db_name= fk_key->ref_db.str; + const char *table_name= fk_key->ref_table.str; + if (!db_name) + { + db_name= child_table_db; + } + if (!wsrep_prepare_key_for_isolation(db_name, table_name, ka)) + { return false; + } } - - return true; + } + return true; } -/* Prepare key list from db/table and table_list */ -bool wsrep_prepare_keys_for_isolation(THD* thd, - const char* db, - const char* table, - const TABLE_LIST* table_list, - wsrep_key_arr_t* ka) + +static bool wsrep_prepare_keys_for_isolation(THD* thd, + const char* db, + const char* table, + const TABLE_LIST* table_list, + Alter_info* alter_info, + wsrep_key_arr_t* ka) { ka->keys= 0; ka->keys_len= 0; @@@ -1196,35 -1221,38 +1264,34 @@@ for (const TABLE_LIST* table= table_list; table; table= table->next_global) { - wsrep_key_t* tmp; - tmp= (wsrep_key_t*)my_realloc(ka->keys, - (ka->keys_len + 1) * sizeof(wsrep_key_t), - MY_ALLOW_ZERO_PTR); - if (!tmp) - { - WSREP_ERROR("Can't allocate memory for key_array"); + if (!wsrep_prepare_key_for_isolation(table->db.str, table->table_name.str, ka)) goto err; - } - ka->keys= tmp; - if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*) - my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) - { - WSREP_ERROR("Can't allocate memory for key_parts"); - goto err; - } - ka->keys[ka->keys_len].key_parts_num= 2; - ++ka->keys_len; - if (!wsrep_prepare_key_for_isolation(table->db.str, table->table_name.str, - (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts, - &ka->keys[ka->keys_len - 1].key_parts_num)) - { - WSREP_ERROR("Preparing keys for isolation failed (2)"); + } + + if (alter_info && (alter_info->flags & (ALTER_ADD_FOREIGN_KEY))) + { + if (!wsrep_prepare_keys_for_alter_add_fk(table_list->db.str, alter_info, ka)) goto err; - } } + return false; + err: - wsrep_keys_free(ka); - return true; + wsrep_keys_free(ka); + return true; +} + + +/* Prepare key list from db/table and table_list */ +bool wsrep_prepare_keys_for_isolation(THD* thd, + const char* db, + const char* table, + const TABLE_LIST* table_list, + wsrep_key_arr_t* ka) +{ + return wsrep_prepare_keys_for_isolation(thd, db, table, table_list, NULL, ka); } - bool wsrep_prepare_key(const uchar* cache_key, size_t cache_key_len, const uchar* row_id, size_t row_id_len, wsrep_buf_t* key, size_t* key_len) @@@ -1494,11 -1594,6 +1634,10 @@@ static int wsrep_drop_table_query(THD* } } + +/* Forward declarations. */ - static int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len); - static int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len); ++int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len); + /* Decide if statement should run in TOI. diff --cc sql/wsrep_mysqld.h index 819a56b9f23,2d38382148e..54203cbe2c4 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@@ -147,20 -171,16 +171,15 @@@ void wsrep_init_startup(bool before) // Other wsrep global variables extern my_bool wsrep_inited; // whether wsrep is initialized ? - - extern "C" void wsrep_thd_set_exec_mode(THD *thd, enum wsrep_exec_mode mode); - extern "C" void wsrep_thd_set_query_state( - THD *thd, enum wsrep_query_state state); - - extern "C" void wsrep_thd_set_trx_to_replay(THD *thd, uint64 trx_id); - + extern "C" void wsrep_fire_rollbacker(THD *thd); extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd); extern "C" time_t wsrep_thd_query_start(THD *thd); - extern "C" query_id_t wsrep_thd_query_id(THD *thd); + extern void wsrep_close_client_connections(my_bool wait_to_end, + THD *except_caller_thd = NULL); + //extern "C" query_id_t wsrep_thd_query_id(THD *thd); extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd); extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id); -extern "C" void wsrep_set_data_home_dir(const char *data_dir); - extern void wsrep_close_client_connections(my_bool wait_to_end); extern int wsrep_wait_committing_connections_close(int wait_time); extern void wsrep_close_applier(THD *thd); extern void wsrep_wait_appliers_close(THD *thd); diff --cc sql/wsrep_sst.cc index e648a7f4c69,05025b010ce..244baf5e90f --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@@ -177,9 -172,10 +178,10 @@@ bool wsrep_sst_donor_check (sys_var *s bool wsrep_sst_donor_update (sys_var *self, THD* thd, enum_var_type type) { - return 0; + return 0; } + bool wsrep_before_SE() { return (wsrep_provider != NULL diff --cc sql/wsrep_var.cc index f8a494416e2,85297d8fc3f..2cd1c8dd8e2 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@@ -758,3 -802,68 +802,67 @@@ int wsrep_show_status (THD *thd, SHOW_V v->name= 0; // terminator return 0; } + #endif - + #if DYNAMIC + // somehow this mysql status thing works only with statically allocated arrays. + static SHOW_VAR* mysql_status_vars = NULL; + static int mysql_status_len = -1; + #else + static SHOW_VAR mysql_status_vars[512 + 1]; + static const int mysql_status_len = 512; + #endif + + static void export_wsrep_status_to_mysql(THD* thd) + { + int wsrep_status_len, i; + + thd->wsrep_status_vars = Wsrep_server_state::instance().status(); + + wsrep_status_len= thd->wsrep_status_vars.size(); + + #if DYNAMIC + if (wsrep_status_len != mysql_status_len) { + void* tmp = realloc (mysql_status_vars, + (wsrep_status_len + 1) * sizeof(SHOW_VAR)); + if (!tmp) { + + sql_print_error ("Out of memory for wsrep status variables." + "Number of variables: %d", wsrep_status_len); + return; + } + + mysql_status_len = wsrep_status_len; + mysql_status_vars = (SHOW_VAR*)tmp; + } + /* @TODO: fix this: */ + #else + if (mysql_status_len < wsrep_status_len) wsrep_status_len= mysql_status_len; + #endif + + for (i = 0; i < wsrep_status_len; i++) + { + mysql_status_vars[i].name= (char*)thd->wsrep_status_vars[i].name().c_str(); + mysql_status_vars[i].value= (char*)thd->wsrep_status_vars[i].value().c_str(); + mysql_status_vars[i].type= SHOW_CHAR; + } + + mysql_status_vars[wsrep_status_len].name = NullS; + mysql_status_vars[wsrep_status_len].value = NullS; + mysql_status_vars[wsrep_status_len].type = SHOW_LONG; + } + + int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff) + { + if (WSREP_ON) + { + export_wsrep_status_to_mysql(thd); + var->type= SHOW_ARRAY; + var->value= (char *) &mysql_status_vars; + } + return 0; + } + + void wsrep_free_status (THD* thd) + { + thd->wsrep_status_vars.clear(); + }
participants (1)
-
jan