2

When an error occurs on a slave while executing a statement from the master, it is sometimes useful to use SQL_SLAVE_SKIP_COUNTER variable to skip the execution of the query, like this:

STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE;

While this works for main replication thread, I wonder how this is possible on a MariaDB Multi-source replication thread?

3

Change the default_master_connection variable for the session to make it work for a specific multi-source connection:

STOP SLAVE 'src1';
SET @@default_master_connection = 'src1';
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE 'src1';
SET @@default_master_connection = '';
  • While your answer is correct and I voted up, I would add that one should always store and then restore the old value of @@default_master_connection. This may present some kinds of human errors. – Federico Razzoli Jun 18 '15 at 9:03
  • You're right. However @@default_master_connection variable is defined only for the current session and will be reset when you reconnect. – Nicolas Payart Jun 18 '15 at 9:27
  • Yes, but the current session is supposed to be root, so I do everything I can to avoid possible mistakes in production. Personal opinion, of course. – Federico Razzoli Jun 18 '15 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.