[tarantool-patches] Re: [PATCH v2 1/2] swim: make incarnation struct

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Jun 23 20:54:00 MSK 2019



On 23/06/2019 10:31, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [19/06/23 09:42]:
>> Traditional SWIM describes member version as incarnation -
>> volatile monotonically growing number to refute false gossips.
>> But it is not enough in the real world because of necessity to
>> detect restarts and refute information from previous lifes of an
>> instance.
>>
>> Incarnation is going to be a two-part value with persistent upper
>> part and volatile lower part. This patch does preparations making
>> incarnation struct instead of a number.
> 
> LGTM.
> 
> BTW, why is incarnation = uint64max for a non-existent member?
> Wouldn't it be more logical to make it int64min instead?
> 

Incarnation is uint, so min value is 0. If you assign INT64_MIN to
incarnation, you will get the same UINT64_MAX because of cast to
uint.

Logic was to choose an unachievable value, it does not really
matter which one. In case of uint the most unlikely value is
UINT64_MAX.

Both patches are pushed to the master.




More information about the Tarantool-patches mailing list