From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id B2EAF6EC55; Wed, 21 Jul 2021 21:51:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B2EAF6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626893471; bh=3+JEFQVdEMOJETW1t+89Up3vIo5M4TdtRlHjUq2uLMQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JcK0RXBYl1IqSP1phmxanOzC/UYFSwsOO9h6xmBMU7/YOsabyNPYKp4pCLV5erJyx Qg89VJMecYXUz1dhgKy7biDqMrLfY/3Ni9V5hQzck5F+Y/E1U0hCQB6hmfqSgOS2HW 0YuIYSaEke7szFyhHKQt7p620KtzXKYR6Xa0VNs0= Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EBBEC6EC55 for ; Wed, 21 Jul 2021 21:51:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EBBEC6EC55 Received: by mail-lj1-f170.google.com with SMTP id y25so3489078ljy.13 for ; Wed, 21 Jul 2021 11:51:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mqlX7cV4RlYW3e7jikzLChHWlPZqTlzxBPodvyD/6Oc=; b=CVVQ5V/uUGIHdDNi1Ar+CxwUdYShhgmuViXpk0Yy2ZlV2cTynqZXIfkBrpGPluY4Uf 3+D9dU1TZUwSQAHWXWB2Hux46D5p11OIFz8Rji8oallyHsCvK1sDYyEYDt2QUaFAz6mn GkQkaqL7mhaYO5SvFNRzNadjBOzM14Ag6cXHsijxOJDZGFUJCM4o37dA7SLWG+c5o+V/ xqxeHDssw9EqwYSwzAjluAL+yu0NlPlZHCeY33IjP96a89C5tBFnPnpDCfAXmzNBMyd9 JksRlwfORaY/L6McNY9FHu/7P2GL2Uo1bPWYV4tI2GqDHLHcS5ErN/5qqKt32ah4SDI8 NyDQ== X-Gm-Message-State: AOAM533O6s4+MTUeeAKd/nQNn72NUp7Fs7o1RO5ekEsq0Okr1aqU21Uz yXJYEUgoW5ix112LmDxpsXAyMm5ArYA= X-Google-Smtp-Source: ABdhPJw6kJ6nXkVpyUT/OUhHbG+2c3QXVChnWGCbePbq525rjMCRTKZgRCsniRiSZvMXnCbGsQSRsA== X-Received: by 2002:a05:651c:24a:: with SMTP id x10mr27805358ljn.235.1626893468733; Wed, 21 Jul 2021 11:51:08 -0700 (PDT) Received: from grain.localdomain ([5.18.255.97]) by smtp.gmail.com with ESMTPSA id u10sm2089465lju.48.2021.07.21.11.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 11:51:07 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id DA1A65A001E; Wed, 21 Jul 2021 21:51:06 +0300 (MSK) Date: Wed, 21 Jul 2021 21:51:06 +0300 To: Konstantin Osipov Message-ID: References: <0c92a88ff1d392f8b03de59be8cb19a162bf78f8.1626392372.git.v.shpilevoy@tarantool.org> <20210716142959.GC146960@starling> <20210719091248.GA4257@starling> <20210720232057.GA85781@starling> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210720232057.GA85781@starling> User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH 1/2] replication: introduce ballot.can_be_leader X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Wed, Jul 21, 2021 at 02:20:57AM +0300, Konstantin Osipov wrote: > > Right. That's what I am saying - the cluster is stuck even though > the quorum (3 nodes) is present. And this is not something > consistent, such clusters will get stuck simply based on the state > of the voter - sometimes they will, sometimes they won't. Which is exactly the same as it would be if node E is a follower but at the moment when it gonna be selected as a leader the network environment get broken (or enter a flip/flop cycle). In such case even traditional Raft nodes (ie those which doen't have "voters" at all) will behave the same way -- sometimes quorum will be achieved and sometimes not. Though I see what you mean, thanks! > > Lets assume the E's index is low, say 3 > > > > A B C D E > > {5, 4, 4, 3, 3} > > * * > > L F F F V > > > > in this config the leader won't commit record 5 until one > > of {C,D,E} write the new record(s) since otherwise the quorum > > won't be reached. Assume A and B get out of the set without > > record 4 written to C > > > > A B C D E > > {-, -, 4, 3, 3} > > F F V > > > > Now the node E can vote for C and D because its index is LE. > > And since C's index is bigger than others it will be elected > > next as far as I understand, no? > > You're right, assuming the voter never casts a vote for a > candidate with a shorter log the safety is not violated. I wasn't > sure it's the case, and presumed that the voter may have no log of > its own. But still there are issues with liveness. Raft PHD has > learners, so why not use them instead. Yeah, voters are to carry logs as well and it is their critical feature but idea about Raft learners might be even better, I think Vlad has some thoughts about learners.