---
title: "Data Loss: a sad tale with a happy ending"
description: "Replit silently lost or corrupted user repl data for months."
url: "https://swe.quest/articles/data-loss-a-sad-tale-with-a-happy-ending-94994cb503d66c03"
canonical: "https://replit.com/blog/data-loss"
source: "Replit"
published: "2021-09-10"
difficulty: "medium"
kind: "Incident"
reading_minutes: 4
tags: ["incident-response","storage-systems","go","debugging","linux"]
---

# Data Loss: a sad tale with a happy ending

A post on [Replit](https://swe.quest/sources/replit.md), published 2021-09-10, 4 min read, Incident. Original: [https://replit.com/blog/data-loss](https://replit.com/blog/data-loss)

## Summary

Replit silently lost or corrupted user repl data for months. The root cause was a combination of three things: Go's exec.Cmd connecting stdin/stdout directly to child processes, a filesystem snapshot tool that ignored rare failures in its final write(2)/splice(2) calls under heavy load, and low disk space. Together these truncated snapshot streams without raising any error. The team reverted the triggering deploy, added monitoring at suspected loss points, salvaged corrupt data on load, validated snapshot output before persisting, and ran a batch Dataflow pipeline over old repls. Afterwards they refactored snapshotting and Operational Transformation history persistence, which made repls both more reliable and faster to load.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Go](https://swe.quest/tags/go.md) (Languages)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)

## Prerequisites

- Unix pipes and syscalls ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- Go os/exec ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))

## Keywords

Replit, exec.Cmd, splice, Dataflow, Operational Transformation

## Related posts

- [May 18 Replit downtime](https://swe.quest/articles/may-18-replit-downtime-8ded63600c4e370b.md): Replit · 2023-05-20 · Medium · 4 min read · Incidents & postmortems, Go, Concurrency, Deployment, Configuration management
  A latent Go bug leaked RWMutex read-locks whenever a configuration kind had no handler.
- [Break Stuff on Purpose](https://swe.quest/articles/break-stuff-on-purpose-87dc2221ffb9f4a6.md): Slack Engineering · 2024-12-10 · Medium · 5 min read · Chaos engineering, Incidents & postmortems, Observability, SRE
  Slack's internal Kibana cluster failed in January 2024 after running out of disk, a consequence of co-locating its Elasticsearch storage on the same hosts as the application.
- [Welcome to the Wonderful World of Clusters](https://swe.quest/articles/welcome-to-the-wonderful-world-of-clusters-52a29e1c3fc463f3.md): Replit · 2021-03-26 · Medium · 5 min read · System design, DNS, Resilience, Distributed systems, Cloud platforms
  Replit split its infrastructure into multiple independent clusters (failure domains) after two load-related site-wide outages, moving paid Hacker users into their own cluster so future incidents affect only a subset of users.
- [How We Found and Fixed a Filesystem Corruption Bug](https://swe.quest/articles/how-we-found-and-fixed-a-filesystem-corruption-bug-ec675d8c1746a0c9.md): Heroku Engineering · 2017-02-15 · Medium · 6 min read · Incidents & postmortems, Linux, Containers, Storage systems, Deployment
  A failed Cedar-14 stack image rollback caused Heroku's container tools to truncate and overwrite a disk image while it was still mounted read-only as dynos' root filesystem.
- [Sharding Infrastructure: The Regional Goval Project](https://swe.quest/articles/sharding-infrastructure-the-regional-goval-project-86db1e97083bbccb.md): Replit · 2024-02-14 · Medium · 7 min read · Infrastructure as code, Distributed systems, Cloud platforms, Resilience, Deployment
  Replit re-sharded the infrastructure that runs Repls (Goval) from a few unbalanced, multi-region clusters partitioned by user membership into uniformly sized, single-region clusters with Repls distributed by consistent hashing, shrinking failure domains and removing cross-region traffic.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
