Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, gorcunov@gmail.com
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v3 10/12] replication: add META stage to JOIN
Date: Wed, 14 Jul 2021 21:28:21 +0300
Message-ID: <3bd07872-aeb4-639c-0bfa-e7e55f3f6792@tarantool.org> (raw)
In-Reply-To: <31de38b6-570f-b6c3-ebeb-695c21ee9e90@tarantool.org>



04.07.2021 15:28, Vladislav Shpilevoy пишет:
> Thanks for the patch!
>
> See 3 comments below.
>
> On 29.06.2021 00:12, Serge Petrenko via Tarantool-patches wrote:
>> The new META stage is part of server's response to a join request.
>> It's marked by IPROTO_JOIN_META and IPROTO_JOIN_SNAPSHOT requests and goes
>> before the actual snapshot data.
>>
>> Follow-up #6034
> 1. You probably should document the new keys and their meaning. As well
> as what is sent between them.

Yep, will do.

>> diff --git a/src/box/applier.cc b/src/box/applier.cc
>> index 07fe7f5c7..7abad3a64 100644
>> --- a/src/box/applier.cc
>> +++ b/src/box/applier.cc
>> @@ -447,12 +447,26 @@ applier_wait_snapshot(struct applier *applier)
>>   		xrow_decode_vclock_xc(&row, &replicaset.vclock);
>>   	}
>>   
>> +	coio_read_xrow(coio, ibuf, &row);
>> +	if (row.type == IPROTO_JOIN_META) {
>> +		/* Read additional metadata. Empty at the moment. */
>> +		do {
>> +			coio_read_xrow(coio, ibuf, &row);
>> +			if (iproto_type_is_error(row.type))
>> +				xrow_decode_error_xc(&row);
>> +			else if (row.type != IPROTO_JOIN_SNAPSHOT) {
> 2. If one branch of `if` got {}, then all branches should get it too.

Fixed, thanks!

>> +				tnt_raise(ClientError, ER_UNKNOWN_REQUEST_TYPE,
>> +					  (uint32_t)row.type);
>> +			}
>> +		} while (row.type != IPROTO_JOIN_SNAPSHOT);
>> +		coio_read_xrow(coio, ibuf, &row);
>> +	}
>> diff --git a/src/box/box.cc b/src/box/box.cc
>> index b2c52bc54..bc68ee4c8 100644
>> --- a/src/box/box.cc
>> +++ b/src/box/box.cc
>> @@ -2501,7 +2501,7 @@ box_process_fetch_snapshot(struct ev_io *io, struct xrow_header *header)
>>   
>>   	/* Send the snapshot data to the instance. */
>>   	struct vclock start_vclock;
>> -	relay_initial_join(io->fd, header->sync, &start_vclock);
>> +	relay_initial_join(io->fd, header->sync, &start_vclock, 0);
>>   	say_info("read-view sent.");
>>   
>>   	/* Remember master's vclock after the last request */
>> @@ -2699,7 +2699,8 @@ box_process_join(struct ev_io *io, struct xrow_header *header)
>>   	 * Initial stream: feed replica with dirty data from engines.
>>   	 */
>>   	struct vclock start_vclock;
>> -	relay_initial_join(io->fd, header->sync, &start_vclock);
>> +	relay_initial_join(io->fd, header->sync, &start_vclock,
>> +			   replica_version_id);
> 3. Shouldn't changes to this file be in the previous commit?

I think not. I start using replica's version only in this commit.
Why start passing it to relay earlier?

-- 
Serge Petrenko


  reply	other threads:[~2021-07-14 18:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 22:12 [Tarantool-patches] [PATCH v3 00/12] forbid implicit limbo ownership transition Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 01/12] replication: always send raft state to subscribers Serge Petrenko via Tarantool-patches
2021-07-04 12:12   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-09  9:43     ` Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 02/12] txn_limbo: fix promote term filtering Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 03/12] raft: refactor raft_new_term() Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 04/12] box: make promote always bump the term Serge Petrenko via Tarantool-patches
2021-07-04 12:14   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-14 18:26     ` Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 05/12] replication: forbid implicit limbo owner transition Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 06/12] box: allow calling promote on a candidate Serge Petrenko via Tarantool-patches
2021-07-04 12:14   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-14 18:26     ` Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 07/12] box: introduce `box.ctl.demote` Serge Petrenko via Tarantool-patches
2021-07-04 12:27   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-14 18:28     ` Serge Petrenko via Tarantool-patches
2021-07-21 23:28       ` Vladislav Shpilevoy via Tarantool-patches
2021-07-23  7:44         ` Sergey Petrenko via Tarantool-patches
2021-07-26 23:50           ` Vladislav Shpilevoy via Tarantool-patches
2021-07-29 20:56             ` Sergey Petrenko via Tarantool-patches
2021-08-01 16:19               ` Vladislav Shpilevoy via Tarantool-patches
2021-08-03  7:56                 ` Serge Petrenko via Tarantool-patches
2021-08-03 23:25                   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-04 13:08                     ` Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 08/12] txn_limbo: persist the latest effective promote in snapshot Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 09/12] replication: encode version in JOIN request Serge Petrenko via Tarantool-patches
2021-07-04 12:27   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-14 18:28     ` Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 10/12] replication: add META stage to JOIN Serge Petrenko via Tarantool-patches
2021-07-04 12:28   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-14 18:28     ` Serge Petrenko via Tarantool-patches [this message]
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 11/12] replication: send latest effective promote in initial join Serge Petrenko via Tarantool-patches
2021-07-04 12:28   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-14 18:28     ` Serge Petrenko via Tarantool-patches
2021-06-28 22:12 ` [Tarantool-patches] [PATCH v3 12/12] replication: send current Raft term in join response Serge Petrenko via Tarantool-patches
2021-07-04 12:29   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-14 18:28     ` Serge Petrenko via Tarantool-patches
2021-08-04 22:41 ` [Tarantool-patches] [PATCH v3 00/12] forbid implicit limbo ownership transition Vladislav Shpilevoy via Tarantool-patches
2021-08-06  7:54   ` Vitaliia Ioffe via Tarantool-patches
2021-08-06  8:31 ` Kirill Yukhin via Tarantool-patches
2021-08-08 10:46   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-09  7:14     ` Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bd07872-aeb4-639c-0bfa-e7e55f3f6792@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Tarantool development patches archive

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lists.tarantool.org/tarantool-patches/0 tarantool-patches/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 tarantool-patches tarantool-patches/ https://lists.tarantool.org/tarantool-patches \
		tarantool-patches@dev.tarantool.org.
	public-inbox-index tarantool-patches

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git