Bug #76207 REDO log execution problem
Submitted: 7 Mar 2015 10:09 Modified: 27 Mar 2015 13:40
Reporter: Mikael Ronström Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.4.5 OS:Any
Assigned to: CPU Architecture:Any

[7 Mar 2015 10:09] Mikael Ronström
Description:
When performing a restart one finds the end of the REDO log by looking at
the log lap which is written on each log page.

Since log pages beyond the last GCI can be written or not a bit randomly one
can have cases where log pages at the end are not written consecutively.
This complicates the finding of the end of the log. It means that one can find
a log end which actually comes from a previous restart that should have been
invalidated

How to repeat:
Run autotest, particularly test cases with testSystemRestart -n SR_DD* on disk data
tables.

Suggested fix:
Ensure that when searching for last page to invalidate that we use the same search
algorithm to find the last page to invalidate as we do when searching for the last
log page to read.

Searching for the last log page starts from the log file written in log file 0 and
page 0. Then it reads every Mbyte forward. It skips all pages between the first page
of the Mbyte. So the search for last page to invalidate should always read on until
it read a complete Mbyte and particularly the first page in the next Mbyte. So only
when it finds a non-written log page in the first page of a Mbyte can we stop the search.

There can still be written pages after that, but we will never find them when looking
for the log end, so they are safe to be there.
[27 Mar 2015 13:40] Jon Stephens
Documented fix as follows in the NDB 7.2.0, 7.3.9, and 7.4.5 changelogs:

    When performing a restart, it was sometimes possible to find a
    log end marker which had been written by a previous restart, and
    that should have been invalidated. Now when when searching for
    the last page to invalidate, the same search algorithm is used
    as when searching for the last page of the log to read.
      
Closed.