Bug #34712 maria_read_log changes log file content on several platforms though not needed
Submitted: 21 Feb 2008 1:34 Modified: 9 Mar 2008 19:35
Reporter: Michael Widenius Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Maria storage engine Severity:S2 (Serious)
Version:5.1.24-maria-alpha OS:Any
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[21 Feb 2008 1:34] Michael Widenius
Description:
ma_test_recover.pl fails on Solaris because maria_read_log -a -s causes the log file to change even when it shouldn't.

This bug is probably also the cause that ma_test1.MAI file content differ as after the test the create_rename_lsn is different for the new file.

How to repeat:
Run the following on a Solaris 64 bit machine:

rm -f maria_log*
ma_test1 -s -M -T -c -N  -H2 --testflag=3 --test-undo=1
maria_read_log -a -s
cp maria_log.* tmp
maria_read_log -a -s --#d:t:o,trace

After this maria_log.00000001 in current dir and tmp are different,
which shouldn't happen as the first maria_read_log -a -s applied all
pending CLR's and there shouldn't have been any log records written on
the second run.

I tried the above on Linux and did notice in the trace file that the log
handler does write things to the log file with pwrite().  This is
probably a performance bug as there is no reason for these calls. What
is strange that on Linux the log file content doesn't change but it
does change on Solaris.

Suggested fix:
There should be no calls to pwrite() for the log in the second maria_read_log execution
[27 Feb 2008 21:13] Guilhem Bichot
got it in one of my Linux trees (release build) but not all.
[5 Mar 2008 21:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43490

ChangeSet@1.2613, 2008-03-05 23:22:09+02:00, bell@desktop.sanja.is.com.ua +1 -0
  Avoiding changing log on flush call
  if nothing was added to the log (BUG#34712)
[6 Mar 2008 6:32] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43499

ChangeSet@1.2613, 2008-03-06 08:31:35+02:00, bell@desktop.sanja.is.com.ua +1 -0
  Avoiding changing log on flush call
  if nothing was added to the log (BUG#34712)
[7 Mar 2008 8:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43563

ChangeSet@1.2613, 2008-03-07 10:02:30+02:00, bell@desktop.sanja.is.com.ua +1 -0
  Avoiding changing log on flush call
  if nothing was added to the log
  (BUG#34712 maria_read_log changes log
  file content on several platforms though not needed)
[7 Mar 2008 19:01] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/43614

ChangeSet@1.2613, 2008-03-07 21:00:00+02:00, bell@desktop.sanja.is.com.ua +1 -0
  Avoiding changing log on flush call
  if nothing was added to the log
  (BUG#34712 maria_read_log changes log
  file content on several platforms though not needed)
  Fixed callback call (now under loghandler lock).