Bug #21558 Manual clarification (relay-log.info does not appear to be consistent)
Submitted: 10 Aug 2006 5:50 Modified: 16 Aug 2006 12:42
Reporter: Morgan Tocker Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version: OS:
Assigned to: MC Brown CPU Architecture:Any

[10 Aug 2006 5:50] Morgan Tocker
Description:
Citing this example specifically, there may be more:

http://dev.mysql.com/doc/refman/5.0/en/slave-logs.html

" The SQL thread updates the relay-log.info  file. The following table shows the correspondence between the lines in the file and the columns displayed by SHOW SLAVE STATUS. "

From what I can tell, the relay-log.info is not guaranteed to be consistent (in that it either flushes to disk with the operating system buffer, or is only written to disk by the thread at a given interval).  This means that a user can only safely grep through the relay-log.info in an *offline* system.  The only accurate way to get this information in an online system seems to be SHOW SLAVE STATUS.

How to repeat:
Try grep'ing the relay-log.info.

Suggested fix:
Adjust the docs to warn of the potential inconsistency.
[10 Aug 2006 11:20] MySQL Verification Team
Thank you for the bug report,.
[16 Aug 2006 12:42] MC Brown
I've added the following to the manual to highlight the potential inconsistency: 

The contents of the <filename>relay-log.info</filename> file and
the states shown by the <literal>SHOW SLAVE STATES</literal>
command may not match if the <filename>relay-log.info</filename>
file has not been flushed to disk. Ideally, you should only view
<filename>relay-log.info</filename> on a slave that is offline
(i.e. <literal>mysqld</literal> is not running). For a running
system, <literal>SHOW SLAVE STATUS</literal> should be used.