Skip to content

Commit

Permalink
Implement WL#5652 InnoDB: Use HW CRC32
Browse files Browse the repository at this point in the history
+ Introduce a new option innodb_checksum_algorithm that may have the
following values:

* crc32
Write CRC32 to both checksum fields (calculated using CPU instructions
if supported).
When reading allow any of the valid checksums to match (flexible
allowing old files to be read, but increases the possibility for
announcing a corrupted page to be valid). Still if one of the two fields
contains CRC32, the other one must contain CRC32 too.

* strict_crc32
Write CRC32 to both checksum fields
When reading allow only CRC32 to match (will announce old files as
corrupted, but minimizes the possibility to announce a corrupted page
as valid).

* innodb
Write InnoDB calculated (custom algorithm) checksum to both checksum
fields (different algo is used for each field).
When reading allow any of the valid checksums to match.

* strict_innodb
Write InnoDB calculated (custom algorithm) checksum to both checksum
fields (different algo is used for each field).
When reading allow only InnoDB algorithm to match.

* none
Write a constant magic number to both fields
When reading do not do any checks on the checksum fields
(same as setting innodb_checksums=OFF)

* strict_none
Write a constant magic number to both fields
When reading allow only the constant magic number to match.

+ Deprecate innodb_checksums (use innodb_checksum_algorithm=NONE instead)

+ Remove copy-pasted InnoDB source from extra/innochecksum.c and link
the innochecksum executable with libinnobase.a

+ For the above to work extract the functions innochecksum needs in a
dedicated files

+ Add the Facebook contributed CRC32 implementation into ut0crc32.c
  • Loading branch information
vasild committed Aug 22, 2011
1 parent 615ecca commit 17e497b
Show file tree
Hide file tree
Showing 19 changed files with 1,830 additions and 340 deletions.
11 changes: 10 additions & 1 deletion extra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ ENDIF()
MYSQL_ADD_EXECUTABLE(replace replace.c)
TARGET_LINK_LIBRARIES(replace mysys)
IF(UNIX)
MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.c)
IF(WITH_INNOBASE_STORAGE_ENGINE)
# Add path to the InnoDB headers
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include)
MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.c)
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
ADD_DEFINITIONS("-DINNOCHECKSUM_SOLARIS")
ELSE()
TARGET_LINK_LIBRARIES(innochecksum innobase)
ENDIF()
ENDIF()

MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c)
TARGET_LINK_LIBRARIES(resolve_stack_dump mysys)
Expand Down

0 comments on commit 17e497b

Please sign in to comment.