[MDEV-7198] [PATCH] status variable for Slave_skipped_errors Created: 2014-11-25  Updated: 2015-05-26  Resolved: 2015-03-17

Status: Closed
Project: MariaDB Server
Component/s: Replication
Fix Version/s: 10.1.4

Type: Task Priority: Major
Reporter: Daniel Black Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
Labels: slave

Attachments: File slave_skipped_errors.patch    
Issue Links:
Relates
relates to MDEV-6457 preserve slave_skip_errors binlog eve... Open

 Description   

From MDEV-6457 was a suggestion for a status variable to report slave_skipped_errors.

Wasn't sure if I needed a mutex around this to account for potential parallel replication error faults occurring at the same time (probably yes).

attached patch against 10.0.15-trunk



 Comments   
Comment by Kristian Nielsen [ 2015-02-04 ]

> Wasn't sure if I needed a mutex around this to account for potential
> parallel replication error faults occurring at the same time (probably yes).

Yes, you will need a mutex when setting and reading. Or you can use an atomic
increment and corresponding atomic read.

It's not just for parallel replication, also for multi-source.

Comment by Daniel Black [ 2015-03-11 ]

https://github.com/MariaDB/server/pull/20

Comment by Kristian Nielsen [ 2015-03-16 ]

The patch changes file mysql-test/suite/engines/funcs/t/rpl_variables.test,
but not mysql-test/suite/engines/funcs/t/rpl_variables.result. Sounds like you
never actually ran this test?

(I'm not sure what the engines/funcs/ suite is actually used for, you should
double-check that or maybe better make the test in another place, like
mysql-test/suite/rpl/ for example).

Please also make sure that the tests actually fail with the code part of the
patch missing, and that it tests most important part of the functionality.

Also, please write up some text suitable for documentation in the
knowledge base.

The code part of the patch looks good now, I think, using statistic_increment
seems appropriate.

Comment by Kristian Nielsen [ 2015-03-16 ]

I've merged it into 10.1 and pushed to bb-10.1-knielsen for a buidbot run.
If everything looks ok, I'll push to main 10.1 tomorrow.

Comment by Kristian Nielsen [ 2015-03-17 ]

Pushed to 10.1.4, thanks Daniel!

Comment by Elena Stepanova [ 2015-05-25 ]

I wonder if it's been done on purpose that FLUSH STATUS does not reset the value. Either way is reasonable, so I don't have a strong opinion about it, just something to note.

Comment by Daniel Black [ 2015-05-26 ]

really? it isn't of type SHOW_LONG_NOFLUSH so it looks like sql_show.cc:reset_status_vars would reset this like other LONG global status variables.

Comment by Elena Stepanova [ 2015-05-26 ]

And yet..

[connection master]
create table t1 (pk int primary key);
connection slave;
 
############### Initial status
show global status like 'Slave_skipped_errors';
Variable_name	Value
Slave_skipped_errors	0
show global status like 'Table_locks_immediate';
Variable_name	Value
Table_locks_immediate	44
############### 
 
insert into t1 values (1);
connection master;
insert into t1 values (1);
connection slave;
 
############### After one skipped error
show global status like 'Slave_skipped_errors';
Variable_name	Value
Slave_skipped_errors	1
show global status like 'Table_locks_immediate';
Variable_name	Value
Table_locks_immediate	47
############### 
 
flush status;
 
############### Locks are flushed, but the skipped error isn't
show global status like 'Slave_skipped_errors';
Variable_name	Value
Slave_skipped_errors	1
show global status like 'Table_locks_immediate';
Variable_name	Value
Table_locks_immediate	0
############### 
 
connection master;
drop table t1;
connection slave;
connection master;

Comment by Daniel Black [ 2015-05-26 ]

ah type SHOW_LONGLONG for Slave_skipped_errors and only SHOW_LONG get reset.

I guess someone made a decision a while ago that big vars weren't to be reset.

well noted.

Generated at Thu Feb 08 07:17:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.