Commit eac71ced authored by Daniel Black's avatar Daniel Black

Add Slave_skipped_errors to global status

This counts the number of times a replication event is ignored
due to slave_skip_errors.
parent d61573d3
...@@ -15,6 +15,7 @@ show variables like 'slave_load_tmpdir'; ...@@ -15,6 +15,7 @@ show variables like 'slave_load_tmpdir';
# We just set some arbitrary values in variables-master.opt so we can test # We just set some arbitrary values in variables-master.opt so we can test
# that a list of values works correctly # that a list of values works correctly
show variables like 'slave_skip_errors'; show variables like 'slave_skip_errors';
show global status like 'slave_skipped_errors';
# Cleanup # Cleanup
set global slave_net_timeout=@my_slave_net_timeout; set global slave_net_timeout=@my_slave_net_timeout;
......
...@@ -440,8 +440,12 @@ inline int ignored_error_code(int err_code) ...@@ -440,8 +440,12 @@ inline int ignored_error_code(int err_code)
break; break;
} }
#endif #endif
return ((err_code == ER_SLAVE_IGNORED_TABLE) || if (use_slave_mask && bitmap_is_set(&slave_error_mask, err_code))
(use_slave_mask && bitmap_is_set(&slave_error_mask, err_code))); {
statistic_increment(slave_skipped_errors, LOCK_status);
return true;
}
return err_code == ER_SLAVE_IGNORED_TABLE;
} }
/* /*
......
...@@ -516,6 +516,7 @@ ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; ...@@ -516,6 +516,7 @@ ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0;
ulong max_connections, max_connect_errors; ulong max_connections, max_connect_errors;
ulong extra_max_connections; ulong extra_max_connections;
ulong slave_retried_transactions; ulong slave_retried_transactions;
ulonglong slave_skipped_errors;
ulong feature_files_opened_with_delayed_keys; ulong feature_files_opened_with_delayed_keys;
ulonglong denied_connections; ulonglong denied_connections;
my_decimal decimal_zero; my_decimal decimal_zero;
...@@ -7921,6 +7922,7 @@ SHOW_VAR status_vars[]= { ...@@ -7921,6 +7922,7 @@ SHOW_VAR status_vars[]= {
{"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats, SHOW_SIMPLE_FUNC}, {"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats, SHOW_SIMPLE_FUNC},
{"Slave_retried_transactions",(char*)&slave_retried_transactions, SHOW_LONG}, {"Slave_retried_transactions",(char*)&slave_retried_transactions, SHOW_LONG},
{"Slave_running", (char*) &show_slave_running, SHOW_SIMPLE_FUNC}, {"Slave_running", (char*) &show_slave_running, SHOW_SIMPLE_FUNC},
{"Slave_skipped_errors", (char*) &slave_skipped_errors, SHOW_LONGLONG},
#endif #endif
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG}, {"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG},
{"Slow_queries", (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS}, {"Slow_queries", (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS},
......
...@@ -130,6 +130,7 @@ extern my_bool opt_log_slave_updates; ...@@ -130,6 +130,7 @@ extern my_bool opt_log_slave_updates;
extern char *opt_slave_skip_errors; extern char *opt_slave_skip_errors;
extern my_bool opt_replicate_annotate_row_events; extern my_bool opt_replicate_annotate_row_events;
extern ulonglong relay_log_space_limit; extern ulonglong relay_log_space_limit;
extern ulonglong slave_skipped_errors;
/* /*
3 possible values for Master_info::slave_running and 3 possible values for Master_info::slave_running and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment