Learn Labs
Operations

Failure Scenarios

How a SeaweedFS cluster breaks, measured in this lab

Each component holds a different piece of knowledge, so each failure breaks a different set of operations. Every row below was produced on this module's cluster.

failurereadsexisting objectswritesnew objectsalertfires1 volume server down✓✓✓2 volume servers down!✗✓master leader down✓✓2 of 3 masters down✓✗✓filer down✗✗✓

One volume server down

docker stop volume-2
durability.py check -> listed 200: 200 intact, 0 corrupt, 0 unreadable
                     new 50 KB write during the outage: accepted

Fully available, as replication 010 promises. Its volumes are under-replicated: SeaweedFSVolumeServerDown fires after 1 minute and SeaweedFSUnderReplicated about 10 to 15 minutes later. Decide: bring it back, or run volume.fix.replication -apply, which needs free slots elsewhere. In this lab it couldn't place 4 of the volumes.

Two volume servers down

docker stop volume-2 volume-3
durability.py check -> listed 200: 162 intact, 0 corrupt, 38 unreadable (76.6s)
                     new 50 KB write during the outage: InternalError

Objects whose volume had both copies on the stopped pair are unreadable, and slowly: each GET waits through timeouts and retries. New writes failed. Nothing was corrupted, and everything came back when the servers did.

Master leader down

docker stop master-3            # the leader
# master-1 elected after 13 s
S3 write with master-3 down: ok

Raft elects a new leader within seconds. Volume servers and the filer reconnect to it. In this run S3 writes continued; writes that need a new file id during the election window can fail and should be retried.

Two of three masters down

docker stop master-2 master-3
t=0..30s   {"IsLeader":true,"Leader":"master-1:9333.19333", ...}
t=45s      {"Peers":[...], ...}                 # no leader: master-1 stepped down
GET existing: b'x'
PUT: ClientError InternalError
master-1 log: raft.Server: Not current leader

For 30 to 45 seconds, master-1 kept acting as leader without a majority; then it stepped down. After that there's no leader and no file ids, so every write fails. Reads keep working, because the filer has cached where each volume lives. SeaweedFSNoMasterLeader fires after 2 minutes.

Filer down

docker stop filer
GET: EndpointConnectionError Could not connect to the endpoint URL: "http://filer:8333/app-data/report.txt"
master UI 200

The S3 gateway runs inside the filer here, so S3 is completely down, and nothing else is wrong: the masters and volumes are healthy and every byte is intact. In production, run several filers (with a shared store such as Postgres) and S3 gateways behind a load balancer.

The ones that are slower to notice

ScenarioWhat happensSignal
Disks fill upVolumes go read-only, new volumes can't be grown, writes failSeaweedFSDiskFillingUp, then SeaweedFSNoWritableVolumes
Filer store lost (embedded LevelDB disk)Bytes intact, names gone: S3 serves nothingOnly backups of the store help
Deleted data never comes back as spaceDeletes are tombstones until vacuumBucket size vs disk usage drifts apart
A bad deploy overwrites objectsEvery replica faithfully copies the mistakeVersioning, or nothing
Leaked access keyWhatever its identity allowsS3 request metrics by bucket; scope keys narrowly
Clock skew on a clientRequestTimeTooSkewed / signature errorsS3 4xx rate

Lab

  1. Reproduce each scenario above and note the time until each alert fires.
  2. Stop the filer while durability.py write is running. What does the script report, and are any objects half-written afterwards?
  3. Fill a volume server's disk (a large file in its container) and see which alert fires first.

On this page