Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11899

Define API to calculate crc32c with a given seed value

    • Storage Engines
    • 8
    • 2023-11-28 - Anthill Tiger

      In SERVER-77705 we want to update hash functions, used as a checksum for files, created by sorter during $sort or index builds.
      mathias@mongodb.com suggested to use WiredTiger’s crc32c implementation.

      There is a public wiredtiger_crc32c_func()(buf, len) function.

      However, in sorter, we currently hash things piece-wise:
      https://github.com/mongodb/mongo/blob/7683c537daa6be9b17713a0d7b2ffcb701f80f15/src/mongo/db/sorter/sorter.cpp#L108

      We need to preserve this interface for backward-compatibility.

      Internally some crc32c implementation already have an interface that accept initial value: https://github.com/mongodb/mongo/blob/7683c537daa6be9b17713a0d7b2ffcb701f80f15/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c#L37

      Could you please make this a public API via something like wiredtiger_crc32c_with_seed_func()(seed, buf, len).

            Assignee:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Reporter:
            ivan.fefer@mongodb.com Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: