[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-bugs
Subject:    Re: Replication race bug in sequential file cache (mf_iocache.cc)
From:       Michael Widenius <monty () mysql ! com>
Date:       2002-06-29 7:38:12
[Download RAW message or body]


Hi!

>>>>> "Nils" == Nils Ulltveit-Moe <num@proseq.no> writes:

<cut>

Nils> I checked using csplit, and the problem occured at
Nils> approximately 1/3 of the log file, so the problem does not seem to
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 excerpt
Nils> from the log below shows:

Nils> 	INSERT INTO signature (sid, sig_id, sig_name,sig_rev,sig_sid)
Nils> VALUES (1,767, 'spp_portscan: End of portscan 
Nils>  "=À)ÍŠsnortINSERT INTO event (sid,cid,signatu;

<cut>

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 thread
   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 <bugs-unsubscribe@lists.mysql.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic