Re: Error 1236 corrupt binlog on master

2004-03-25 Thread Sasha Pachev
Arvind Gangal wrote:
I have been using the mysqlbinlog to investigate the 'saturn2-bin.051'
binlog file.. I have come to pinpoint the problem position in the binlog,
but don't know how i can bypass the corrupted segment.
This is a bit tricky. Open the binlog in a hex editor, and go to the last good 
offset (printed in the comments). At offset 9 from there you will find a 4-byte 
integer in little-endian format. That is the length of the last good event. Add 
it to the last good offset. Now you are at the corrupted event. This is where 
the science ends and the black magic begins.

Again, at offset 9 you will find what is supposed to be the event length, and at 
offset 4 you will find 1 byte event type code. The codes are listed in 
sql/log_event.h in the enum Log_event_type. Figure out where the next good event 
really starts, and fix up the type to be something innocent (eg. INTVAR_EVENT) + 
the length so that you will jump to the next event.

As a word of caution, you may not find much useful data after the corrupted 
event, but if it is at the end of file, you can manually put a ROTATE_EVENT to 
instruct the slave to switch to the next log.

However, if this is a practical problem, and not just a study of how things 
work, I would suggest reporting the bug ( if this happened with the latest 
version), and resetting the replication.

--
Sasha Pachev
Create online surveys at http://www.surveyz.com/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Error 1236 corrupt binlog on master

2004-03-25 Thread Arvind Gangal
I have been using the mysqlbinlog to investigate the 'saturn2-bin.051'
binlog file.. I have come to pinpoint the problem position in the binlog,
but don't know how i can bypass the corrupted segment.

Please help.
Thanks
Arvind.

-Original Message-
From: Arvind Gangal [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 21:17
To: '[EMAIL PROTECTED]'
Subject: Error 1236 corrupt binlog on master


Hello Gurus,
 
Anyone have any ideas as to how I should handle a case of the following
error?

040324 21:02:05  Slave I/O thread: connected to master
 '[EMAIL PROTECTED]:3306',  replication
started in log 'saturn2-bin.051' at position 442744915
040324 21:02:05  Error in Log_event::read_log_event(): 'read error',
data_len=657471024,event_type=61
040324 21:02:05  Slave SQL thread: I/O error reading event(errno: -1
cur_log->error: 1723122)
040324 21:02:05  Error reading relay log event: Aborting slave SQL thread
because of partial event read
040324 21:02:05  Could not parse log event entry, check the master for
binlog corruption
This may also be a network problem, or just a bug in the master or slave
code.
040324 21:02:05  Error running query, slave SQL thread aborted. Fix the
problem, and restart the slave SQL thread with "SLAVE START". We stopped at
log 'satur
n2-bin.051' position 442744915
040324 21:02:05  Error reading packet from server: binlog truncated in the
middle of event (server_errno=1236)
040324 21:02:05  Got fatal error 1236: 'binlog truncated in the middle of
event' from master when reading data from binary log
040324 21:02:05  Slave I/O thread exiting, read up to log 'saturn2-bin.051',
position 442744915

Replication seems to have stopped at that point and the slave keeps trying
to connect and dies at with that error.

I think that the binlog file 'saturn2-bin.051' on master has got courrupted.
Is there any way i can start after the point of corruption in the binary
file?

Thanks,
Arvind
 
Arvind Gangal Senior Analyst Programmer 

address: 4 Buckingham Gate, London SW1E 6JP 
tel: +44 (0)20 7802 4306 fax: +44 (0)20 7802 9302 mob: 07734938242 
email:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] internet:
<http://www.lastminute.com/> http://www.lastminute.com 


do something lastminute.com 


 

 



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk


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



Error 1236 corrupt binlog on master

2004-03-24 Thread Arvind Gangal
Hello Gurus,
 
Anyone have any ideas as to how I should handle a case of the following
error?

040324 21:02:05  Slave I/O thread: connected to master
 '[EMAIL PROTECTED]:3306',  replication
started in log 'saturn2-bin.051' at position 442744915
040324 21:02:05  Error in Log_event::read_log_event(): 'read error',
data_len=657471024,event_type=61
040324 21:02:05  Slave SQL thread: I/O error reading event(errno: -1
cur_log->error: 1723122)
040324 21:02:05  Error reading relay log event: Aborting slave SQL thread
because of partial event read
040324 21:02:05  Could not parse log event entry, check the master for
binlog corruption
This may also be a network problem, or just a bug in the master or slave
code.
040324 21:02:05  Error running query, slave SQL thread aborted. Fix the
problem, and restart the slave SQL thread with "SLAVE START". We stopped at
log 'satur
n2-bin.051' position 442744915
040324 21:02:05  Error reading packet from server: binlog truncated in the
middle of event (server_errno=1236)
040324 21:02:05  Got fatal error 1236: 'binlog truncated in the middle of
event' from master when reading data from binary log
040324 21:02:05  Slave I/O thread exiting, read up to log 'saturn2-bin.051',
position 442744915

Replication seems to have stopped at that point and the slave keeps trying
to connect and dies at with that error.

I think that the binlog file 'saturn2-bin.051' on master has got courrupted.
Is there any way i can start after the point of corruption in the binary
file?

Thanks,
Arvind
 
Arvind Gangal Senior Analyst Programmer 

address: 4 Buckingham Gate, London SW1E 6JP 
tel: +44 (0)20 7802 4306 fax: +44 (0)20 7802 9302 mob: 07734938242 
email:   [EMAIL PROTECTED] internet:
 http://www.lastminute.com 


do something lastminute.com 


 

 



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk