> Thanks for the detailed response. Just one question, if writer doesn't
> fail, but bookie write fails (Say a soft failure because of network problem
> or GC pause), the writer will create a new fragment within a ledger. So the
> same sequence of operations that happen while closing the ledger needs to
> happen at fragment level as well. Because the log entry can be copied to
> new fragment, the log from failed bookie (or more of soft-failed bookie
> because of network issue or GC pause) in previous fragment needs to be
> truncated.

In the case of a bookie failing during write, there's no need for the
recovery part of the process. The writer already knows which entry was
the last entry acknowledged before the failure. The write to update
the ensemble, i.e. create the new fragment, is similar as the write to
close the ledger. it fixes the last entry of the previous segment.

In terms of truncating, closing a fragment is not the same as closing
a ledger. Take the following scenario.

Writer w1
Bookie b1, b2

b1: e1, <crash>
b2: e1, e2

w1 is writing to a ledger, and b1 crashes before e2 is acknowledged.
w1 detects the crash and changes the ensemble to b3,b2, and then
promptly crashes. Recovery at this point may then recover the end of
the ledger as e2, even though the end of the fragment was e1. This is
fine, but it demonstrates how in a ensemble change truncation does not
occur.

-Ivan

Reply via email to