innochecksum5.7.5 gets crc32 checksum 0 and passes test

Bug #1427048 reported by Peiran Song
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Incomplete
Undecided
Unassigned

Bug Description

In one customer case, #50574, it showed that, in the case that stored page checksum is 0, the calculated crc32 checksum could also get 0, and innochecksum5.7.5 would then pass the check.

The .ibd is compressed with page size = 8192 bytes

Server version 5.6.21. Checksum algorithm is innodb.

mysql> show global variables like 'innodb_checksum_algorithm';
+---------------------------+--------+
| Variable_name | Value |
+---------------------------+--------+
| innodb_checksum_algorithm | innodb |

x. ran against the whole .ibd file, showed no error

$ time /tmp/innochecksum-5.7.5 -v ./DatastoreV152/ScData.ibd

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose TRUE
count FALSE
start-page 0
end-page 0
page 0
strict-check crc32
no-check FALSE
allow-mismatches 0
write crc32
page-type-summary FALSE
page-type-dump (No default value)
log (No default value)

real 2m27.199s
user 1m8.654s
sys 0m28.290s

x. ran against one page with debug, it showed stored page checksum 0, the calculated crc32 checksum is 0

$ /tmp/innochecksum-5.7.5 --log /tmp/ScData_1672213.log -p 1672213 ./DatastoreV152/ScData.ibd
$ cat /tmp/ScData_1672213.log InnoDB File Checksum Utility.
Filename = ./DatastoreV152/ScData.ibd
Innochecksum: checking pages in range 1672213 to 1672213 page::1672213; innodb checksum: calculated = 2975031374; recorded = 0
page::1672213: crc32 checksum: calculated = 0; recorded = 0
page::1672213: none checksum: calculated = 3735928559; recorded = 0

Tags: i50574
tags: added: i50574
description: updated
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Peiran Song (peiran-song) wrote :

Laurynas,

Thanks for pointing out this bug. I wasn't aware that 0 is a valid page checksum. Nevertheless, in this case, the server checksum algorithm is innodb, and the calculated innodb checksum is 2975031374, which was different from stored value 0. However, the checksum passed. It looked like that it used crc32 checksum to compare with the stored value, but crc32 was not the checksum used to get the stored value. The question remains on whether the right checksum algorithm was used.

Thanks,
Peiran

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

I still wonder why this is considered a Percona Server bug? Had you used innochecksum from PS 5.7 (built from source I assume)? If it's from upstream MySQL, then the bug should be reported upstream.

Changed in percona-server:
status: New → Incomplete
Revision history for this message
Peiran Song (peiran-song) wrote :

I am checking with the customer whether the tool is from Percona package or not.

This is a GOLD customer. I think they are entitled for bug fixes, which is why I filed the bug here.

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

You use default option "strict-check crc32", therefore this checksum used for the test (see output of innochecksum -v) This is not a bug in my opinion.

Please try to run innochecksum --strict-check=innodb and inform us if it works correctly.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3269

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.