mirror of https://github.com/redis/redis.git
replication.c comment: run_id -> replid.
This commit is contained in:
parent
84b281209a
commit
9f36880837
|
@ -466,7 +466,7 @@ int masterTryPartialResynchronization(client *c) {
|
||||||
(strcasecmp(master_replid, server.replid2) ||
|
(strcasecmp(master_replid, server.replid2) ||
|
||||||
psync_offset > server.second_replid_offset))
|
psync_offset > server.second_replid_offset))
|
||||||
{
|
{
|
||||||
/* Run id "?" is used by slaves that want to force a full resync. */
|
/* Replid "?" is used by slaves that want to force a full resync. */
|
||||||
if (master_replid[0] != '?') {
|
if (master_replid[0] != '?') {
|
||||||
if (strcasecmp(master_replid, server.replid) &&
|
if (strcasecmp(master_replid, server.replid) &&
|
||||||
strcasecmp(master_replid, server.replid2))
|
strcasecmp(master_replid, server.replid2))
|
||||||
|
@ -1362,7 +1362,7 @@ char *sendSynchronousCommand(int flags, int fd, ...) {
|
||||||
/* Try a partial resynchronization with the master if we are about to reconnect.
|
/* Try a partial resynchronization with the master if we are about to reconnect.
|
||||||
* If there is no cached master structure, at least try to issue a
|
* If there is no cached master structure, at least try to issue a
|
||||||
* "PSYNC ? -1" command in order to trigger a full resync using the PSYNC
|
* "PSYNC ? -1" command in order to trigger a full resync using the PSYNC
|
||||||
* command in order to obtain the master run id and the master replication
|
* command in order to obtain the master replid and the master replication
|
||||||
* global offset.
|
* global offset.
|
||||||
*
|
*
|
||||||
* This function is designed to be called from syncWithMaster(), so the
|
* This function is designed to be called from syncWithMaster(), so the
|
||||||
|
@ -1390,7 +1390,7 @@ char *sendSynchronousCommand(int flags, int fd, ...) {
|
||||||
*
|
*
|
||||||
* PSYNC_CONTINUE: If the PSYNC command succeded and we can continue.
|
* PSYNC_CONTINUE: If the PSYNC command succeded and we can continue.
|
||||||
* PSYNC_FULLRESYNC: If PSYNC is supported but a full resync is needed.
|
* PSYNC_FULLRESYNC: If PSYNC is supported but a full resync is needed.
|
||||||
* In this case the master run_id and global replication
|
* In this case the master replid and global replication
|
||||||
* offset is saved.
|
* offset is saved.
|
||||||
* PSYNC_NOT_SUPPORTED: If the server does not understand PSYNC at all and
|
* PSYNC_NOT_SUPPORTED: If the server does not understand PSYNC at all and
|
||||||
* the caller should fall back to SYNC.
|
* the caller should fall back to SYNC.
|
||||||
|
@ -1421,7 +1421,7 @@ int slaveTryPartialResynchronization(int fd, int read_reply) {
|
||||||
/* Writing half */
|
/* Writing half */
|
||||||
if (!read_reply) {
|
if (!read_reply) {
|
||||||
/* Initially set master_initial_offset to -1 to mark the current
|
/* Initially set master_initial_offset to -1 to mark the current
|
||||||
* master run_id and offset as not valid. Later if we'll be able to do
|
* master replid and offset as not valid. Later if we'll be able to do
|
||||||
* a FULL resync using the PSYNC command we'll set the offset at the
|
* a FULL resync using the PSYNC command we'll set the offset at the
|
||||||
* right value, so that this information will be propagated to the
|
* right value, so that this information will be propagated to the
|
||||||
* client structure representing the master into server.master. */
|
* client structure representing the master into server.master. */
|
||||||
|
@ -1462,7 +1462,7 @@ int slaveTryPartialResynchronization(int fd, int read_reply) {
|
||||||
if (!strncmp(reply,"+FULLRESYNC",11)) {
|
if (!strncmp(reply,"+FULLRESYNC",11)) {
|
||||||
char *replid = NULL, *offset = NULL;
|
char *replid = NULL, *offset = NULL;
|
||||||
|
|
||||||
/* FULL RESYNC, parse the reply in order to extract the run id
|
/* FULL RESYNC, parse the reply in order to extract the replid
|
||||||
* and the replication offset. */
|
* and the replication offset. */
|
||||||
replid = strchr(reply,' ');
|
replid = strchr(reply,' ');
|
||||||
if (replid) {
|
if (replid) {
|
||||||
|
@ -1749,7 +1749,7 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) {
|
||||||
|
|
||||||
/* Try a partial resynchonization. If we don't have a cached master
|
/* Try a partial resynchonization. If we don't have a cached master
|
||||||
* slaveTryPartialResynchronization() will at least try to use PSYNC
|
* slaveTryPartialResynchronization() will at least try to use PSYNC
|
||||||
* to start a full resynchronization so that we get the master run id
|
* to start a full resynchronization so that we get the master replid
|
||||||
* and the global offset, to try a partial resync at the next
|
* and the global offset, to try a partial resync at the next
|
||||||
* reconnection attempt. */
|
* reconnection attempt. */
|
||||||
if (server.repl_state == REPL_STATE_SEND_PSYNC) {
|
if (server.repl_state == REPL_STATE_SEND_PSYNC) {
|
||||||
|
|
Loading…
Reference in New Issue