mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-31 12:06:44 +00:00
Sstables have two kind of checksums: per-chunk checksums and full-checksum (digest) calculated over the entire content of Data.db. The full-checksum (digest) is stored in Digest.crc (component_type::Digest). When compression is used, the per-chunk checksum is stored directly inside Data.db, after each compressed chunk. These are validated on read, when decompressing the respective chunks. When no compression is used, the per-chunk checksum is stored separately in CRC.db (component_type::CRC). Chunk size is defined and stored in said component as well. In both compressed and uncompressed sstables, checksums are calculated on the data that is actually written to disk, so in case of compressed data, on the compressed data. This method validates both the full checksum and the per-chunk checksum for the entire Data.db.