增加replica的failover功能的注释 - #103
Open
artikell wants to merge 1 commit into
Open
Conversation
ncghost1
reviewed
Feb 16, 2023
ncghost1
left a comment
Member
There was a problem hiding this comment.
先做了点格式上的修改,也顺便看了一下有点懵,机翻得太多了。
| * is returned, and the RDB saving will not persist any replication related | ||
| * information. */ | ||
| /* 填充 rdbSaveInfo 结构,该结构用于将复制信息保存在 RDB 文件中。 | ||
| * 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 |
Member
There was a problem hiding this comment.
Suggested change
| * 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | |
| * 当前,该结构仅显式地包含来自主流的当前选定 DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 |
| * information. */ | ||
| /* 填充 rdbSaveInfo 结构,该结构用于将复制信息保存在 RDB 文件中。 | ||
| * 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | ||
| * 该函数填充通常在调用程序中堆栈分配的 “rsi” , |
Member
There was a problem hiding this comment.
Suggested change
| * 该函数填充通常在调用程序中堆栈分配的 “rsi” , | |
| * 该函数填充通常在调用程序中堆栈分配的 "rsi", |
| /* 填充 rdbSaveInfo 结构,该结构用于将复制信息保存在 RDB 文件中。 | ||
| * 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | ||
| * 该函数填充通常在调用程序中堆栈分配的 “rsi” , | ||
| * 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息*/ |
Member
There was a problem hiding this comment.
Suggested change
| * 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息*/ | |
| * 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息 |
| * 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | ||
| * 该函数填充通常在调用程序中堆栈分配的 “rsi” , | ||
| * 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息*/ | ||
| /* 当前方法主要会写入当前的 dbid ,分别来自于 slaveseld、master->db、cache_master->db */ |
Member
There was a problem hiding this comment.
Suggested change
| /* 当前方法主要会写入当前的 dbid ,分别来自于 slaveseld、master->db、cache_master->db */ | |
| * 当前方法主要会写入当前的 dbid ,分别来自于 slaveseld、master->db、cache_master->db */ |
| * it would never be cleared: the file is not deleted. This way if | ||
| * the user enables it later with CONFIG SET, we are fine. */ | ||
| /* 如果我们成功地启动了一个带有磁盘目标的 BGSAVE ,让我们记住这个事实,以便稍后在需要时删除该文件。 | ||
| * 请注意,如果功能被禁用,我们不会将标志设置为1,否则它将永远不会被清除:文件不会被删除。 |
Member
There was a problem hiding this comment.
Suggested change
| * 请注意,如果功能被禁用,我们不会将标志设置为1,否则它将永远不会被清除:文件不会被删除。 | |
| * 请注意,如果功能被禁用,我们不会将标志设置为 1,否则它将永远不会被清除:文件不会被删除。 |
| * because of replication recently. */ | ||
| /* 如果该功能被禁用,请尽快返回,但如果设置了 RDBGeneratedByReplication 标志,请清除该标志。否则,如果该功能已启用, | ||
| * 但稍后使用 CONFIG SET 被禁用,则该标志可能会保持为1 | ||
| * 那么下次通过 CONFIG NET 重新启用该功能时,即使最近由于复制而没有生成 RDB,我们也会将其设置为1 */ |
Member
There was a problem hiding this comment.
Suggested change
| * 那么下次通过 CONFIG NET 重新启用该功能时,即使最近由于复制而没有生成 RDB,我们也会将其设置为1 */ | |
| * 那么下次通过 CONFIG SET 重新启用该功能时,即使最近由于复制而没有生成 RDB,我们也会将其设置为 1 */ |
|
|
||
| /* Make sure that the server will send an ACK request to all the slaves | ||
| * before returning to the event loop. */ | ||
| /* 在返回事件循环之前,确保服务器将向所有从节点发送ACK请求 */ |
Member
There was a problem hiding this comment.
Suggested change
| /* 在返回事件循环之前,确保服务器将向所有从节点发送ACK请求 */ | |
| /* 在返回事件循环之前,确保服务器将向所有从节点发送 ACK 请求 */ |
| * 此命令将协调主节点和从节点之间的故障转移 | ||
| * 包含以下步骤: | ||
| * 1. 主节点将启动客户端暂停写入,以停止复制。 | ||
| * 2. 主节点将定期检查其任何副本是否具有通过ack消耗了整个复制流。 |
Member
There was a problem hiding this comment.
Suggested change
| * 2. 主节点将定期检查其任何副本是否具有通过ack消耗了整个复制流。 | |
| * 2. 主节点将定期检查其任何副本是否具有通过 ACK 消耗了整个复制流。 |
| NO_FAILOVER = 0, /* No failover in progress */ | ||
| /* 等待目标复制副本赶上 */ | ||
| FAILOVER_WAIT_FOR_SYNC, /* Waiting for target replica to catch up */ | ||
| /* 正在等待目标副本接受PSYNC FAILOVER请求 */ |
Member
There was a problem hiding this comment.
Suggested change
| /* 正在等待目标副本接受PSYNC FAILOVER请求 */ | |
| /* 正在等待目标副本接受 PSYNC FAILOVER 请求 */ |
| PAUSE_BY_CLIENT_COMMAND = 0, | ||
| /* 停止服务中间的暂停 */ | ||
| PAUSE_DURING_SHUTDOWN, | ||
| /* Failover的暂停 */ |
Member
There was a problem hiding this comment.
Suggested change
| /* Failover的暂停 */ | |
| /* Failover 的暂停 */ |
Author
好的。我近期处理一下 |
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.
No description provided.