summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <grooverdan@users.sourceforge.net>2015-03-12 05:23:05 +1100
committerDaniel Black <grooverdan@users.sourceforge.net>2015-03-12 05:23:05 +1100
commiteac71ced18e281e2b4e6bd9bb1739d227e9d55d2 (patch)
tree3fa819eba0d71b869d57d96f5db737f6699d7761
parentd61573d3e5c8f9d85b88f9fa2e79160b159bf67d (diff)
downloadmariadb-git-eac71ced18e281e2b4e6bd9bb1739d227e9d55d2.tar.gz
Add Slave_skipped_errors to global status
This counts the number of times a replication event is ignored due to slave_skip_errors.
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_variables.test1
-rw-r--r--sql/log_event.cc8
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/slave.h1
4 files changed, 10 insertions, 2 deletions
diff --git a/mysql-test/suite/engines/funcs/t/rpl_variables.test b/mysql-test/suite/engines/funcs/t/rpl_variables.test
index 031131a3f2b..24a2bcb229c 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_variables.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_variables.test
@@ -15,6 +15,7 @@ show variables like 'slave_load_tmpdir';
# We just set some arbitrary values in variables-master.opt so we can test
# that a list of values works correctly
show variables like 'slave_skip_errors';
+show global status like 'slave_skipped_errors';
# Cleanup
set global slave_net_timeout=@my_slave_net_timeout;
diff --git a/sql/log_event.cc b/sql/log_event.cc
index b8fd02e96d4..d128a5bae44 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -440,8 +440,12 @@ inline int ignored_error_code(int err_code)
break;
}
#endif
- return ((err_code == ER_SLAVE_IGNORED_TABLE) ||
- (use_slave_mask && bitmap_is_set(&slave_error_mask, err_code)));
+ if (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;
}
/*
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 7138027ff0a..992a9035289 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -516,6 +516,7 @@ ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0;
ulong max_connections, max_connect_errors;
ulong extra_max_connections;
ulong slave_retried_transactions;
+ulonglong slave_skipped_errors;
ulong feature_files_opened_with_delayed_keys;
ulonglong denied_connections;
my_decimal decimal_zero;
@@ -7921,6 +7922,7 @@ SHOW_VAR status_vars[]= {
{"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats, SHOW_SIMPLE_FUNC},
{"Slave_retried_transactions",(char*)&slave_retried_transactions, SHOW_LONG},
{"Slave_running", (char*) &show_slave_running, SHOW_SIMPLE_FUNC},
+ {"Slave_skipped_errors", (char*) &slave_skipped_errors, SHOW_LONGLONG},
#endif
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG},
{"Slow_queries", (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS},
diff --git a/sql/slave.h b/sql/slave.h
index e16f801b577..fc48476a6d8 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -130,6 +130,7 @@ extern my_bool opt_log_slave_updates;
extern char *opt_slave_skip_errors;
extern my_bool opt_replicate_annotate_row_events;
extern ulonglong relay_log_space_limit;
+extern ulonglong slave_skipped_errors;
/*
3 possible values for Master_info::slave_running and