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 3D0AE6EC55; Mon, 19 Jul 2021 12:12:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3D0AE6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626685971; bh=Gu+Jkzuh/NIqcz1vjTHXMQC5LmPI5FNT5C84ANq3YCI=; 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=nO4TrrenxNj4S0W3qBl3ABOxU26klhMC0b4s/RwdrDqcBDnAlwEk/QOxwxPvgkP5S uot6fZghGNYQYkk3pCYtwBV7A6381C5otmGyYSAxu6I+LE4ylpVDargaXFE6AcWodG pxZhrA8W6ret+ij3ySwM6XsMXgk5lIBjydtTBzCc= Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 2EEF46EC55 for ; Mon, 19 Jul 2021 12:12:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2EEF46EC55 Received: by mail-lj1-f179.google.com with SMTP id e14so6808232ljo.7 for ; Mon, 19 Jul 2021 02:12:50 -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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Uz50NDVOSOLSnYq8ceSXOnpKGVVuhGkWPUDZ3vvl+js=; b=go6qWtIt69ryKmaDV4TpEAoU+r+GrUhoXFyQjdl/bCjaB1JMd3LWjnShL4EoTJ1V5w IYRjoMiJqR76RlNRsWNxuDqoVfYxrFgAQ8rKo87KYfvzC3z4RxOGbLpNDvlpHqHVOIjv 9yfYbo/KL54Tna7kJ9qKG8Zygqtbpeps1JldvCSS+a0E4AW0qgnRBqQ3yu7+9iZy3JFK YmYN2nNyK42AIgwvajgEtRvQb0TeOqHe8wdk/PqeqJNEh4MyAZWg/mhnXfZ4v2VI+NwI tWdMHRYt4wJXRd5Ch8Fnb48uAF0h2f6bi1NEfTU+6tCkUFbfmJNN58NsjcGVjjxwQwDR SUnw== X-Gm-Message-State: AOAM531bcbUnC5rzBdhtMlkHftmLBnp3MhvdnTL3vlMXa863QxAQctsT 1UFsk9mMlYsUJBcROEZuSx7p5oaRTA== X-Google-Smtp-Source: ABdhPJyaTnttah/xj2UGLQjrhMua7TLSVp9f0BzHFdDMMmJcyZYkLbUrMY5c8Ig0+vc8tBucNRE3Lw== X-Received: by 2002:a2e:505b:: with SMTP id v27mr4507087ljd.177.1626685969478; Mon, 19 Jul 2021 02:12:49 -0700 (PDT) Received: from sterling.local ([46.188.68.12]) by smtp.gmail.com with ESMTPSA id s16sm2030006lji.131.2021.07.19.02.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 02:12:48 -0700 (PDT) Received: by sterling.local (Postfix, from userid 1000) id 07597E6386C; Mon, 19 Jul 2021 12:12:48 +0300 (MSK) Date: Mon, 19 Jul 2021 12:12:48 +0300 To: Vladislav Shpilevoy Message-ID: <20210719091248.GA4257@starling> Mail-Followup-To: Konstantin Osipov , Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, sergepetrenko@tarantool.org References: <0c92a88ff1d392f8b03de59be8cb19a162bf78f8.1626392372.git.v.shpilevoy@tarantool.org> <20210716142959.GC146960@starling> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Konstantin Osipov via Tarantool-patches Reply-To: Konstantin Osipov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" * Vladislav Shpilevoy [21/07/18 20:03]: > >> The new field during bootstrap will help to avoid selecting a > >> 'voter' as a master. Voters can't write, they are unable to boot > >> themselves nor register others. > >> > >> @TarantoolBot document > >> Title: New field - IPROTO_BALLOT_CAN_BE_LEADER > >> It is sent as a part of `IPROTO_BALLOT (0x29)`. The field is a > >> boolean flag which is true if the sender has `election_mode` in > >> its config `'manual'` or `'candidate'`. > >> > >> During bootstrap the nodes able to become a leader are preferred > >> over the nodes configured as `'voter'`. > > > > Curious why did you add this feature in the first place, I mean > > "eligibility"? Each voter has to be able to become a leader, > > otherwise raft liveness guarantees are violated. Raft has > > learners, but learners neither vote nor can become leaders. > > Voters are nodes which an admin does not want to be a leader. For > instance, they are too far away physically. As voters, they might > help to elect a leader, for example, if there are just 3 nodes one > of which is a voter. > > Another application is when you specifically start 1 node as a > voter and 2 candidates. The voter might skip all the replication > data and work on a slow small machine. > > It can help to form a majority. We are planning to make this > feature even easier to use by adding dataless nodes just for > voting. > > As for Raft, it should not bring any problems. In Raft you can > say that all nodes are candidates, but some of them are so slow, > that they can never vote for themselves in time. Raft still works, > and you essentially have 'voters'. Imagine there are nodes A, B, C, D, E. A is a leader, E is a voter which can not become a leader. Imagine A's log index is 5, B = 4, C = 3, D = 2, E = 5. The majority's log index is 4, so entry 4 is committed. A dies, B is partitioned away. The cluster is stuck, because neither C nor B can get a quorum (3 votes). Worse yet, if E's (voter) commit index is low, not high, it can vote for a node which doesn't have a committed entry. In that case you can lose a committed entry. -- Konstantin Osipov, Moscow, Russia