diff --git a/TODO.txt b/TODO.txt index f8f67c1..3d20333 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,3 +1,4 @@ [ ] Add log compaction [ ] Add log persistence -[ ] Add chunk locations to metadata \ No newline at end of file +[ ] Add chunk locations to metadata +[ ] fsync parent directory when renaming log \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index ae7cc24..ad2b09d 100644 --- a/src/wal.c +++ b/src/wal.c @@ -266,6 +266,8 @@ int wal_replace(WAL *wal, WALEntry *entries, int count) if (rename_file_or_dir(tmp_path, wal_path) < 0) return -1; + // TODO: fsync on parent directory + // Reopen the WAL file and seek to end for future appends. Handle new_handle; if (file_open(wal_path, &new_handle) < 0)