Merged
Conversation
oranagra
reviewed
Sep 24, 2020
src/replication.c
Outdated
Comment on lines
1742
to
1751
Member
There was a problem hiding this comment.
I don't think we want to put it between the rename and open (which is actually part of the rename. (also makes a shorter error handling)
Suggested change
| /* Rename rdb like renaming rewrite aof asynchronously. */ | |
| int old_rdb_fd = open(server.rdb_filename,O_RDONLY|O_NONBLOCK); | |
| if (fsync(server.repl_transfer_fd) == -1) { | |
| serverLog(LL_WARNING, | |
| "Failed trying to sync the temp DB to disk in " | |
| "MASTER <-> REPLICA synchronization: %s", | |
| strerror(errno)); | |
| cancelReplicationHandshake(1); | |
| if (old_rdb_fd != -1) close(old_rdb_fd); | |
| return; | |
| } | |
| /* Make sure the new file (also used for persistence) is fully synced | |
| * (not covered by earlier calls to rdb_fsync_range). */ | |
| if (fsync(server.repl_transfer_fd) == -1) { | |
| serverLog(LL_WARNING, | |
| "Failed trying to sync the temp DB to disk in " | |
| "MASTER <-> REPLICA synchronization: %s", | |
| strerror(errno)); | |
| cancelReplicationHandshake(1); | |
| return; | |
| } | |
| /* Rename rdb like renaming rewrite aof asynchronously. */ | |
| int old_rdb_fd = open(server.rdb_filename,O_RDONLY|O_NONBLOCK); |
Contributor
Author
There was a problem hiding this comment.
Fixed and rebased manually.
We should sync temp DB file before renaming as rdb_fsync_range does not use
flag `SYNC_FILE_RANGE_WAIT_AFTER`.
Refer to `Linux Programmer's Manual`:
SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of all pages in the range after performing any write.
d8a3636 to
63794e3
Compare
oranagra
approved these changes
Sep 25, 2020
Merged
oranagra
pushed a commit
that referenced
this pull request
Oct 27, 2020
We should sync temp DB file before renaming as rdb_fsync_range does not use
flag `SYNC_FILE_RANGE_WAIT_AFTER`.
Refer to `Linux Programmer's Manual`:
SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of all pages in the range after performing any write.
(cherry picked from commit 0d62caa)
oranagra
pushed a commit
that referenced
this pull request
Oct 27, 2020
We should sync temp DB file before renaming as rdb_fsync_range does not use
flag `SYNC_FILE_RANGE_WAIT_AFTER`.
Refer to `Linux Programmer's Manual`:
SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of all pages in the range after performing any write.
(cherry picked from commit 0d62caa)
JackieXie168
pushed a commit
to JackieXie168/redis
that referenced
this pull request
Nov 4, 2020
We should sync temp DB file before renaming as rdb_fsync_range does not use
flag `SYNC_FILE_RANGE_WAIT_AFTER`.
Refer to `Linux Programmer's Manual`:
SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of all pages in the range after performing any write.
jschmieg
pushed a commit
to memKeyDB/memKeyDB
that referenced
this pull request
Nov 6, 2020
We should sync temp DB file before renaming as rdb_fsync_range does not use
flag `SYNC_FILE_RANGE_WAIT_AFTER`.
Refer to `Linux Programmer's Manual`:
SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of all pages in the range after performing any write.
(cherry picked from commit 0d62caa)
pulllock
pushed a commit
to pulllock/redis
that referenced
this pull request
Jun 28, 2023
We should sync temp DB file before renaming as rdb_fsync_range does not use
flag `SYNC_FILE_RANGE_WAIT_AFTER`.
Refer to `Linux Programmer's Manual`:
SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of all pages in the range after performing any write.
(cherry picked from commit 0d62caa)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We should sync temp DB file before renaming as rdb_fsync_range does not use
flag
SYNC_FILE_RANGE_WAIT_AFTER.Refer to
Linux Programmer's Manual:SYNC_FILE_RANGE_WAIT_AFTER
Wait upon write-out of all pages in the range after performing any write.