News for hackers. Stuff that matters.
Re:Show HN: WAL Implementation in Golang by stym06 on Monday July 08, 2024 @03:24PM (#40908591)
I used the bufio flush mechanism https://pkg.go.dev/bufio#Writer.Flush

Thanks for your comment, I'll definitely check it out. It was my first attempt at this. How can I make it better?

Re:Show HN: WAL Implementation in Golang by sakras on Monday July 08, 2024 @03:54PM (#40908912)
Essentially, unless you `fsync`, there's no guarantee that your data will be durably written to disk. This is because the operating system keeps data buffered in in-memory caches, so if the machine crashes you may lose some data. The `fsync` system call forces the data to be flushed from the in-memory OS cache to the disk. As far as I could tell, the Flush you use does not `fsync`.
Re:Show HN: WAL Implementation in Golang by stym06 on Monday July 08, 2024 @04:07PM (#40909062)
Thanks for your input @sakras. I'll fix this