Skip to content

Commit 3ed729b

Browse files
committed
Update the description of the iproto_raft request
Part of #2814
1 parent 920c973 commit 3ed729b

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

doc/dev_guide/internals/box_protocol.rst

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,16 +1418,10 @@ IPROTO_FLAG_WAIT_ACK (0x04) will be set if this is the last message for a synchr
14181418
IPROTO_RAFT = 0x1e
14191419
~~~~~~~~~~~~~~~~~~
14201420

1421-
[TBD] intro
1422-
1423-
IPROTO_RAFT рассылается броадкастами всем подключённым к ноде репликам.
1424-
Если подразумевается какой-то ответ на запрос (например, когда это запрос другим нодам на голосование),
1425-
то нужно, чтобы нода сама была подключена репликой к серверу, от которого ждёт ответ, потому что он придёт по каналу репликации.
1426-
1427-
Другими словами, связь между всеми должна быть в обе стороны (фуллмеш)
1428-
1429-
1430-
[TBD] update request structure
1421+
The IPROTO_RAFT request is broadcasted to all the replicas connected to the node.
1422+
If there should be a response, for example, in case of a vote request to other nodes, the response will be also an IPROTO_RAFT message.
1423+
In this case, the node should be connected as a replica to another node from which the response is expected because the response is sent via the replication channel.
1424+
In other words, there should be a full-mesh connection between the nodes.
14311425

14321426
.. cssclass:: highlight
14331427
.. parsed-literal::
@@ -1437,22 +1431,17 @@ IPROTO_RAFT рассылается броадкастами всем подкл
14371431
# <header>
14381432
msgpack({
14391433
IPROTO_REQUEST_TYPE: IPROTO_RAFT,
1440-
IPROTO_SYNC: :samp:`{{MP_UINT unsigned integer}}`,
1441-
IPROTO_INSTANCE_UUID: :samp:`{{uuid}}`,
1442-
IPROTO_CLUSTER_UUID: :samp:`{{uuid}}`,
1434+
IPROTO_REPLICA_ID: :samp:`{{MP_INT integer}}`, # ID of the replica which the request came from
1435+
14431436
})
14441437
# <body>
14451438
msgpack({
1446-
IPROTO_RAFT_TERM=0x00
1447-
IPROTO_RAFT_VOTE=0x01
1448-
IPROTO_RAFT_STATE=0x02
1449-
IPROTO_RAFT_VCLOCK=0x03
1439+
IPROTO_RAFT_TERM: :samp:`{{MP_UINT unsigned integer}}`, # RAFT term of the instance
1440+
IPROTO_RAFT_VOTE: :samp:`{{MP_UINT unsigned integer}}`, # Instance vote in the current term (if any).
1441+
IPROTO_RAFT_STATE: :samp:`{{MP_UINT unsigned integer}}`, # Instance state; one of the three numbers: 1---follower, 2---candidate, 3---leader.
1442+
IPROTO_RAFT_VCLOCK: :samp:`{{MP_ARRAY {{MP_INT SRV_ID, MP_INT SRV_LSN}, {MP_INT SRV_ID, MP_INT SRV_LSN}, ...}}}` # Current vclock of the instance. Presents only on the instances in the "candidate" state (IPROTO_RAFT_STATE == 2).
14501443
})
14511444
1452-
[TBD] update about response
1453-
1454-
Это асинхронный протокол, и response там - другое сообщение IPROTO_RAFT, а бывает вообще без response
1455-
14561445
.. _box_protocol-illustration:
14571446

14581447
Examples

0 commit comments

Comments
 (0)