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

fix: prevents Dragonfly from blocking in epoll during snapshotting #3911

Merged
merged 1 commit into from
Oct 12, 2024
Merged

Conversation

romange
Copy link
Collaborator

@romange romange commented Oct 12, 2024

The problem - we used file write in non-direct mode when writing snapshots in epoll mode. As a result - lots of data was cached into OS memory. But then during the rename operation, when we rename "xxx.dfs.tmp" into "xxx.dfs", the OS flushes the file caches and the thread is stuck in OS system call rename for a long time.

The fix - to use DIRECT mode and to avoid caching the data into OS caches at all.

Fixes #3895

dranikpg
dranikpg previously approved these changes Oct 12, 2024
Copy link
Contributor

@dranikpg dranikpg left a comment

Choose a reason for hiding this comment

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

Good catch

src/server/server_family.cc Show resolved Hide resolved
The problem - we used file write in non-direct mode when writing snapshots in epoll mode.
As a result - lots of data was cached into OS memory. But then during the rename operation,
when we rename "xxx.dfs.tmp" into "xxx.dfs", the OS flushes the file caches and the thread
is stuck in OS system call rename for a long time.

The fix - to use DIRECT mode and to avoid caching the data into OS caches at all.
Fixes #3895

Signed-off-by: Roman Gershman <[email protected]>
@romange romange merged commit 4012ad1 into main Oct 12, 2024
12 checks passed
@romange romange deleted the Pr2 branch October 12, 2024 15:26
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.

Snapshotting in Epoll blocks Dragonfly threads
2 participants