Bug #75595 Compute InnoDB redo log block checksums faster
Submitted: 23 Jan 2015 9:18 Modified: 3 Aug 2015 16:00
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[23 Jan 2015 9:18] Laurynas Biveinis
Description:
If a lot of redo log is being written and other bottlenecks are taken care of, the overhead of calculating redo log block checksums will be noticeable.

How to repeat:
.

Suggested fix:
Add an option for a more efficient algorithm, just like 5.6 did for data pages. Uploading a patch.
[23 Jan 2015 9:22] Laurynas Biveinis
Bug 75595 patch for 5.7.5

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: bug75595.patch (application/octet-stream, text), 15.42 KiB.

[23 Jan 2015 9:23] Laurynas Biveinis
Patch author Alexey Stroganov.
[26 Jan 2015 7:56] Alexey Kopytov
The version of the patch being submitted has been developed by me, not Alexey Stroganov.
[30 Jan 2015 15:34] Laurynas Biveinis
For stable testsuite results, the contributed patch (or any other patch that adds a new server variable) should be applied together with one for bug 75699.
[12 Feb 2015 17:36] Sinisa Milivojevic
I have checked thoroughly and came to conclusion that both Laurynas and Alexey are completely right when it comes to improving the performance of redo log block checksums.

A patch is also included.

Fully verified.
[24 Feb 2015 8:00] Marko Mäkelä
Posted by developer:
 
If we implement this, I think that we should repurpose one of the unused bytes in the redo log header to indicate the checksum algorithm(s) that may be used for individual red log blocks. In this way, InnoDB and backup tools would be able to refuse to start up if the format is not supported.

Luckily, already MySQL 3.23.53 initialized the full log header block to 0, in log_init() and log_group_init(). When it comes to repurposing unused bytes in InnoDB data files, we have the problem that old versions of InnoDB wrote uninitialized garbage to unused bytes in data files.
[9 Apr 2015 18:41] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.6.25, 5.7.8, 5.8.0 releases, and here's the changelog entry:

The new "innodb_log_checksum_algorithm" option specifies how to generate
and verify the checksum stored in each redo log disk block.
"innodb_log_checksum_algorithm" supports same algorithms as
"innodb_checksum_algorithm", which include "innodb", "crc32", "none", and
the associated strict form of each algorithm. Previously, only the
"innodb" algorithm was supported for redo log disk blocks.
"innodb_log_checksum_algorithm=innodb" is the default setting. Thanks to
Laurynas Biveinis for the patch.
[9 Apr 2015 18:43] Laurynas Biveinis
The credit for the patch goes to Alexey Kopytov, not me.
[3 Aug 2015 16:00] Laurynas Biveinis
5.7.8 is out and I am incorrectly credited for this patch in RNs, filed bug 77919.
[7 Aug 2015 14:56] Daniel Price
Posted by developer:
 
Apologies for the error, Alexey. The accreditation has been corrected. The change should appear online within 24 hours.