Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replica): run fsync on files & dir after create/remove/rename operation on files #278

Merged
merged 8 commits into from
Apr 14, 2020

Conversation

utkarshmani1997
Copy link
Contributor

@utkarshmani1997 utkarshmani1997 commented Mar 6, 2020

This commit enhances the following:

  • Do fsync on files and directories after create/remove/rename operation

Note:

Signed-off-by: Utkarsh Mani Tripathi [email protected]

@vishnuitta
Copy link
Contributor

  • Is this issue reproduced by performing node restarts and did we observed inconsistent blocks across replicas?
  • If so, does this regular sync (say 5 seconds) helps (with the current way of checking for chain and meta files during sync process)?

@utkarshmani1997 utkarshmani1997 force-pushed the sync branch 3 times, most recently from 834292f to 5fe15e3 Compare April 3, 2020 09:41
@utkarshmani1997 utkarshmani1997 changed the title feat(replica): do periodic sync on files & dir feat(replica): run fsync on files & dir after create/remove/rename operation on files Apr 3, 2020
Utkarsh Mani Tripathi added 7 commits April 13, 2020 18:47
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]>
Signed-off-by: Utkarsh Mani Tripathi <[email protected]>
Signed-off-by: Utkarsh Mani Tripathi <[email protected]>
Signed-off-by: Utkarsh Mani Tripathi <[email protected]>
Copy link
Contributor

@vishnuitta vishnuitta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are good.. one small minor comment..
in coming PR, we need to handle the comment added in this PR " // file created before this needs to be deleted in case of error"

Signed-off-by: Utkarsh Mani Tripathi <[email protected]>
@payes payes merged commit 2b621d1 into openebs-archive:master Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants