Use setContfiguration to set the peer list to [B, C, D]. And then start server D with a peer list [B, C, D] and the same group id.
Tsz-Wo On Thu, Aug 4, 2022 at 9:31 AM Swapnil Tailor <[email protected]> wrote: > ok now if server A goes down and a new server D joins the raft server > peer, how can that update should happen so everyone (RaftServer and > RaftClient) is aware of the new peer? > > On Thu, Aug 4, 2022 at 9:28 AM Tsz Wo Sze <[email protected]> wrote: > >> > Yes they do have same group id. >> >> That is good. >> >> > ... Serve A could have peer list: [A, B], and Server B could have peer >> list: [B, C] ... >> >> In this case, all servers A, B and C must have the same peer list [A, B, >> C] when they start up. >> >> Tsz-Wo >> >> >> On Wed, Aug 3, 2022 at 10:10 PM Swapnil Tailor <[email protected]> >> wrote: >> >>> You can take a look at the code here: >>> https://github.com/prestodb/presto/pull/17915 >>> >>> On Wed, Aug 3, 2022 at 5:55 PM Swapnil Tailor <[email protected]> >>> wrote: >>> >>>> Yes they do have same group id. >>>> >>>> On Wed, Aug 3, 2022, 4:35 PM Tsz Wo Sze <[email protected]> wrote: >>>> >>>>> Hi Swapnil, >>>>> >>>>> We should use the same group configuration (i.e. the same set of >>>>> servers) to start up the servers. Otherwise, there is no way to compute >>>>> "majority" correctly. >>>>> >>>>> BTW, they should also have the same group id. Are they? >>>>> >>>>> Tsz-Wo >>>>> >>>>> >>>>> On Wed, Aug 3, 2022 at 1:54 PM Swapnil Tailor < >>>>> [email protected]> wrote: >>>>> >>>>>> Yes all the servers are having the same RaftGroup but the peer list >>>>>> could be different (i.e. Serve A could have peer list: [A, B], and >>>>>> Server B >>>>>> could have peer list: [B, C]). >>>>>> Reason they won't see all the servers up at the same time. And that's >>>>>> why we want to know if we can add the other peers in the raft group later >>>>>> after the server start up. And what is the right way of doing that. >>>>>> >>>>>> On Wed, Aug 3, 2022 at 1:44 PM Tsz Wo Sze <[email protected]> wrote: >>>>>> >>>>>>> Hi Swapnil, >>>>>>> >>>>>>> Thanks for trying Ratis! >>>>>>> >>>>>>> Are they starting with the same RaftGroup? All servers A, B and C >>>>>>> should have the same RaftGroup(A, B, C) when they start up. >>>>>>> >>>>>>> Tsz-Wo >>>>>>> >>>>>>> On Wed, Aug 3, 2022 at 1:32 PM Swapnil Tailor < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> We are trying to use ratis library to our existing Presto >>>>>>>> Distributed query engine. We are facing one issue while working on >>>>>>>> updating >>>>>>>> the peers in the cluster: >>>>>>>> >>>>>>>> Ratis Server runs on multiple resource managers, and it takes time >>>>>>>> for them to get up and join the cluster. So we require the Ratis >>>>>>>> server to >>>>>>>> have atleast 2 server before it starts the server. This works well. >>>>>>>> But the >>>>>>>> issue happens in the leader selection as mentioned below: >>>>>>>> 1. There are 3 ratis servers in the cluster, A, B, C >>>>>>>> 2. With server A seeing serve B, the minimum server count matches >>>>>>>> and it starts the server with peers list as A, B >>>>>>>> 3. Now when server C starts, we try to update the peer list using >>>>>>>> client api: >>>>>>>> RaftClient.admin().setContfiguration(updated peer list), but >>>>>>>> for some reason this is not working correctly and there are multiple >>>>>>>> leaders getting elected in the cluster. >>>>>>>> >>>>>>>> Can someone help understand how should we fix that? And also if the >>>>>>>> peer updation logic is correct by each server running RaftClient and >>>>>>>> update >>>>>>>> the configuration as and when it sees the peer list has changes (i.e. >>>>>>>> a new >>>>>>>> server joins the cluster/existing one dies/replaced). >>>>>>>> >>>>>>>> Also side question: Can someone invite me to the slack channel to >>>>>>>> be part of the community? >>>>>>>> >>>>>>>> Thanks in advance, >>>>>>>> Swapnil >>>>>>>> >>>>>>>
