In the book "Designing Data Intensive Applications", it says
Concurrency and crash recovery are simpler if segment files are append-only or immutable. For crash recovery, you don't need to worry if a crash happened while a value was being overwritten, leaving you with part of old data and part of new data.
But what if we crash while appending? Wouldn't it leave the segment file with only part of the data we intend to append? Do they use a checksum on the segment file and discard the whole segment file?
Commonly used filesystems guarantee that file byte ranges not being written to are not going to be affected by the write in any circumstance (aside from bugs and hardware faults). So you can checksum each transaction separately, and on crash recovery discard only transactions after the first partially written one by truncating the segment file.