pub struct InsertAcquired {
pub disk_block_ids: Vec<u32>,
pub blocks: Vec<u32>,
pub released_blocks: Vec<u32>,
}Expand description
What an insert newly took ownership of, so the caller can take the
matching references.
Ownership rule: the cache holds exactly ONE reference on the physical block
stored in each radix node, taken when that node is CREATED and returned when
the node is evicted (return_evicted_block). The reference therefore has to
follow the block the NODE holds — not the block the inserting sequence had at
that position. Those two diverge whenever a node already exists for a token
chunk: insert keeps the node’s original block_idx, while the sequence has
a different block there (it did not get that block from the cache — e.g. it
never matched, or it was restored from a swap file). Referencing the
sequence’s block instead left the node’s block with no reference at all, so
evicting that node decremented a ref belonging to a LIVE sequence: the block
went back on the free list while still in use and was handed out again, with
the second owner’s teardown underflowing. Reporting the blocks here keeps
node lifetime and reference lifetime identical by construction.
Fields§
§disk_block_ids: Vec<u32>Disk-block IDs the cache newly references (caller inc_disk_refs each).
blocks: Vec<u32>Physical KV blocks stored in radix nodes CREATED by this insert; the
caller inc_refs each exactly once.
released_blocks: Vec<u32>Physical KV blocks this insert stopped storing — a partial_suffix slot
that was overwritten or dropped. The caller dec_refs each exactly once,
releasing the reference taken when that slot was first filled.
Trait Implementations§
Source§impl Clone for InsertAcquired
impl Clone for InsertAcquired
Source§fn clone(&self) -> InsertAcquired
fn clone(&self) -> InsertAcquired
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more