fix: handle rsync response error in slave side #2319
Merged
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.
master节点收到slave节点拉取文件的请求之后,如果本地的dump目录被删除,会向slave节点回包,返回错误,但没有设置offset字段。
slave节点在收到回包之后,会比对offset字段,如果offset字段不匹配,会认为这是一个过期的回包丢弃掉,继续等待新的回包。这种情况下,master的错误会被被意外丢弃掉,导致请求超时。
修复方式,即在收到回包时单独处理错误的回包。