Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org,
	Konstantin Osipov <kostja@tarantool.org>
Cc: vdavydov.dev@gmail.com
Subject: Re: [tarantool-patches] Re: [PATCH v3 5/6] [RAW] swim: send one UDP packet per EV_WRITE event
Date: Tue, 15 Jan 2019 17:42:11 +0300	[thread overview]
Message-ID: <7ec57f09-997d-c0bd-929f-72307a0ea136@tarantool.org> (raw)
In-Reply-To: <20190109135344.GF20509@chai>



On 09/01/2019 16:53, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [18/12/29 15:07]:
>> Since the first commit of #3234, where anti-entropy component was
>> introduced, a single SWIM message could be split into multiple
>> UDP packets. But so far these packets were being sent in mere
>> 'for' loop on a single EV_WRITE event. It is not proper way of
>> using event loop, but the simplest, because does not require any
>> externally stored positions in packet lists.
>>
>> The previous commit introduced such global list of UDP packets to
>> send, and now it is much simpler to send each packet on separate
>> EV_WRITE event. This commit does it.
>>
> 
> Looks like this commit breaks encapsulation of the transport
> layer.

It does not. In fact, this commit does not change protocol code
at all and affects only swim_io.c/.h. I think, this is a prove that
it does not break encapsulation, doesn't it?

> 
> One thing, is that we should not have tasks which require sending
> multiple packets.

Multipacket is required since it is hard to fit many events,
failure detection and anti-entropy components, especially with payloads,
into a single 1.5Kb packet.

> 
> Another is that the packet concept is part of the transport and
> should not leak into the protocol itself.
> 
> 

As I understood from our verbal conversation, you mistakenly think
that packets are dependent on each other, and multi-packet here works
like a weird TCP, with splitting message into packets and concatenating
them back on receiver side, but it is wrong. Each packet is
self-sufficient piece of data, which is processed independently from
other packets. Each packet carries all necessary headers and a chunk of
events, anti-entropy records etc. Multi-packet here is in fact
multi-message already. Loss of some packets does not affect processing
of other ones.

struct swim_msg encapsulates multi-packet UDP encoding, while struct
swim_task encapsulates multi-packet sending. This is why this commit
so easily changes multi-packet sending from one EV_WRITE to multiple
EV_WRITE - one per each packet.

For protocol, swim.c, struct swim_msg looks like a one big packet,
while swim_io.c is able to send swim_msg in multiple independent
packets which should not be concatenated on receiver side.

Receiver reads packets, struct swim_packet. Not the entire struct
swim_msg. And processes the packets one by one.

  reply	other threads:[~2019-01-15 14:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 10:14 [PATCH v3 0/6] SWIM draft Vladislav Shpilevoy
2018-12-29 10:14 ` [PATCH v3 1/6] [RAW] swim: introduce SWIM's anti-entropy component Vladislav Shpilevoy
2019-01-09  9:12   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:42     ` [tarantool-patches] " Vladislav Shpilevoy
2019-01-09 11:45   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:42     ` [tarantool-patches] " Vladislav Shpilevoy
2018-12-29 10:14 ` [PATCH v3 2/6] [RAW] swim: introduce failure detection component Vladislav Shpilevoy
2019-01-09 13:48   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:42     ` [tarantool-patches] " Vladislav Shpilevoy
2018-12-29 10:14 ` [PATCH v3 3/6] [RAW] swim: introduce a dissemination component Vladislav Shpilevoy
2018-12-29 10:14 ` [PATCH v3 4/6] [RAW] swim: keep encoded round message cached Vladislav Shpilevoy
2018-12-29 10:14 ` [PATCH v3 5/6] [RAW] swim: send one UDP packet per EV_WRITE event Vladislav Shpilevoy
2019-01-09 13:53   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:42     ` Vladislav Shpilevoy [this message]
2018-12-29 10:14 ` [PATCH v3 6/6] [RAW] swim: introduce payload Vladislav Shpilevoy
2019-01-09 13:58   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:42     ` [tarantool-patches] " Vladislav Shpilevoy

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=7ec57f09-997d-c0bd-929f-72307a0ea136@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] Re: [PATCH v3 5/6] [RAW] swim: send one UDP packet per EV_WRITE event' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox