Receipt of REPLCONF VERSION reply should be triggered by event (#1320)
This add the missing return when repl_state change to RECEIVE_VERSION_REPLY, this way we won’t be blocked if the primary doesn’t reply with REPLCONF VERSION. In practice i guess this is no likely to block in this context, reading small responses are are likely to be received in one packet, so this is just a cleanup (consistent with the previous state machine processing). Also update the state machine diagram to mention the VERSION reply. Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
parent
3d0c834203
commit
132798b57d
@ -3379,15 +3379,15 @@ void dualChannelSetupMainConnForPsync(connection *conn) {
|
||||
* ┌────────▼──────────┐ │ │ │DUAL_CHANNEL_RECEIVE_ENDOFF│ │ │by the primary │
|
||||
* │RECEIVE_IP_REPLY │ │ │ └───────┬───────────────────┘ │ ┌──▼────────────────┐ │
|
||||
* └────────┬──────────┘ │ │ │$ENDOFF │ │RECEIVE_PSYNC_REPLY│ │
|
||||
* │ │ │ ├─────────────────────────┘ └──┬────────────────┘ │
|
||||
* │ │ │ │ │+CONTINUE │
|
||||
* │ │ │ ┌───────▼───────────────┐ ┌──▼────────────────┐ │
|
||||
* │ │ │ │DUAL_CHANNEL_RDB_LOAD │ │TRANSFER │ │
|
||||
* │+OK │ │ ├─────────────────────────┘ └──┬────────────────┘ │
|
||||
* ┌────────▼──────────┐ │ │ │ │+CONTINUE │
|
||||
* │RECEIVE_CAPA_REPLY │ │ │ ┌───────▼───────────────┐ ┌──▼────────────────┐ │
|
||||
* └────────┬──────────┘ │ │ │DUAL_CHANNEL_RDB_LOAD │ │TRANSFER │ │
|
||||
* │+OK │ │ └───────┬───────────────┘ └─────┬─────────────┘ │
|
||||
* ┌────────▼──────────┐ │ │ │Done loading │ │
|
||||
* │RECEIVE_CAPA_REPLY │ │ │ ┌───────▼───────────────┐ │ │
|
||||
* └────────┬──────────┘ │ │ │DUAL_CHANNEL_RDB_LOADED│ │ │
|
||||
* │ │ │ └───────┬───────────────┘ │ │
|
||||
* ┌────────▼─────────────┐ │ │ │Done loading │ │
|
||||
* │RECEIVE_VERSION_REPLY │ │ │ ┌───────▼───────────────┐ │ │
|
||||
* └────────┬─────────────┘ │ │ │DUAL_CHANNEL_RDB_LOADED│ │ │
|
||||
* │+OK │ │ └───────┬───────────────┘ │ │
|
||||
* ┌────────▼───┐ │ │ │ │ │
|
||||
* │SEND_PSYNC │ │ │ │Replica loads local replication │ │
|
||||
* └─┬──────────┘ │ │ │buffer into memory │ │
|
||||
@ -3589,6 +3589,7 @@ void syncWithPrimary(connection *conn) {
|
||||
sdsfree(err);
|
||||
err = NULL;
|
||||
server.repl_state = REPL_STATE_RECEIVE_VERSION_REPLY;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Receive VERSION reply. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user