mirror of
https://github.com/apache/rocketmq.git
synced 2026-08-28 20:09:14 +08:00
@@ -121,13 +121,13 @@ nextTransferFromWhere + size > currentTransferEpochEndOffset,则将 selectMapp
|
||||
|
||||

|
||||
|
||||
`current state(4byte) + Two flags(4byte) + slaveAddressLength(4byte) + slaveAddress(50byte)`
|
||||
`current state(4byte) + Two flags(4byte) + slaveBrokerId(8byte)`
|
||||
|
||||
- Current state 代表当前的 HAConnectionState,也即 HANDSHAKE。
|
||||
|
||||
- Two flags 是两个状态标志位,其中,isSyncFromLastFile 代表是否要从 Master 的最后一个文件开始复制,isAsyncLearner 代表该 Slave 是否是异步复制,并以 Learner 的形式接入 Master。
|
||||
|
||||
- slaveAddressLength 与 slaveAddress 代表了该 Slave 的地址,用于后续加入 SyncStateSet 。
|
||||
- slaveBrokerId 代表了该 Slave 的 brokerId,用于后续加入 SyncStateSet 。
|
||||
|
||||
2.AutoSwitchHaConnection (Master) 会向 Slave 回送 HandShake 包,如下:
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 68 KiB |
@@ -112,13 +112,13 @@ According to the above, we can know the AutoSwitchHaService protocol divides log
|
||||
|
||||

|
||||
|
||||
`current state(4byte) + Two flags(4byte) + slaveAddressLength(4byte) + slaveAddress(50byte)`
|
||||
`current state(4byte) + Two flags(4byte) + slaveBrokerId(8byte)`
|
||||
|
||||
- `Current state` represents the current HAConnectionState, which is HANDSHAKE.
|
||||
|
||||
- Two flags are two status flags, where `isSyncFromLastFile` indicates whether to start copying from the Master's last file, and `isAsyncLearner` indicates whether the Slave is an asynchronous copy and joins the Master as a Learner.
|
||||
|
||||
- `slaveAddressLength` and `slaveAddress` represent the address of the Slave, which will be used later to join the SyncStateSet.
|
||||
- `slaveBrokerId` represent the brokerId of the Slave, which will be used later to join the SyncStateSet.
|
||||
|
||||
2.AutoSwitchHaConnection (Master) will send a HandShake packet back to the Slave as follows:
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 68 KiB |
Reference in New Issue
Block a user