Expand description
CRC16 for slot placement and CRC32C for integrity.
Two different polynomials for two different jobs. CRC16 is Redis’s XMODEM
variant and it exists here because slot = crc16(key) & 0x3FFF is how a key
reaches a shard (04 section 1). Getting it wrong does not corrupt anything,
it just makes us incompatible with every Redis cluster client, so the hash
tag rules are implemented here too.
CRC32C is Castagnoli, the same polynomial SSE4.2 and the ARM CRC extension
implement in hardware, and it is what guards pages and superblocks (07).
Constants§
- SLOT_
COUNT - The number of slots, which is Redis’s 16384 and is not configurable.