Skip to content

Commit

Permalink
chore: typo in week2-05-manifest.md (skyzh#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben1009 authored and darkjh committed Aug 13, 2024
1 parent c282ec4 commit a7a1946
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mini-lsm-book/src/week2-05-manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ src/lsm_storage.rs
src/compact.rs
```

For now, we only use two types of the manifest records: SST flush and compaction. SST flush record stores the SST id that gets flushed to the disk. Compaction record stores the compaction task and the produced SST ids. Every time you write some new files the the disk, first sync the files and the storage directory, and then write to the manifest and sync the manifest. The manifest file should be written to `<path>/MANIFEST`.
For now, we only use two types of the manifest records: SST flush and compaction. SST flush record stores the SST id that gets flushed to the disk. Compaction record stores the compaction task and the produced SST ids. Every time you write some new files to the disk, first sync the files and the storage directory, and then write to the manifest and sync the manifest. The manifest file should be written to `<path>/MANIFEST`.

To sync the directory, you may implement the `sync_dir` function, where you can use `File::open(dir).sync_all()?` to sync it. On Linux, directory is a file that contains the list of files in the directory. By doing fsync on the directory, you will ensure that the newly-written (or removed) files can be visible to the user if the power goes off.

Expand Down

0 comments on commit a7a1946

Please sign in to comment.