Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v2 1/2] swim: disseminate event for log(cluster_size) steps
Date: Thu, 4 Jul 2019 01:30:51 +0200	[thread overview]
Message-ID: <66e2eca5-882b-8479-50c1-ea6cd148afdb@tarantool.org> (raw)
In-Reply-To: <20190703190645.GB17318@atlas>

Hi! Thanks for the review!

>> diff --git a/src/lib/swim/swim.c b/src/lib/swim/swim.c
>> index bb9e9f519..9647094f5 100644
>> --- a/src/lib/swim/swim.c
>> +++ b/src/lib/swim/swim.c
>> @@ -616,7 +616,24 @@ swim_register_event(struct swim *swim, struct swim_member *member)
>>  		rlist_add_tail_entry(&swim->dissemination_queue, member,
>>  				     in_dissemination_queue);
>>  	}
>> -	member->status_ttd = mh_size(swim->members);
>> +	/*
>> +	 * Logarithm is a perfect number of disseminations of an
>> +	 * event.
>> +	 *
>> +	 * Firstly, it matches the dissemination speed.
>> +	 *
>> +	 * Secondly, bigger number of disseminations (for example,
>> +	 * linear) causes events and anti-entropy starvation in
>> +	 * big clusters, when lots of events occupy the whole UDP
>> +	 * packet, and factually the same packet content is being
>> +	 * sent for quite a long time. No randomness. Anti-entropy
>> +	 * does not get a chance to disseminate something new and
>> +	 * random. Bigger orders are redundant and harmful.
>> +	 *
>> +	 * Thirdly, logarithm is proved by the original
>> +	 * SWIM paper as the best option.
>> +	 */
>> +	member->status_ttd = ceil(log2(mh_size(swim->members)));

I've changed this place to

    member->status_ttd = ceil(log2(mh_size(swim->members))) + 1;

It allows to do not break the tests in this commit, and fixes a bug,
when status_ttd became negative for 'self'. Because ceil(log2(1)) = 0,
and on a next round step it became -1, -2, etc.

I didn't push the patch yet, if you have anything against that.

  reply	other threads:[~2019-07-03 23:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-30 20:01 [tarantool-patches] [PATCH v2 0/2] SWIM log TTD, and suspicious anti-entropy Vladislav Shpilevoy
2019-06-30 20:01 ` [tarantool-patches] [PATCH v2 1/2] swim: disseminate event for log(cluster_size) steps Vladislav Shpilevoy
2019-07-03 19:06   ` [tarantool-patches] " Konstantin Osipov
2019-07-03 23:30     ` Vladislav Shpilevoy [this message]
2019-07-04  8:10       ` Konstantin Osipov
2019-06-30 20:01 ` [tarantool-patches] [PATCH v2 2/2] swim: be suspicious when add new member Vladislav Shpilevoy
2019-07-03 19:07   ` [tarantool-patches] " Konstantin Osipov
2019-07-03 23:32     ` Vladislav Shpilevoy
2019-07-04  8:10       ` Konstantin Osipov
2019-07-05 22:45 ` [tarantool-patches] Re: [PATCH v2 0/2] SWIM log TTD, and suspicious anti-entropy 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=66e2eca5-882b-8479-50c1-ea6cd148afdb@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 1/2] swim: disseminate event for log(cluster_size) steps' \
    /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