Database Reference
In-Depth Information
dication of the weaker or stronger possibility of failure based on interpretation (the sampling of
heartbeats), as opposed to a simple binary assessment.
NOTE
You can read the original Phi Accrual Failure Detection paper by Naohiro Hayashibara et al. at ht-
tp://ddg.jaist.ac.jp/pub/HDY+04.pdf .
Failure detection is implemented in Cassandra by the org.apache.cassandra.gms.Fail-
ureDetector class, which implements the org.apache.cassandra.gms.IFailureDetector
interface. Together, they allow the following operations:
isAlive(InetAddress)
isAlive(InetAddress)
What the detector will report about a given node's alive-ness.
interpret(InetAddress)
interpret(InetAddress)
Used by the gossiper to help it decide whether a node is alive or not based on suspicion level
reached by calculating Phi (as described in the Hayashibara paper).
report(InetAddress)
report(InetAddress)
When a node receives a heartbeat, it invokes this method.
Anti-Entropy and Read Repair
Where you find gossip protocols, you will often find their counterpart, anti-entropy, which is also
based on an epidemic theory of computing. Anti-entropyis the replica synchronization mechan-
ism in Cassandra for ensuring that data on different nodes is updated to the newest version.
Here's how it works. During a major compaction, the server initiates a TreeRequest/TreeReponse
conversation to exchange Merkle trees with neighboring nodes. The Merkle tree is a hash rep-
resenting the data in that column family. If the trees from the different nodes don't match,
they have to be reconciled (or “repaired”) in order to determine the latest data values they
should all be set to. This tree comparison validation is the responsibility of the
org.apache.cassandra.service.AntiEntropyService class. AntiEntropyService im-
plements the Singleton pattern and defines the static Differencer class as well, which is used to
compare two trees; if it finds any differences, it launches a repair for the ranges that don't agree.
Anti-entropy is used in Amazon's Dynamo, and Cassandra's implementation is modeled on that
(see Section 4.7 of the Dynamo paper).
Search WWH ::




Custom Search