Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7198

[PATCH] status variable for Slave_skipped_errors

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 10.1.4
    • Component/s: Replication
    • Labels:

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              knielsen Kristian Nielsen added a comment -

              > 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.

              Show
              knielsen Kristian Nielsen added a comment - > 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.
              Show
              danblack Daniel Black added a comment - https://github.com/MariaDB/server/pull/20
              Hide
              knielsen Kristian Nielsen added a comment -

              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.

              Show
              knielsen Kristian Nielsen added a comment - 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.
              Hide
              knielsen Kristian Nielsen added a comment -

              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.

              Show
              knielsen Kristian Nielsen added a comment - 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.
              Hide
              knielsen Kristian Nielsen added a comment -

              Pushed to 10.1.4, thanks Daniel!

              Show
              knielsen Kristian Nielsen added a comment - Pushed to 10.1.4, thanks Daniel!
              Hide
              elenst Elena Stepanova added a comment -

              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.

              Show
              elenst Elena Stepanova added a comment - 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.
              Hide
              danblack Daniel Black added a comment -

              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.

              Show
              danblack Daniel Black added a comment - 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.
              Hide
              elenst Elena Stepanova added a comment -

              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;
              
              Show
              elenst Elena Stepanova added a comment - 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;
              Hide
              danblack Daniel Black added a comment -

              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.

              Show
              danblack Daniel Black added a comment - 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.

                People

                • Assignee:
                  knielsen Kristian Nielsen
                  Reporter:
                  danblack Daniel Black
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: