Re: Replication race bug in sequential file cache (mf_iocache.cc)
am 29.06.2002 09:38:12 von Michael WideniusHi!
>>>>> "Nils" == Nils Ulltveit-Moe
Nils> I checked using csplit, and the problem occured at
Nils> approximately 1/3 of the log file, so the problem does not seem t=
o
Nils> happen when a new log fil is started:
Nils> File size:
Nils> -rw-rw---- 1 mysql mysql 2160469 Jun 12 06:25 /var/lib/=
mysql/snort-bin.118
Nils> Fault position:
Nils> snort:~# csplit /var/lib/mysql/snort-bin.118 '/767\,\ /'
Nils> 605129
Nils> 1555340
Nils> As I stated in my initial mail, the log showed the mangled INSERT=
Nils> sentences below, in which an insert to the signature table was
Nils> overwritten by an insert from the event table in Snort, as the ex=
cerpt
Nils> from the log below shows:
Nils> =09INSERT INTO signature (sid, sig_id, sig_name,sig_rev,sig_sid)
Nils> VALUES (1,767, 'spp_portscan: End of portscan=20
Nils> =C2"=À)ÍsnortINSERT INTO event (sid,cid,signatu;
Yes, the above indicates that one of the following problems happened:
a) There is a race condition in the code that write to the io-cache.
b) There is race condition between writing the binary log in the main t=
hread
and reading the log in a slave.
c) There is some bug that changes the file position for the binary log
file so that main thread writes to a wrong position.
d) While writing to the binary log we get an error (like out-of-memory)=
that cause the logging code to write an half entry.
In 3.23:
a) I did a second check of the mutex, and all seams to be ok.
b) should be impossible as the slave thread uses it's own file
pointer to the file.
c) There is no code I know of that touches the binary log file except
the logging code.
d) I checked the code and can't see any way it could produce an error
in the middle of an insert;
Sasha, just for your information: This is MysQL 3.23.49.
Sasha, do you have any other ideas of where this could happen ?
Regards,
Monty
------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail bugs-thread12153@lists.mysql.com
To unsubscribe, e-mail