electric-sql / electric-sql/electric

Potential missing data on restore due to fsync not guaranteeing writes to disk

Open
#2,982 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10.4k
Forks
375
Avg merge
3d 1h
Merged PRs (30d)
18

Description

As mentioned by @alco in #2925 fsync (or `:file.datasync/1` in our code) does not guarantee that the data has been written to disk, only that the OS has been asked to. If power is lost the data may not be recoverable. #2974 acks on flush/fsync which is a big improvement on what we had before, but still allows a chance that data will be lost if we ack the flushed data and power is lost before the data is written to disk, the system restarts and resumes from a point after the missing data.

As @icehaunter has mentioned, we could look to see how other databases such as Postgres have closed this loophole.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.