-
Notifications
You must be signed in to change notification settings - Fork 571
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
Remove master
and slave
from source code
#591
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
44e8bee
Initial name changes
PingXie af7edd3
Fix a bad renaming
PingXie 8cc25d0
Fix more files
PingXie d70194f
Fix more files
PingXie bbe031f
Fix clang format
PingXie a1e6fb6
Update github action
PingXie a16c3a5
Remove the premature github action
PingXie 2c3783c
Merge branch 'valkey-io:unstable' into names
PingXie 512e7ad
Fix more names
PingXie c017c9b
Merge branch 'unstable' of https://github.com/pingxie/valkey into names
PingXie 625d764
fix more names
PingXie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -904,12 +904,12 @@ int aofFsyncInProgress(void) { | |
/* Starts a background task that performs fsync() against the specified | ||
* file descriptor (the one of the AOF file) in another thread. */ | ||
void aof_background_fsync(int fd) { | ||
bioCreateFsyncJob(fd, server.master_repl_offset, 1); | ||
bioCreateFsyncJob(fd, server.primary_repl_offset, 1); | ||
} | ||
|
||
/* Close the fd on the basis of aof_background_fsync. */ | ||
void aof_background_fsync_and_close(int fd) { | ||
bioCreateCloseAofJob(fd, server.master_repl_offset, 1); | ||
bioCreateCloseAofJob(fd, server.primary_repl_offset, 1); | ||
} | ||
|
||
/* Kills an AOFRW child process if exists */ | ||
|
@@ -1069,11 +1069,12 @@ void flushAppendOnlyFile(int force) { | |
} else { | ||
/* All data is fsync'd already: Update fsynced_reploff_pending just in case. | ||
* This is needed to avoid a WAITAOF hang in case a module used RM_Call with the NO_AOF flag, | ||
* in which case master_repl_offset will increase but fsynced_reploff_pending won't be updated | ||
* in which case primary_repl_offset will increase but fsynced_reploff_pending won't be updated | ||
* (because there's no reason, from the AOF POV, to call fsync) and then WAITAOF may wait on | ||
* the higher offset (which contains data that was only propagated to replicas, and not to AOF) */ | ||
if (!sync_in_progress && server.aof_fsync != AOF_FSYNC_NO) | ||
atomic_store_explicit(&server.fsynced_reploff_pending, server.master_repl_offset, memory_order_relaxed); | ||
atomic_store_explicit(&server.fsynced_reploff_pending, server.primary_repl_offset, | ||
memory_order_relaxed); | ||
return; | ||
} | ||
} | ||
|
@@ -1243,7 +1244,7 @@ void flushAppendOnlyFile(int force) { | |
latencyAddSampleIfNeeded("aof-fsync-always", latency); | ||
server.aof_last_incr_fsync_offset = server.aof_last_incr_size; | ||
server.aof_last_fsync = server.mstime; | ||
atomic_store_explicit(&server.fsynced_reploff_pending, server.master_repl_offset, memory_order_relaxed); | ||
atomic_store_explicit(&server.fsynced_reploff_pending, server.primary_repl_offset, memory_order_relaxed); | ||
} else if (server.aof_fsync == AOF_FSYNC_EVERYSEC && server.mstime - server.aof_last_fsync >= 1000) { | ||
if (!sync_in_progress) { | ||
aof_background_fsync(server.aof_fd); | ||
|
@@ -1355,7 +1356,7 @@ struct client *createAOFClient(void) { | |
c->id = CLIENT_ID_AOF; /* So modules can identify it's the AOF client. */ | ||
|
||
/* | ||
* The AOF client should never be blocked (unlike master | ||
* The AOF client should never be blocked (unlike primary | ||
* replication connection). | ||
* This is because blocking the AOF client might cause | ||
* deadlock (because potentially no one will unblock it). | ||
|
@@ -1365,9 +1366,9 @@ struct client *createAOFClient(void) { | |
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pls update line 1358 "master" |
||
c->flags = CLIENT_DENY_BLOCKING; | ||
|
||
/* We set the fake client as a slave waiting for the synchronization | ||
/* We set the fake client as a replica waiting for the synchronization | ||
* so that the server will not try to send replies to this client. */ | ||
c->replstate = SLAVE_STATE_WAIT_BGSAVE_START; | ||
c->repl_state = REPLICA_STATE_WAIT_BGSAVE_START; | ||
return c; | ||
} | ||
|
||
|
@@ -2320,7 +2321,7 @@ int rewriteAppendOnlyFile(char *filename) { | |
|
||
if (server.aof_use_rdb_preamble) { | ||
int error; | ||
if (rdbSaveRio(SLAVE_REQ_NONE, &aof, &error, RDBFLAGS_AOF_PREAMBLE, NULL) == C_ERR) { | ||
if (rdbSaveRio(REPLICA_REQ_NONE, &aof, &error, RDBFLAGS_AOF_PREAMBLE, NULL) == C_ERR) { | ||
errno = error; | ||
goto werr; | ||
} | ||
|
@@ -2403,12 +2404,12 @@ int rewriteAppendOnlyFileBackground(void) { | |
* between updates to `fsynced_reploff_pending` of the worker thread, belonging | ||
* to the previous AOF, and the new one. This concern is specific for a full | ||
* sync scenario where we don't wanna risk the ACKed replication offset | ||
* jumping backwards or forward when switching to a different master. */ | ||
* jumping backwards or forward when switching to a different primary. */ | ||
bioDrainWorker(BIO_AOF_FSYNC); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 2406 |
||
/* Set the initial repl_offset, which will be applied to fsynced_reploff | ||
* when AOFRW finishes (after possibly being updated by a bio thread) */ | ||
atomic_store_explicit(&server.fsynced_reploff_pending, server.master_repl_offset, memory_order_relaxed); | ||
atomic_store_explicit(&server.fsynced_reploff_pending, server.primary_repl_offset, memory_order_relaxed); | ||
server.fsynced_reploff = 0; | ||
} | ||
|
||
|
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice in this pr, you update comment as well, pls update the above line master_repl_offset to primary_repl_offset