Using TLA+ for fun and profit in the development of Elasticsearch
summary
Elasticsearch uses TLA+, PlusCal and the TLC model checker to validate core algorithms: a 860-line TLA+ spec models the new data replication algorithm (a sequence-number primary-backup design) that ships since v6 and checks safety under partitions and crashes; mapping Java code to PlusCal/TLA+ exposes two known concurrency bugs and one previously unknown bug, with TLC finds bugs within seconds in some cases; the cluster-coordination safety spec drove a one-to-one Java implementation now powering v7, and all specs are public on GitHub.
AI-written summary · about
chapters (8)
- 0:00Intro
- 1:58Elasticsearch's data replication and clustering High-level architecture
- 3:48Towards a more resilient system A multi-year journey
- 5:50Data replication model A first formal specification for Elasticsearch
- 8:02Investigating concurrency and algorithmic bugs From implementation to formal model and back
- 9:40What is cluster coordination? A redesigned cluster coordination subsystem for Elasticsearch 7.0
- 12:18Cluster coordination TLA* spec
- 15:32Lessons learned
