An explanation of DRBD Protocol C

2.6k views Asked by At

What protocol does DRBD employ to guarantee that it can maintain 2 disks in sync with each other?

Does it use 2-phase commits (or a variant similar to 2PC)?

Does DRBD have an asynchronous/offline reconciler that is constantly checking to see if the disks have deviated?

1

There are 1 answers

2
Matt Kereczman On BEST ANSWER

By default, DRBD will use protocol C (fully synchronous) replication. It uses it's own internal protocols when replicating writes to it's peer, and typically is used in an Active/Passive manner.

DRBD keeps a bitmap in memory to keep track of what has been replicated and what's still "in flight". If DRBD were to become disconnected from it's peer, those bitmaps get pushed down to disk (into DRBD's metadata). When the peers reconnect, they exchange bitmaps and generation identifiers to determine which direction and which blocks to sync.

enter image description here

That image shows where DRBD sits in the Linux Kernel's Storage Stack. Hope that helps!