Skip to main content

Module layer

Module layer 

Source
Expand description

Layers: the net effect of applying operations in order.

A Layer is a map of live documents plus a set of tombstones, the ids that this layer deletes. Queries build one from segments and the WAL tail, and compaction builds one to freeze into a segment. Both go through the same code, so they cannot disagree about what an upsert or a delete means.

The two halves never overlap: an id is either a live document or a tombstone. A tombstone matters only when something older might hold the id, so a layer that starts at the very beginning of the log drops them (see Layer::drop_tombstones).

Structsยง

Layer
Live documents and tombstones produced by applying operations in order.