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

snapview-server: make timestamps stable #4072

Merged
merged 1 commit into from Mar 24, 2023

Conversation

xhernandez
Copy link
Contributor

In the previous implementation, when the mtime, ctime and atime of an snapshot virtual directory was requested, the returned time was the current time.

Apparently, the old versions of kernel's nfs client did ignore this change during a readdir operation. However, newer versions are checking it and retrying the whole readdir operation when these times differ from the previous request (I guess that it assumes that the directory contents have been changed and tries to get the new contents). This causes a long delay or even an infinite loop.

The optimal change would be to keep the time of modification and changes in the inode context of the virtual directories to always return stable and consistent data, but this requires a significant amount of changes.

For now, just return a constant value for these specific entries.

Fixes: #4071

In the previous implementation, when the mtime, ctime and atime of an
snapshot virtual directory was requested, the returned time was the
current time.

Apparently, the old versions of kernel's nfs client did ignore this
change during a readdir operation. However, newer versions are checking
it and retrying the whole readdir operation when these times differ from
the previous request (I guess that it assumes that the directory
contents have been changed and tries to get the new contents). This
causes a long delay or even an infinite loop.

The optimal change would be to keep the time of modification and changes
in the inode context of the virtual directories to always return stable
and consistent data, but this requires a significant amount of changes.

For now, just return a constant value for these specific entries.

Fixes: gluster#4071
Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
@xhernandez
Copy link
Contributor Author

/run regression

@xhernandez xhernandez merged commit 5ad0830 into gluster:devel Mar 24, 2023
@xhernandez xhernandez deleted the issue-4071 branch March 24, 2023 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mtime in .snap directory is not stable
2 participants