-
Notifications
You must be signed in to change notification settings - Fork 242
增加replica的failover功能的注释 #103
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
base: 7.0-cn-annotated
Are you sure you want to change the base?
增加replica的failover功能的注释 #103
Conversation
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.
先做了点格式上的修改,也顺便看了一下有点懵,机翻得太多了。
* is returned, and the RDB saving will not persist any replication related | ||
* information. */ | ||
/* 填充 rdbSaveInfo 结构,该结构用于将复制信息保存在 RDB 文件中。 | ||
* 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 |
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.
* 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | |
* 当前,该结构仅显式地包含来自主流的当前选定 DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 |
* information. */ | ||
/* 填充 rdbSaveInfo 结构,该结构用于将复制信息保存在 RDB 文件中。 | ||
* 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | ||
* 该函数填充通常在调用程序中堆栈分配的 “rsi” , |
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.
* 该函数填充通常在调用程序中堆栈分配的 “rsi” , | |
* 该函数填充通常在调用程序中堆栈分配的 "rsi", |
/* 填充 rdbSaveInfo 结构,该结构用于将复制信息保存在 RDB 文件中。 | ||
* 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | ||
* 该函数填充通常在调用程序中堆栈分配的 “rsi” , | ||
* 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息*/ |
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.
* 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息*/ | |
* 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息 |
* 当前,该结构仅显式地包含来自主流的当前选定DB,但是,如果 rdbSave*() 系列函数接收到 NULL 的 rsi 结构,则不会保存复制 ID/偏移量。 | ||
* 该函数填充通常在调用程序中堆栈分配的 “rsi” , | ||
* 如果实例具有有效的主客户端,则返回填充的指针,否则返回 NULL ,并且 RDB 保存不会保留任何与复制相关的信息*/ | ||
/* 当前方法主要会写入当前的 dbid ,分别来自于 slaveseld、master->db、cache_master->db */ |
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.
/* 当前方法主要会写入当前的 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,否则它将永远不会被清除:文件不会被删除。 |
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.
* 请注意,如果功能被禁用,我们不会将标志设置为1,否则它将永远不会被清除:文件不会被删除。 | |
* 请注意,如果功能被禁用,我们不会将标志设置为 1,否则它将永远不会被清除:文件不会被删除。 |
* because of replication recently. */ | ||
/* 如果该功能被禁用,请尽快返回,但如果设置了 RDBGeneratedByReplication 标志,请清除该标志。否则,如果该功能已启用, | ||
* 但稍后使用 CONFIG SET 被禁用,则该标志可能会保持为1 | ||
* 那么下次通过 CONFIG NET 重新启用该功能时,即使最近由于复制而没有生成 RDB,我们也会将其设置为1 */ |
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.
* 那么下次通过 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请求 */ |
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.
/* 在返回事件循环之前,确保服务器将向所有从节点发送ACK请求 */ | |
/* 在返回事件循环之前,确保服务器将向所有从节点发送 ACK 请求 */ |
* 此命令将协调主节点和从节点之间的故障转移 | ||
* 包含以下步骤: | ||
* 1. 主节点将启动客户端暂停写入,以停止复制。 | ||
* 2. 主节点将定期检查其任何副本是否具有通过ack消耗了整个复制流。 |
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.
* 2. 主节点将定期检查其任何副本是否具有通过ack消耗了整个复制流。 | |
* 2. 主节点将定期检查其任何副本是否具有通过 ACK 消耗了整个复制流。 |
NO_FAILOVER = 0, /* No failover in progress */ | ||
/* 等待目标复制副本赶上 */ | ||
FAILOVER_WAIT_FOR_SYNC, /* Waiting for target replica to catch up */ | ||
/* 正在等待目标副本接受PSYNC FAILOVER请求 */ |
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.
/* 正在等待目标副本接受PSYNC FAILOVER请求 */ | |
/* 正在等待目标副本接受 PSYNC FAILOVER 请求 */ |
PAUSE_BY_CLIENT_COMMAND = 0, | ||
/* 停止服务中间的暂停 */ | ||
PAUSE_DURING_SHUTDOWN, | ||
/* Failover的暂停 */ |
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.
/* Failover的暂停 */ | |
/* Failover 的暂停 */ |
好的。我近期处理一下 |
No description provided.