From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id DB4042F996 for ; Sun, 23 Jun 2019 13:53:19 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KvzX8RZFqXO2 for ; Sun, 23 Jun 2019 13:53:19 -0400 (EDT) Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 38CA42F992 for ; Sun, 23 Jun 2019 13:53:19 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 1/2] swim: make incarnation struct References: <51c439eb0ff8bb7ff46306fde45b4d8f166f3fc5.1561238125.git.v.shpilevoy@tarantool.org> <20190623083156.GB7915@atlas> From: Vladislav Shpilevoy Message-ID: Date: Sun, 23 Jun 2019 19:54:00 +0200 MIME-Version: 1.0 In-Reply-To: <20190623083156.GB7915@atlas> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Konstantin Osipov Cc: tarantool-patches@freelists.org On 23/06/2019 10:31, Konstantin Osipov wrote: > * Vladislav Shpilevoy [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.