]> git.giacomolli.uk - onechat/commit
Write each line to the OS without an fsync
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 15:04:10 +0000 (12:04 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 15:06:45 +0000 (12:06 -0300)
commit4e3341f81d4c9b296c8fd016f4a086752d561efd
tree96f618480431c1d989a598b09d6018dfcb81a42c
parente754189bc2aa32ec43a5dc4ee01d7a6c6e4e388c
Write each line to the OS without an fsync

Each log line and each node goes to the operating system with one write
and no buffer before the call returns, so a crash of the process loses
nothing. view.json stays atomic through a temporary file and a rename.
An fsync on each write cost about 96 ms per message on a typical disk,
which made a long replay take hours. Durability against a power loss is
a later group commit, with one background sync that makes all earlier
writes durable.

Issue: beb9a70
journal.go
log.go
memory.go