Skip to content

Conversation

@p7nov
Copy link
Contributor

@p7nov p7nov commented Nov 12, 2024

Resolves #4495, #2275, #2276, #4011

Update Reference > Internals > Binary protocol > Replication requests and responses:

  • Add missing IPROTO_JOIN field IPROTO_SERVER_VERSION
  • Add missing steps in the IPROTO_JOIN processing sequence:
    • sending instance initialization information after the first vclock (optional)
    • sending all inserts/updates/upserts/deletes after the initial insert stream is completed
  • Add IPROTO_FETCH_SNAPSHOT subsection with processing sequence (similar to IPROTO_JOIN)
  • Add IPROTO_JOIN_META and IPROTO_JOIN_SNAPSHOT message types
  • Fix typo on Keys used in requests and responses

Note

These fixes are to be cherry-picked to 2.11 documentation. 3.x iproto replication updates will be made in a separate PR.

Deployment: https://docs.d.tarantool.io/en/doc/gh-4495-iproto-replication/reference/internals/iproto/replication/

@p7nov p7nov requested a review from bitgorbovsky November 12, 2024 09:43
@p7nov p7nov requested a review from sergepetrenko November 12, 2024 11:11
Comment on lines 192 to 195
To register an anonymous replica in a replica set so that it's not anonymous anymore,
it must send an IPROTO_REGISTER request to any (TODO: or master?) node in the replica set:

TODO: request structure diagram
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bitgorbovsky @sergepetrenko please assist with TODOs:

  • which instances can accept IPROTO_REGISTER?
  • what is the request structure?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request should be sent to master (like JOIN).

REGISTER contains
MP_STR instance uuid of the sender
(optional) MP_STR instance name (this only applies to 3.0 docs)
MP_MAP vclock of the instance to be registered.

A response to REGISTER contains everything from a JOIN response that is not covered by FETCH_SNAPSHOT response

Basically, IPROTO_FETCH_SNAPSHOT + IPROTO_REGISTER are equivalent to IPROTO_JOIN.

IPROTO_FETCH_SNAPSHOT performs the "initial join" stage, where a stream of snapshot rows is sent to a replica, and IPROTO_REGISTER performs the "final join" stage, where the node is registered, and a follow-up stream of xlog contents is fed to the replica (until it receives a row with its own registration).

Copy link
Contributor

@sergepetrenko sergepetrenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

Comment on lines 192 to 195
To register an anonymous replica in a replica set so that it's not anonymous anymore,
it must send an IPROTO_REGISTER request to any (TODO: or master?) node in the replica set:

TODO: request structure diagram
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request should be sent to master (like JOIN).

REGISTER contains
MP_STR instance uuid of the sender
(optional) MP_STR instance name (this only applies to 3.0 docs)
MP_MAP vclock of the instance to be registered.

A response to REGISTER contains everything from a JOIN response that is not covered by FETCH_SNAPSHOT response

Basically, IPROTO_FETCH_SNAPSHOT + IPROTO_REGISTER are equivalent to IPROTO_JOIN.

IPROTO_FETCH_SNAPSHOT performs the "initial join" stage, where a stream of snapshot rows is sent to a replica, and IPROTO_REGISTER performs the "final join" stage, where the node is registered, and a follow-up stream of xlog contents is fed to the replica (until it receives a row with its own registration).

@p7nov p7nov requested a review from sergepetrenko November 13, 2024 10:27
Copy link
Contributor

@sergepetrenko sergepetrenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes!
LGTM.


6. The new vclock's MP_MAP in a response similar to the one above.

Then the instance closes the socket.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Соединение не закрывается, так как при поднятии репликации по тому же соединению потом посылаются запросы на SUBSCRIBE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Спасибо, убрал это предложение из всех трёх описаний.


#. The new vclock's MP_MAP.

Then the instance closes the socket.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогичное замечание

:start-after: iproto_fetch_snapshot_response_sequence_start
:end-before: iproto_fetch_snapshot_response_sequence_end

Then the instance closes the socket.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогичное замечание. Откуда вообще информация, что после каждого такое взаимодействия закрывается соединение?

@p7nov p7nov requested a review from bitgorbovsky November 15, 2024 08:38
@p7nov p7nov merged commit 9e9e02e into latest Nov 15, 2024
1 check passed
@p7nov p7nov deleted the gh-4495-iproto-replication branch November 15, 2024 08:45
p7nov added a commit that referenced this pull request Nov 15, 2024
p7nov added a commit that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants