> For the complete documentation index, see [llms.txt](https://dianadarie.gitbook.io/system-design-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dianadarie.gitbook.io/system-design-notes/system-design-patterns/split-brain-with-fencing.md).

# Split Brain with Fencing

### Motivation

In the case of zombie leader where the leader is considered dead and the system elects a new leader, we need to make sure the old leader is not running and possibly issuing conflicting commands.&#x20;

### Solution

Put a fence around a previously active leader so that it cannot access cluster resources and hence stop serving any read/write request:

* **resource fencing -** the system blocks the previously active leader from accessing resources needed to perform essential tasks.
* **node fencing** - the system stops the previously active leader from accessing all resources.

### Applications

**HDFS** uses fencing to stop the previously active NameNode from accessing cluster resources, thereby stopping it from servicing requests.
