-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(replica): run fsync on files & dir after create/remove/rename op…
…eration on files (#278) We open file in O_DIRECT mode which minimizes the cache effects but doesn't guarantee that data is written to the disk. Periodic sync ensures that both data and metadata is flushed to the disk at every 5 seconds. See man page of open system call for more details. Also since fsync on fd's also doesn't guarantee the same so fsync on directory is also required. In this commit a goroutine is launched to perform sync on data files and directory. Also sync and close the replicas gracefully before fataling upon error or killing the replicas. Signed-off-by: Utkarsh Mani Tripathi <[email protected]>
- Loading branch information
Utkarsh Mani Tripathi
authored
Apr 14, 2020
1 parent
6895a58
commit 2b621d1
Showing
7 changed files
with
104 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters