wal-rotate-fsync-before-close

Status: IN

`_rotate` always fsyncs the outgoing segment before closing it, ensuring no buffered writes are lost during segment rotation.

Source: entries/2026/05/29/write-ahead-log-wal-_rotate.md

Example

def _rotate(self):
    if self._fd:
        self._fd.flush()
        os.fsync(self._fd.fileno())
        self._fd.close()

JSON