<!-- llms-explorer concept facts · https://llms-explorer.com/tree/historical-wiredtiger-raw-compression-block-sizing-callback/ · pack 2026-11-02 · ~1479 tokens -->

# Historical WiredTiger raw-compression block-sizing callback

> Source-anchored research for Historical WiredTiger raw-compression block-sizing callback. Run status: COMPLETED.

Parent: [Block Compression (snappy/zlib/zstd)](https://llms-explorer.com/tree/block-compression-snappy-zlib-zstd/) · 3 facets · 10 facts · page: https://llms-explorer.com/tree/historical-wiredtiger-raw-compression-block-sizing-callback/

## How it works

- The 2.1 upgrade notes distinguish retry from fallback: compress_raw is retried only when it returns EAGAIN. Returning zero with result_slots equal to zero means raw compression failed and WiredTiger falls back to WT_COMPRESSOR::compress. The 2.3.1 callback reference calls the output parameter result_slotsp and says EAGAIN requests more rows before another attempt. (medium confidence) — [source](https://source.wiredtiger.com/2.1.2/upgrading.html) · [also](https://source.wiredtiger.com/2.3.1/struct_w_t___c_o_m_p_r_e_s_s_o_r.html)
- For historical final calls, final is zero while additional rows remain and nonzero when none remain to accumulate. With final set, successful partial encoding leads to further callbacks until all rows are encoded or an attempt encodes no rows. If no rows can be encoded, WiredTiger stops calling compress_raw; remaining rows use WT_COMPRESSOR::compress. (high confidence) — [source](https://source.wiredtiger.com/2.3.1/struct_w_t___c_o_m_p_r_e_s_s_o_r.html) · [also](https://source.wiredtiger.com/2.1.2/struct_w_t___c_o_m_p_r_e_s_s_o_r.html)
- In the historical interface, compress_raw applies to row-store and variable-length column-store objects only when the relevant prefix and dictionary compression are not configured. Overflow key/value items and work declined by compress_raw use compress. Setting compress_raw to NULL leaves WiredTiger to split pages into blocks and invoke compress on each block. (medium confidence) — [source](https://source.wiredtiger.com/2.3.1/struct_w_t___c_o_m_p_r_e_s_s_o_r.html) · [also](https://source.wiredtiger.com/2.1.2/struct_w_t___c_o_m_p_r_e_s_s_o_r.html)

## Measurements and reference values

- In those versions, `page_max` provides the configured `internal_page_max` or `leaf_page_max`, and `split_pct` provides the configured Btree split setting. The `dst` parameter points to the destination buffer. The callback must account for `extra`, the bytes added before writing: for the documented 8KB target, encoded output should be at most `8KB - extra`. It uses `extra` to budget output length, without skipping that space in the destination buffer. (high confidence) — [source](https://source.wiredtiger.com/2.3.1/struct_w_t___c_o_m_p_r_e_s_s_o_r.html) · [also](https://source.wiredtiger.com/2.1.2/struct_w_t___c_o_m_p_r_e_s_s_o_r.html)

## Facts and statements

- In WiredTiger 2.1.2 and 2.3.1, WT_COMPRESSOR::compress_raw chooses block boundaries by encoding none, some, or all supplied byte strings into a destination buffer; WiredTiger prepends header information and writes that encoded representation as a block. (medium confidence) — [source](https://source.wiredtiger.com/2.3.1/struct_w_t___c_o_m_p_r_e_s_s_o_r.html) · [also](https://source.wiredtiger.com/2.1.2/struct_w_t___c_o_m_p_r_e_s_s_o_r.html)
- The historical offsets array identifies byte-string boundaries in src. offsets[0] is 0; offsets[slots] is the first byte beyond the last string and therefore the total source length. The sentinel identifies an end boundary, not another string to encode. (medium confidence) — [source](https://source.wiredtiger.com/2.3.1/struct_w_t___c_o_m_p_r_e_s_s_o_r.html) · [also](https://source.wiredtiger.com/2.1.2/struct_w_t___c_o_m_p_r_e_s_s_o_r.html)
- On success, the historical callback returns 0, sets result_slotsp to the number of byte strings encoded, and sets result_lenp to the encoded byte count. It need not consume every supplied string. (medium confidence) — [source](https://source.wiredtiger.com/2.3.1/struct_w_t___c_o_m_p_r_e_s_s_o_r.html) · [also](https://source.wiredtiger.com/2.1.2/struct_w_t___c_o_m_p_r_e_s_s_o_r.html)
- The historical issue header identifies WT-4192 as 'Remove WiredTiger raw compression support'. Its Description attributes the removal proposal to absence of customer use, incompatibility with the lookaside table as of its cited 3.6 release, and complex, brittle code. The issue also says raw compression could target fixed I/O sizes. These are the issue author's historical rationale, not measurements or an assertion about current customers. (low confidence) — [source](https://jira.mongodb.org/browse/WT-4192)
- The historical sources carry different removal labels. The WiredTiger 3.2.1 upgrade page attributes raw-compression removal to release 3.2.1, while the 3.2.0 upgrade page attributes it to release 3.2.0. Both snapshots instruct custom-compressor applications to remove initialization of WT_COMPRESSOR::compress_raw and say existing lz4 and zlib configurations continue to work, though compression ratios may change. WT-4192 lists fix-version labels 4.1.7, 4.0.6 and a WiredTiger 3.2.0 label. Preserve these attributed positions without choosing a single first-removal boundary for downstream products. This historical callback contract does not establish modern MongoDB compressor-extension availability; that requires evidence for the target product and release. (medium confidence) — [source](https://source.wiredtiger.com/3.2.1/upgrading.html) · [also](https://jira.mongodb.org/browse/WT-4192) · [also](https://source.wiredtiger.com/3.2.0/upgrading.html)
- The rendered wiredtiger-sys 0.1.0 Rust binding includes a compress_raw field with page_max, split_pct, extra, offsets, slots, and result_slotsp parameters. This is evidence about that binding snapshot, not proof that a current MongoDB server exposes the historical callback. (low confidence) — [source](https://docs.rs/wiredtiger-sys/latest/wiredtiger_sys/struct.__wt_compressor.html)
