{"id":"wal-rotate-fsync-before-close","text":"`_rotate` always fsyncs the outgoing segment before closing it, ensuring no buffered writes are lost during segment rotation.","truth_value":"IN","source":"entries/2026/05/29/write-ahead-log-wal-_rotate.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{"example":"def _rotate(self):\n    if self._fd:\n        self._fd.flush()\n        os.fsync(self._fd.fileno())\n        self._fd.close()"},"explanation":{"steps":[{"node":"wal-rotate-fsync-before-close","truth_value":"IN","reason":"premise"}]}}