This message was deleted.
# general
s
This message was deleted.
d
The short answer is that it depends on your ack quorum setting. If you have it set 2, and your write quorum to the 3, then the two remaining open ledgers will continue to receive the messages and send back 2 acks to mark the message as received. Once the segment rolls over, 3 new bookies will be selected and 3 new ledgers will be opened.
If you have an ack quorum of 3 then the writes will fail due to a lack of write acks back to the broker. This will trigger the immediate closure of the open segment, and the automatic creation of a new segment across 3 random bookies.
For the scenario where you only have 2 acks, and thus only two copies of the segment, BookKeeper has a background process that identifies under-replicated segments and automatically creates a sufficient number of new copies to meet your stated write quorum number, e.g. self-healing.
s
Many thanks! I think I got it 🙂 What is the difference between a segment & a ledger?
d
They are basically the same. In Pulsar we call them segments, because they are just one piece of the topic (like a segment in a flight), in BookKeeper we use the term ledger because we are using them to record entries (like transactions in a checkbook ledger, etc). From a physical storage perspective they are the same, but segments have the concept of “belonging” to a topic and in a specific sequence, whereas ledgers are randomly placed append only storage in BK.
s
How about this scenario: 1. a bookie node fails 2. new messages are stored on the other bookies 3. this failing bookie becomes available again in the cluster. So it contains stale data. Then what happens?
d
Apache BookKeeper stores some additional metadata with each ledger to help it perform the self-healing process. One of those pieces of metadata is the md5 checksum value that is calculated from the ledger’s contents. The two copies of the ledgers on the non-crashing bookies would have a different value than the “stale” ledger on the crashed bookie because their contents are different. Therefore, this “stale” ledger would be marked as corrupt, ignored, and marked for garbage collection.
🙌 1
b
Along with super valuable info shared by David. This [doc](https://pulsar.apache.org/docs/2.10.x/concepts-architecture-overview/#apache-bookkeeper) gives a brief info on the bookkeeper architecture and it's internal components.
👏 1
s
That's super-clear, thank you very much for your answers!
🙌 1