---
title: "What Happens When a Master or Replica Fails"
url: https://daily.dev/posts/what-happens-when-a-master-or-replica-fails-pr5io7c7j
source_url: https://arpitbhayani.me/blogs/handling-outages-master-replica
type: article
source: "Arpit Bhayani"
published: 2026-05-31T07:54:38.824Z
updated: 2026-05-31T09:20:47.753Z
tags: ["distributed-systems"]
reading_time: 7
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What Happens When a Master or Replica Fails

**[Arpit Bhayani](https://daily.dev/sources/arpit-bhayani)** · 7 min read · 0 upvotes · 0 comments

## Summary

Master-Replica architecture is a foundational pattern in distributed systems. When a replica fails, it reconnects to the master and resumes replication from the last persisted sequence number. When the master fails, recovery involves three steps: detecting the crash (via heartbeat or failure detectors like Phi Accrual), setting up a new master (manually or via automated leader election among replicas), and announcing the new master to clients. A key challenge is data loss if the master crashes before propagating writes to replicas. The recommended solution is a synchronously replicated passive standby node that stays in sync with the master, enabling safe promotion without data loss or split-brain issues.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://arpitbhayani.me/blogs/handling-outages-master-replica>

## Similar posts on daily.dev

- [What happens when a Primary fails in a MongoDB replica set?](https://daily.dev/posts/what-happens-when-a-primary-fails-in-a-mongodb-replica-set--a6ghnvqxt) · Foojay.io · 1 upvotes · 0 comments
- [When failover isn’t safe: Building high-availability PostgreSQL on Kubernetes](https://daily.dev/posts/when-failover-isn-t-safe-building-high-availability-postgresql-on-kubernetes-nljmhojvb) · Datadog · 4 upvotes · 1 comments

---

Tags: [#distributed-systems](https://daily.dev/tags/distributed-systems)

[View this post on daily.dev](https://daily.dev/posts/what-happens-when-a-master-or-replica-fails-pr5io7c7j)
