[MDEV-20583] innochecksum man pages seem to be inconsistent with the binary (10.2.25) Created: 2019-09-13  Updated: 2023-10-16  Resolved: 2023-10-13

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Storage Engine - InnoDB
Affects Version/s: 10.1.26, 10.2.8, 10.3.1, 10.4.0, 10.2.25, 10.5.0, 10.8.0, 10.6.0, 10.7.0, 10.9.0
Fix Version/s: 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3

Type: Bug Priority: Minor
Reporter: Simon Mudd Assignee: Ian Gilfillan
Resolution: Fixed Votes: 1
Labels: None
Environment:

$ rpm -qa | grep MariaDB
MariaDB-common-10.2.25-1.el7.centos.x86_64
MariaDB-client-10.2.25-1.el7.centos.x86_64
MariaDB-server-10.2.25-1.el7.centos.x86_64
MariaDB-backup-10.2.25-1.el7.centos.x86_64
MariaDB-compat-10.2.25-1.el7.centos.x86_64
$ rpm -qf /usr/bin/innochecksum
MariaDB-server-10.2.25-1.el7.centos.x86_64


Issue Links:
Duplicate
is duplicated by MDEV-31363 innochecksum man page options do not ... Closed
Problem/Incident
is caused by MDEV-11939 innochecksum mistakes a file for an e... Closed

 Description   

I want to check a table for possible corruption and find any bad pages.

This works but stops on the first page:

# innochecksum -v SomeTable.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)
per-page-details                  FALSE
log                               (No default value)
leaf                              FALSE
merge                             0
Fail: page::35896414 invalid
Exceeded the maximum allowed checksum mismatch count::1 current::0
#

It is not clear how to show all pages so I look at the man page.
This has different options compared to those listed above using -v

       ·   -?, --help
       ·   -c, --count
       ·   -d, --debug
       ·   -e num, --end-page=#
       ·   -i, --per-page-details
       ·   -I, --info
       ·   -l, --leaf
       ·   -m num, --merge=#
       ·   -p num, --page-num=#
       ·   -s num, --start-page
       ·   -u, --skip-corrupt
       ·   -v, --verbose
       ·   -V, --version

I tried this:

# innochecksum -c -u SomeTable.ibd
innochecksum: unknown option '-u'

So trying the following to scan for all bad pages, but not sure it will work.

# innochecksum  --verbose=TRUE  --allow-mismatches=1 SomeTable.ibd

Suggestion:

  • I have not checked against 10.4 or 10.3 binaries as this server has an older version. Is this fixed there?
  • at least for newer versions ensure that the man page and command line output is consistent
  • provide some examples of real life usage, or provide a url if the docs are online only.
  • I was looking for a way to:
    • check if the table might be corrupt (it seems to be)
    • find the affected pages and how many are affected by this
    • potentially find a way to copy out the data safely to a new system or new .ibd file with correct structure but with bad pages removed. (this clearly removes data and may lead to issues but MariaDB will not allow me to touch the table as it is.)

Context:

I saw the following error message:

2019-09-13  9:52:03 140376553817856 [Note] InnoDB: Uncompressed page, stored checksum in field1 0, calculated checksums for field1: crc32 0, innodb 171676754
1,  page type 17855 == INDEX.none 3735928559, stored checksum in field2 0, calculated checksums for field2: crc32 0, innodb 157941122, none 3735928559,  page
 LSN 148843 2136225981, low 4 bytes of LSN at page end 2136225981, page number (if stored to page already) 35896414, space id (if created with >= MySQL-4.1.1
 and stored already) 3379096
2019-09-13  9:52:03 140376553817856 [Note] InnoDB: Page may be an index page where index id is 3589980
2019-09-13  9:52:03 140376553817856 [Note] InnoDB: Index 3589980 is `PRIMARY` in table `some_db`.`SomeTable`
2019-09-13  9:52:03 140376553817856 [Note] InnoDB: It is also possible that your operating system has corrupted its own file cache and rebooting your compute
r removes the error. If the corrupt page is an index page. You can also try to fix the corruption by dumping, dropping, and reimporting the corrupt table. Yo
u can use CHECK TABLE to scan your table for corruption. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forci
ng recovery.
2019-09-13  9:52:03 140376553817856 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in
 a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mysqld server crashes after the startup or when you dump t
he tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
2019-09-13  9:52:03 140376553817856 [ERROR] Slave SQL: Error 'Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB' on query. Defau
lt database: 'some_db'. Query: <removed>, Gtid 0-188055117-23162684442, Internal MariaDB error code: 1030



 Comments   
Comment by Julien Fritsch [ 2021-09-22 ]

jacob.moorman from our discussion, I decided to reassign Kenneth's ticket to you?

Comment by Marko Mäkelä [ 2022-05-24 ]

I think that the option name is --allow-mismatches or -a. The option -u had been removed in MDEV-11939 but the manual page was not updated accordingly.

Generated at Thu Feb 08 09:00:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.