From 2665e0343dc76b9b31edc8a7dbe38f1fdbd383ac Mon Sep 17 00:00:00 2001 From: 0x29a Date: Mon, 13 May 2024 10:43:50 +0800 Subject: [PATCH] chore: typo in week2-05-manifest.md (#73) --- mini-lsm-book/src/week2-05-manifest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mini-lsm-book/src/week2-05-manifest.md b/mini-lsm-book/src/week2-05-manifest.md index 2361ed0a..cd55deee 100644 --- a/mini-lsm-book/src/week2-05-manifest.md +++ b/mini-lsm-book/src/week2-05-manifest.md @@ -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 `/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 `/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.