You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ratis.apache.org by Xinyu Tan <tx...@gmail.com> on 2022/04/11 02:15:55 UTC

A problem about Ratis's transferLeader interface

Hi, Ratis folks

I'm a developer from Apache IoTDB. I would like to ask how Ratis's
transferLeader interface should be used.

I found that if I did not adjust the Priority of any replica, any
transferLeader calls would be rejected by the isHighestPriority function.
This makes us need to setConfiguration before and after the
transferLeader to adjust and restore the Priority of the corresponding
node, which is very troublesome.

I want to confirm that I am using this interface correctly. Is there any
other way to use this interface?

Thanks!

Xinyu Tan

Re: A problem about Ratis's transferLeader interface

Posted by Tsz Wo Sze <sz...@gmail.com>.
In this case, both servers should be set to the highest priority.
The priority feature indeed is to prevent some servers from becoming the
leader.  If all servers can possibly be the leader, we may just use the
default priority so that all servers have the same priority.

Tsz-Wo


On Mon, Apr 11, 2022 at 9:36 PM Xinyu Tan <tx...@gmail.com> wrote:

> > if the new leader does not have the highest priority, it will yield the
> leadership to a highest priority server soon after it becomes the leader.
>
> Hi,
>
> Thank you for your reply.
>
> I have another question for your answer: If the leader has been
> successfully transferred, do I need to adjust the priority back? If not,
> what should I do next time to transfer the leader? Do I need to continue to
> increase priority? If I transfer the leader N times, does this indicate
> that there is a node whose priority is greater than N?
>
> Xinyu Tan
>
> 在 2022年4月11日,下午8:18,Tsz Wo Sze <sz...@gmail.com> 写道:
>
> Hi Xinyu,
>
> The new leader must be one of the servers having the highest priority.
> Otherwise, if the new leader does not have the highest priority, it will
> yield the leadership to a highest priority server soon after it becomes the
> leader.
>
> If the target server does not have the highest priority, you are right
> that we need to setConfiguration in order to change the priority.
>
> Hope it helps.
> Tsz-Wo
>
> On Mon, Apr 11, 2022 at 10:16 AM Xinyu Tan <tx...@gmail.com> wrote:
>
>> Hi, Ratis folks
>>
>> I'm a developer from Apache IoTDB. I would like to ask how Ratis's
>> transferLeader interface should be used.
>>
>> I found that if I did not adjust the Priority of any replica, any
>> transferLeader calls would be rejected by the isHighestPriority function.
>> This makes us need to setConfiguration before and after the
>> transferLeader to adjust and restore the Priority of the corresponding
>> node, which is very troublesome.
>>
>> I want to confirm that I am using this interface correctly. Is there any
>> other way to use this interface?
>>
>> Thanks!
>>
>> Xinyu Tan
>>
>
>

Re: A problem about Ratis's transferLeader interface

Posted by Xinyu Tan <tx...@gmail.com>.
> if the new leader does not have the highest priority, it will yield the leadership to a highest priority server soon after it becomes the leader.

Hi, 

Thank you for your reply.

I have another question for your answer: If the leader has been successfully transferred, do I need to adjust the priority back? If not, what should I do next time to transfer the leader? Do I need to continue to increase priority? If I transfer the leader N times, does this indicate that there is a node whose priority is greater than N?

Xinyu Tan

> 在 2022年4月11日,下午8:18,Tsz Wo Sze <sz...@gmail.com> 写道:
> 
> Hi Xinyu,
> 
> The new leader must be one of the servers having the highest priority.  Otherwise, if the new leader does not have the highest priority, it will yield the leadership to a highest priority server soon after it becomes the leader.
> 
> If the target server does not have the highest priority, you are right that we need to setConfiguration in order to change the priority.
> 
> Hope it helps.
> Tsz-Wo
> 
> On Mon, Apr 11, 2022 at 10:16 AM Xinyu Tan <txypotato@gmail.com <ma...@gmail.com>> wrote:
> Hi, Ratis folks 
> 
> I'm a developer from Apache IoTDB. I would like to ask how Ratis's transferLeader interface should be used.
> 
> I found that if I did not adjust the Priority of any replica, any transferLeader calls would be rejected by the isHighestPriority function. This makes us need to setConfiguration before and after the transferLeader to adjust and restore the Priority of the corresponding node, which is very troublesome.
> 
> I want to confirm that I am using this interface correctly. Is there any other way to use this interface?
> 
> Thanks!
> 
> Xinyu Tan


Re: A problem about Ratis's transferLeader interface

Posted by Tsz Wo Sze <sz...@gmail.com>.
Hi Xinyu,

The new leader must be one of the servers having the highest priority.
Otherwise, if the new leader does not have the highest priority, it will
yield the leadership to a highest priority server soon after it becomes the
leader.

If the target server does not have the highest priority, you are right that
we need to setConfiguration in order to change the priority.

Hope it helps.
Tsz-Wo

On Mon, Apr 11, 2022 at 10:16 AM Xinyu Tan <tx...@gmail.com> wrote:

> Hi, Ratis folks
>
> I'm a developer from Apache IoTDB. I would like to ask how Ratis's
> transferLeader interface should be used.
>
> I found that if I did not adjust the Priority of any replica, any
> transferLeader calls would be rejected by the isHighestPriority function.
> This makes us need to setConfiguration before and after the
> transferLeader to adjust and restore the Priority of the corresponding
> node, which is very troublesome.
>
> I want to confirm that I am using this interface correctly. Is there any
> other way to use this interface?
>
> Thanks!
>
> Xinyu Tan
>