Skip to main content

pick

Function pick 

Source
pub fn pick(a: &[u8], b: &[u8]) -> Result<(usize, Superblock)>
Expand description

Picks the live slot out of the two.

Returns the slot index, 0 or 1, and its decoded header. Higher seq wins, and a slot that fails to decode does not get a vote. Both failing is the one case that is not recoverable here, and the two errors are returned so that yodb check can print them both instead of guessing which one the user cares about.

ยงErrors

Returns the slot A error if neither slot decodes. The slot B error is in the detail field.