Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

hcoona/PhiFailureDetector

Repository files navigation

Phi Failure Detector

Getting started

The interval time unit is 100-nanosecond because it use ToFileTimeUtc generate timestamps. I’ll introduce a Clock abstraction to eliminate this limitation in the future.

We use a very large initial interval since the "right" average depends on the cluster size and it’s better to err high (false negatives, which will be corrected by waiting a bit longer) than low (false positives, which cause "flapping").

Choose $\varphi$ function according to your detecting model, use $\exp$ function for heartbeat, use normal (Gaussian) function for random gossip.

var failureDetector = new PhiFailureDetector(
    capacity: 100, // Store at most 100 heartbeat points
    initialHeartbeatInterval: 2000,
    phiFunc: PhiFailureDetector.Exponential
);

communicationService[peerId].onHeartBeat += (ignored1, ignored2) {
    failureDetector.Report();
};
communicationService.watch(peerId, () => failureDetector.Phi() > threshold);

Architecture overview

3 components:

  1. Monitoring

  2. Interpretation

  3. Action

Monitoring

Arrival window. Usually used with a throttler.

Interpretation

The phi function should be made up according to the heartbeat distribution.

See CASSANDRA-2597 for more details.

Future

  1. Introduce a Clock abstraction for timestamps generation. This would decouple the dependency to time interval accuracy.

About

A C# implementation to Phi accrual failure detector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages