R: how use sql_slave_skip_counter to restore slave replication

2006-01-10 Thread AESYS S.p.A. [Enzo Arlati]

I already tried the option --slave-skip-errors, but i didn't work as
expected.
When this option is enabled, the slave didn't report the error message, but
the slave is stopped due the error.

The target I need to reech is to get two server A e B, each of them have its
own db server and a set of application on top of it.
Only one server should be active ( suppose A ), while on the other (B), an
application detect that A is already running and configure at run-time B as
slave.
When A crash or for some other reason stop working, an application on B ,
which loose the communication with A, configure B as master.
When A restart, it check B , and verify that B is the master, so it
configure itself as slave.
All these should work automatically, that is without manual operations.

For this application the critical point is that one of this server must
always be running.
If I loose a little amount of data (mainly log data), this should be
considered a little problem.


What I have to resolve is the lots of duplicate data I receive.
Also this is not clear, because I should undertand that if both the server
for some reason works at the same time for a while but I can't undertand
while the same error for the same keys happened so many times.
It seems that somewhere remains this commands which are aplways resubmitted,
also if I clear both master and slave.


-Messaggio originale-
Da: sheeri kritzer [mailto:[EMAIL PROTECTED]
Inviato: lunedì 9 gennaio 2006 19.46
A: mysql@lists.mysql.com
Oggetto: Re: how use sql_slave_skip_counter to restore slave replication


(still catching up, sorry about the old issues)

Don't know what version is being used here, but one thing you might
want to use, if you're just going to skip the errors anyway (hopefully
you understand WHY you're getting them), is to start replication with
the

--slave-skip-errors

option -- you can skip only the errors you want or all errors.

See:
http://dev.mysql.com/doc/refman/5.1/en/replication-options.html

I'd recommend getting replication up to speed with the
slave-skip-errors option, then stopping the slave, taking out that
option, so that new errors will show up.

.

I'm also going to guess that the original poster did not lock all
tables for the duration of the backup, getting a *snapshot* backup of
the database, and that's why the replication errors happened.

-Sheeri


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: R: how use sql_slave_skip_counter to restore slave replication

2006-01-10 Thread Gleb Paharenko
Hello.



 I already tried the option --slave-skip-errors, but i didn't work as

 expected.

 When this option is enabled, the slave didn't report the error

message, but

 the slave is stopped due the error.



May be server dies due an error message which was not included in the

slave-skip-errors list? With all option server should run regardless of

what happens.







AESYS S.p.A. [Enzo Arlati] wrote:

 I already tried the option --slave-skip-errors, but i didn't work as

 expected.

 When this option is enabled, the slave didn't report the error message, but

 the slave is stopped due the error.

 

 The target I need to reech is to get two server A e B, each of them have its

 own db server and a set of application on top of it.

 Only one server should be active ( suppose A ), while on the other (B), an

 application detect that A is already running and configure at run-time B as

 slave.

 When A crash or for some other reason stop working, an application on B ,

 which loose the communication with A, configure B as master.

 When A restart, it check B , and verify that B is the master, so it

 configure itself as slave.

 All these should work automatically, that is without manual operations.

 

 For this application the critical point is that one of this server must

 always be running.

 If I loose a little amount of data (mainly log data), this should be

 considered a little problem.

 

 

 What I have to resolve is the lots of duplicate data I receive.

 Also this is not clear, because I should undertand that if both the server

 for some reason works at the same time for a while but I can't undertand

 while the same error for the same keys happened so many times.

 It seems that somewhere remains this commands which are aplways resubmitted,

 also if I clear both master and slave.

 

 





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



R: how use sql_slave_skip_counter to restore slave replication

2005-12-30 Thread AESYS S.p.A. [Enzo Arlati]

So it should be possible to automate a skip of errors setting by code , at
run-time, sql_slave_skip_counter = 1, each time I check the slave status and
I found an error, and then I restart the slave
Thanks, I should try this way.

One think it is astonished: I can agree that there should bu some conflict,
but why i have remove the same row, with tha same key value several times
 about 5-6 times ).
Do you have some knowledge of problem like that ?

-Messaggio originale-
Da: Gleb Paharenko [mailto:[EMAIL PROTECTED]
Inviato: giovedì 29 dicembre 2005 17.00
A: mysql@lists.mysql.com
Oggetto: Re: how use sql_slave_skip_counter to restore slave replication


Hello.   but the problem is the same and the command 'show slave status'
report a skip_counter filed equals 0.
 Where I am wrong , some can help me ?  This variable is  the number of
events from the master that a slave server should skip.
sql_slave_skip_counter decrements each time the slave skips one event. Your
slave has already skipped 5 events, so the value of events that it should
skip is 0.

AESYS S.p.A. [Enzo Arlati] wrote:  I'm trying to use teh parameter
sql_slave_skip_counter at run-time to
 restore slave replication.
 When a slave replication broke due some errors in code, my be a duplicate
 key, the only working way to restore the replica where to delete the 
existing record which conflicts whith the ones inserted by the replication
process.
 So if I have a duplicate key 30020 ,I have to remove the record with the
id  30020 and the replication can reinsert it's copy of record with id =
30020.
 This should be difficult to automate so I try another way using the global
 variable sql_slave_skip_counter.I try to skip 5 records using a
statemente like this:
 set global sql_slave_skip_counter = 5;
 and then restart the slavre  start slave;
   but the problem is the same and the command 'show slave status' report
a  skip_counter filed equals 0.
   Where I am wrong , some can help me ?  Regards, Enzo   

--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: R: how use sql_slave_skip_counter to restore slave replication

2005-12-30 Thread Gleb Paharenko
Hello.



 One think it is astonished: I can agree that there should bu some

conflict,  but why i have remove the same row, with the same key value

several times about 5-6 times ).Do you have some knowledge of problem

like that ?



It is difficult to say something, because the whole picture of your

application isn't clear for me. Provide short description of

application's logic, include CREATE statements for your tables

and main queries. Make it in a compact form as much as possible.

I have a question: queries which causes 'duplicate key' errors should

fail on the master, and therefore they can't be replicated. Are you

directly update your slave? Or probably you have an old version 

which is buggy?





AESYS S.p.A. [Enzo Arlati] wrote:

 So it should be possible to automate a skip of errors setting by code , at

 run-time, sql_slave_skip_counter = 1, each time I check the slave status and

 I found an error, and then I restart the slave

 Thanks, I should try this way.

 

 One think it is astonished: I can agree that there should bu some conflict,

 but why i have remove the same row, with tha same key value several times

  about 5-6 times ).

 Do you have some knowledge of problem like that ?



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]