mariadb/mysql-test/suite/rpl/r
Brandon Nesterenko 555c12a541 MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure specifics
Problem:
=======

This patch addresses two issues:

 1. An incident event can be incorrectly reported for transactions
which are rolled back successfully. That is, an incident event
should only be generated for failed “non-transactional transactions”
(i.e., those which modify non-transactional tables) because they
cannot be rolled back.

 2. When the mariadb slave (error) stops at receiving the incident
event there's no description of what led to it. Neither in the event
nor in the master's error log.

Solution:
========

Before reporting an incident event for a transaction, first validate
that it is “non-transactional” (i.e. cannot be safely rolled back).
To determine if a transaction is non-transactional,
  lex->stmt_accessed_table(LEX::STMT_WRITES_NON_TRANS_TABLE)
is used because it is set previously in
THD::decide_logging_format().

Additionally, when an incident event is written, write an error
message to the server’s error log to indicate the underlying issue.

Reviewed by:
===========
Andrei Elkin <andrei.elkin@mariadb.com>
2022-07-25 16:26:53 -06:00
..
circular_serverid0.result
create_or_replace2.result
create_or_replace_mix.result
create_or_replace_row.result
create_or_replace_statement.result
create_select.result
failed_create_view-6409.result
ignore_table_autoinc-9737.result
kill_hard-6290.result
kill_race_condition.result
last_insert_id.result
mdev_17588.result
mdev_24667.result
myisam_external_lock.result
mysql-wsrep#110-2.result
parallel_conflicts.result
rename.result
replace.result
rpl000001.a.result
rpl000001.b.result
rpl_000010.result
rpl_000011.result
rpl_000013.result
rpl_000017.result
rpl_15867.result
rpl_15919.result
rpl_alter.result
rpl_alter_db.result
rpl_alter_extra_persistent.result
rpl_alter_instant.result
rpl_auto_increment.result
rpl_auto_increment_11932.result
rpl_auto_increment_bug33029.result
rpl_auto_increment_bug45679.result
rpl_auto_increment_update_failure.result
rpl_autogen_query_multi_byte_char.result
rpl_begin_commit_rollback.result
rpl_binlog_compress.result
rpl_binlog_corruption.result
rpl_binlog_dump_slave_gtid_state_info.result
rpl_binlog_dup_entry.result
rpl_binlog_errors.result
rpl_binlog_grant.result
rpl_binlog_index.result
rpl_binlog_rollback_cleanup.result
rpl_bit.result
rpl_bit_npk.result
rpl_blackhole.result
rpl_blackhole_row_annotate.result
rpl_bug26395.result
rpl_bug31076.result
rpl_bug33931.result
rpl_bug37426.result
rpl_bug38694.result
rpl_bug41902.result
rpl_cant_read_event_incident.result
rpl_change_master.result
rpl_change_master_find_log_pos_err.result
rpl_charset.result
rpl_charset_sjis.result
rpl_checksum.result
rpl_checksum_cache.result
rpl_circular_for_4_hosts.result
rpl_colSize.result
rpl_commit_after_flush.result
rpl_concurrency_error.result
rpl_conditional_comments.result
rpl_connection.result
rpl_corruption.result
rpl_create_database.result
rpl_create_drop_db.result
rpl_create_drop_event.result
rpl_create_drop_function.result
rpl_create_drop_index.result
rpl_create_drop_procedure.result
rpl_create_drop_role.result
rpl_create_drop_trigger.result
rpl_create_drop_udf.result
rpl_create_drop_user.result
rpl_create_drop_view.result
rpl_create_if_not_exists.result
rpl_create_or_replace_fail.result
rpl_create_tmp_table_if_not_exists.result
rpl_critical_errors.result
rpl_critical_errors.result.txt
rpl_cross_version.result
rpl_ctype_latin1.result
rpl_current_user.result
rpl_ddl.result
rpl_deadlock_innodb.result
rpl_default.result
rpl_delayed_slave,parallel.rdiff
rpl_delayed_slave.result
rpl_delayed_slave2.result
rpl_delete_no_where.result
rpl_do_grant.result
rpl_domain_id_filter.result
rpl_domain_id_filter_io_crash.result
rpl_domain_id_filter_master_crash.result
rpl_domain_id_filter_parallel.result
rpl_domain_id_filter_restart.result
rpl_drop.result
rpl_drop_db.result
rpl_drop_db_fail.result
rpl_drop_temp.result
rpl_drop_view.result
rpl_dual_pos_advance.result
rpl_dump_request_retry_warning.result
rpl_EE_err.result
rpl_empty_master_host.result
rpl_empty_string_is_null.result
rpl_err_ignoredtable.result
rpl_events.result
rpl_extra_col_master_innodb.result
rpl_extra_col_master_myisam.result
rpl_extra_col_slave_innodb.result
rpl_extra_col_slave_myisam.result
rpl_fail_register.result
rpl_failed_optimize.result
rpl_filter_dbs_dynamic.result
rpl_filter_tables_dynamic.result
rpl_filter_tables_not_exist.result
rpl_filter_wild_tables_dynamic.result
rpl_flush_logs.result
rpl_flushlog_loop.result
rpl_foreign_key_innodb.result
rpl_free_items.result
rpl_function_defaults.result
rpl_geometry.result
rpl_get_lock.result
rpl_get_master_version_and_clock.result
rpl_grant.result
rpl_gtid_basic.result
rpl_gtid_crash.result
rpl_gtid_crash_myisam.result
rpl_gtid_delete_domain.result
rpl_gtid_errorhandling.result
rpl_gtid_errorlog.result
rpl_gtid_excess_initial_delay.result
rpl_gtid_glle_no_terminate.result
rpl_gtid_grouping.result
rpl_gtid_ignored.result
rpl_gtid_master_promote.result
rpl_gtid_mdev4473.result
rpl_gtid_mdev4474.result
rpl_gtid_mdev4484.result
rpl_gtid_mdev4485.result
rpl_gtid_mdev4820.result
rpl_gtid_mdev9033.result
rpl_gtid_misc.result
rpl_gtid_nobinlog.result
rpl_gtid_reconnect.result
rpl_gtid_sort.result
rpl_gtid_startpos.result
rpl_gtid_stop_start.result
rpl_gtid_strict.result
rpl_gtid_until.result
rpl_heartbeat.result
rpl_heartbeat_2slaves.result
rpl_heartbeat_basic.result
rpl_heartbeat_debug.result
rpl_heartbeat_ssl.result
rpl_hrtime.result
rpl_hrtime_row.result
rpl_idempotency.result
rpl_ignore_grant.result
rpl_ignore_revoke.result
rpl_ignore_table.result
rpl_ignore_table_update.result
rpl_incident.result
rpl_incompatible_heartbeat.result
rpl_init_slave.result
rpl_init_slave_errors.result
rpl_innodb_bug28430.result
rpl_innodb_bug30888.result
rpl_innodb_bug68220.result
rpl_innodb_mixed_ddl.result
rpl_innodb_mixed_dml.result
rpl_insert.result
rpl_insert_delayed,stmt.rdiff
rpl_insert_delayed.result
rpl_insert_id.result
rpl_insert_id_pk.result
rpl_insert_ignore.result
rpl_invoked_features.result
rpl_iodku,stmt.rdiff
rpl_iodku.result
rpl_ip_mix.result
rpl_ip_mix2.result
rpl_ipv4_as_ipv6.result
rpl_ipv6.result
rpl_killed_ddl.result
rpl_known_bugs_detection.result
rpl_lcase_tblnames_rewrite_db.result
rpl_LD_INFILE.result
rpl_loaddata.result
rpl_loaddata_charset.result
rpl_loaddata_fatal.result
rpl_loaddata_m.result
rpl_loaddata_map.result
rpl_loaddata_s.result
rpl_loaddata_simple.result
rpl_loaddata_symlink.result
rpl_loaddatalocal.result
rpl_loadfile.result
rpl_locale.result
rpl_log_pos.result
rpl_lost_events_on_rotate.result
rpl_manual_change_index_file.result
rpl_many_optimize.result
rpl_mariadb_slave_capability.result
rpl_mark_optimize_tbl_ddl.result
rpl_master_pos_wait.result
rpl_mdev-11092.result
rpl_mdev359.result
rpl_mdev382.result
rpl_mdev6020.result
rpl_mdev6386.result
rpl_mdev8193.result
rpl_mdev10863.result
rpl_mdev12179.result
rpl_mdev_17614.result
rpl_misc_functions.result
rpl_mix_found_rows.result
rpl_mixed_binlog_max_cache_size.result
rpl_mixed_bit_pk.result
rpl_mixed_ddl_dml.result
rpl_mixed_drop_create_temp_table.result
rpl_mixed_implicit_commit_binlog.result
rpl_mixed_mixing_engines.result
rpl_mixed_row_innodb.result
rpl_multi_delete.result
rpl_multi_delete2.result
rpl_multi_engine.result
rpl_multi_update.result
rpl_multi_update2.result
rpl_multi_update3.result
rpl_multi_update4.result
rpl_mysql_upgrade.result
rpl_name_const.result
rpl_non_direct_mixed_mixing_engines.result
rpl_non_direct_row_mixing_engines.result
rpl_non_direct_stm_mixing_engines.result
rpl_nondeterministic_functions.result
rpl_not_null_innodb.result
rpl_not_null_myisam.result
rpl_old_decimal.result
rpl_old_master.result
rpl_optimize.result
rpl_packet.result
rpl_parallel.result
rpl_parallel2.result
rpl_parallel_charset.result
rpl_parallel_conflicts.result
rpl_parallel_ignored_errors.result
rpl_parallel_mdev6589.result
rpl_parallel_multilevel.result
rpl_parallel_multilevel2.result
rpl_parallel_no_log_slave_updates.result
rpl_parallel_optimistic.result
rpl_parallel_optimistic_nobinlog.result
rpl_parallel_optimistic_until.result
rpl_parallel_partition.result
rpl_parallel_retry.result
rpl_parallel_show_binlog_events_purge_logs.result
rpl_parallel_temptable.result
rpl_partition_archive.result
rpl_partition_innodb.result
rpl_partition_memory.result
rpl_partition_myisam.result
rpl_password_boundaries.result
rpl_performance_schema.result
rpl_plugin_load.result
rpl_ps.result
rpl_rbr_to_sbr.result
rpl_read_new_relay_log_info.result
rpl_read_old_relay_log_info.result
rpl_read_only.result
rpl_read_only2.result
rpl_relay_max_extension.result
rpl_relay_space_innodb.result
rpl_relay_space_myisam.result
rpl_relayrotate.result
rpl_relayspace.result
rpl_reopen_temp_table.result
rpl_replicate_do.result
rpl_replicate_ignore_db.result
rpl_report.result
rpl_report_port.result
rpl_reset_slave_all_clears_filters.result
rpl_reset_slave_fail.result
rpl_rewrt_db.result
rpl_rotate_logs.result
rpl_rotate_purge_deadlock.result
rpl_row_001.result
rpl_row_4_bytes.result
rpl_row_annotate_do.result
rpl_row_annotate_dont.result
rpl_row_basic_2myisam.result
rpl_row_basic_3innodb.result
rpl_row_basic_8partition.result
rpl_row_basic_11bugs.result
rpl_row_big_table_id,32bit.rdiff
rpl_row_big_table_id.result
rpl_row_binlog_max_cache_size.result
rpl_row_blob_innodb.result
rpl_row_blob_myisam.result
rpl_row_colSize.result
rpl_row_conflicts.result
rpl_row_corruption.result
rpl_row_create_select.result
rpl_row_create_table.result
rpl_row_delayed_ins.result
rpl_row_drop.result
rpl_row_drop_create_temp_table.result
rpl_row_drop_temp_table.result
rpl_row_end_of_statement_loss.result
rpl_row_err_ignoredtable.result
rpl_row_find_row.result
rpl_row_find_row_debug.result
rpl_row_flsh_tbls.result
rpl_row_func001.result
rpl_row_func002.result
rpl_row_func003.result
rpl_row_idempotency.result
rpl_row_img_blobs.result
rpl_row_img_eng_min.result
rpl_row_img_eng_noblob.result
rpl_row_img_sequence.result
rpl_row_implicit_commit_binlog.result
rpl_row_index_choice.result
rpl_row_inexist_tbl.result
rpl_row_lcase_tblnames.result
rpl_row_loaddata_concurrent.result
rpl_row_loaddata_m.result
rpl_row_log.result
rpl_row_log_innodb.result
rpl_row_max_relay_size.result
rpl_row_merge_engine.result
rpl_row_mixing_engines.result
rpl_row_multi_query.result
rpl_row_mysqlbinlog.result
rpl_row_NOW.result
rpl_row_rec_comp_innodb.result
rpl_row_rec_comp_myisam.result
rpl_row_reset_slave.result
rpl_row_rollback_to_savepoint.result
rpl_row_show_relaylog_events.result
rpl_row_sp001.result
rpl_row_sp002_innodb.result
rpl_row_sp003.result
rpl_row_sp005.result
rpl_row_sp006_InnoDB.result
rpl_row_sp007_innodb.result
rpl_row_sp008.result
rpl_row_sp009.result
rpl_row_sp010.result
rpl_row_sp011.result
rpl_row_sp012.result
rpl_row_spatial.result
rpl_row_tabledefs_2myisam.result
rpl_row_tabledefs_3innodb.result
rpl_row_tbl_metadata.result
rpl_row_to_stmt.result
rpl_row_trig001.result
rpl_row_trig002.result
rpl_row_trig003.result
rpl_row_trig004.result
rpl_row_triggers.result
rpl_row_trunc_temp.result
rpl_row_type_conv_err_msg.result
rpl_row_unsafe_funcs.result
rpl_row_until.result
rpl_row_USER.result
rpl_row_utf16.result
rpl_row_utf32.result
rpl_row_UUID.result
rpl_row_vcol_crash.result
rpl_row_view01.result
rpl_row_virt.result
rpl_row_wide_table.result
rpl_savepoint.result
rpl_seconds_behind_master_spike.result
rpl_semi_sync.result
rpl_semi_sync_after_sync.result
rpl_semi_sync_after_sync_row.result
rpl_semi_sync_event.result
rpl_semi_sync_event_after_sync.result
rpl_semi_sync_gtid_reconnect.result
rpl_semi_sync_master_shutdown.result
rpl_semi_sync_skip_repl.result
rpl_semi_sync_slave_compressed_protocol.result
rpl_semi_sync_slave_reply_fail.result
rpl_semi_sync_wait_no_slave.result
rpl_semi_sync_wait_point.result
rpl_semisync_ali_issues.result
rpl_server_id1.result
rpl_server_id2.result
rpl_server_id_ignore.result
rpl_session_var.result
rpl_set_charset.result
rpl_set_null_innodb.result
rpl_set_null_myisam.result
rpl_set_statement.result
rpl_set_statement_default_master.result
rpl_show_slave_hosts.result
rpl_show_slave_running.result
rpl_skip_error.result
rpl_skip_incident.result
rpl_skip_replication.result
rpl_slave_grp_exec.result
rpl_slave_invalid_external_user.result
rpl_slave_load_in.result
rpl_slave_load_remove_tmpfile.result
rpl_slave_load_tmpdir_not_exist.result
rpl_slave_shutdown_mdev20821.result
rpl_slave_skip.result
rpl_slave_status.result
rpl_slow_query_log.result
rpl_sp.result
rpl_sp004.result
rpl_sp_effects.result
rpl_sp_variables.result
rpl_spec_variables.result
rpl_special_charset.result
rpl_sporadic_master.result
rpl_ssl.result
rpl_ssl1.result
rpl_start_stop_slave.result
rpl_stm_000001.result
rpl_stm_auto_increment_bug33029.result
rpl_stm_binlog_max_cache_size.result
rpl_stm_conflicts.result
rpl_stm_drop_create_temp_table.result
rpl_stm_EE_err2.result
rpl_stm_flsh_tbls.result
rpl_stm_found_rows.result
rpl_stm_implicit_commit_binlog.result
rpl_stm_innodb.result
rpl_stm_lcase_tblnames.result
rpl_stm_loaddata_concurrent.result
rpl_stm_loadfile.result
rpl_stm_log.result
rpl_stm_maria.result
rpl_stm_max_relay_size.result
rpl_stm_mix_show_relaylog_events.result
rpl_stm_mixing_engines.result
rpl_stm_multi_query.result
rpl_stm_no_op.result
rpl_stm_relay_ign_space.result
rpl_stm_reset_slave.result
rpl_stm_sp.result
rpl_stm_sql_mode.result
rpl_stm_start_stop_slave.result
rpl_stm_stop_middle_group.result
rpl_stm_until.result
rpl_stm_user_variables.result
rpl_stop_slave.result
rpl_stop_slave_error.result
rpl_strict_password_validation.result
rpl_switch_stm_row_mixed.result
rpl_sync.result
rpl_sync_with_innodb_thd_conc.result
rpl_table_options.result
rpl_temp_table.result
rpl_temp_table_mix_row.result
rpl_temporal_format_default_to_default.result
rpl_temporal_format_mariadb53_to_mariadb53.result
rpl_temporal_format_mariadb53_to_mysql56.result
rpl_temporal_format_mariadb53_to_mysql56_dst.result
rpl_temporal_format_mysql56_to_mariadb53.result
rpl_temporal_format_mysql56_to_mysql56.result
rpl_temporal_mysql56.result
rpl_temporal_mysql56_to_mariadb.result
rpl_temporal_mysql56_to_mariadb53.result
rpl_temporary.result
rpl_temporary_error2.result
rpl_temporary_errors.result
rpl_test_framework.result
rpl_timezone.result
rpl_tmp_table_and_DDL.result
rpl_tmp_table_and_DDL_innodb.result
rpl_trans_no_trans.result
rpl_trigger.result
rpl_trunc_temp.result
rpl_truncate_2myisam.result
rpl_truncate_3innodb.result
rpl_typeconv.result
rpl_typeconv_innodb.result
rpl_udf.result
rpl_unsafe_statements.result
rpl_update.result
rpl_upgrade_master_info.result
rpl_user.result
rpl_user_variables.result
rpl_variables.result
rpl_variables_stm.result
rpl_view.result
rpl_view_debug.result
rpl_view_multi.result
sec_behind_master-5114.result
semisync_future-7591.result
semisync_memleak_4066.result
sequence.result
show_status_stop_slave_race-7126.result
temporal_row-9560,old2new.rdiff
temporal_row-9560.result