Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19935

Create unified CRC-32 interface

    XMLWordPrintable

Details

    Description

      The MariaDB code base contains quite a few implementations of CRC-32, some (or all?) of them using the CRC-32C polynomial. It would be good to create a uniform interface and remove any code duplication.

      • There is a crc32() function defined somewhere. Is it always the same, or does the bundled zlib use something else?
      • Mariabackup defines crc32_intel_pclmul(), which is enabled on AMD64 based on CPUID flags.
      • InnoDB defines its own things in ut_crc32_init(), most recently an interface to ARMv8 (AArch64, ARM64) crc32c_aarch64(). Apparently this function is not being used anywhere else.
      • MDEV-9872 introduced POWER crc32_vpmsum() that was later (in MariaDB Server 10.3) replaced with a C-based implementation.
      • A recent update of MyRocks introduced a duplicated implementation of crc32_vpmsum(), noticed by me due to build breakage (MDEV-19830).

      At the very least, we should have a common CRC-32C implementation on all platforms and remove ut0crc32.cc from InnoDB code base. (Maybe it is not worth touching the code in the bundled zlib.)

      If other CRC-32 polynomials are needed, then we should define a common interface for those as well.

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.