You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ratis.apache.org by Asad Awadia <as...@gmail.com> on 2021/11/17 21:49:04 UTC

Replication factor

Apache Ratis - In Search of a Usable Raft Library
<https://www.slideshare.net/TszWoNicholasSze/apache-ratis-in-search-of-a-usable-raft-library>
slide 9/23 it talks about membership changes and replication factor.

How is the replication factor configured? I don't see any functions or
mention of that? Only on the watch rpc.

Is replication factor how many servers should keep a copy of the data? Is
my understanding correct? Or is this something completely different?

Thank you for all the work! I am really looking forward to using this
project.

Regards,
Asad

Re: Replication factor

Posted by Asad Awadia <as...@gmail.com>.
Got it! Thanks!

(Made another thread about sharding)

Regards,
Asad
________________________________
From: Tsz Wo Sze <sz...@gmail.com>
Sent: Thursday, November 18, 2021 8:31:12 PM
To: user@ratis.apache.org <us...@ratis.apache.org>
Subject: Re: Replication factor

Yes.  A new server will load the latest snapshot and the logs.  It will then talk to the leader in order to catch up the remaining logs.  Of course, we have to set up the configuration and start the server manually.
Tsz-Wo

On Fri, Nov 19, 2021 at 1:13 AM Asad Awadia <as...@gmail.com>> wrote:
Ok ok yes that makes sense.

One more thing around adding servers


1. When adding a new server - what is the process? Will it load the state snapshot and start iterating over the log automatically? Anything manually required?

Thanks for all the help!

Asad

________________________________
From: Tsz Wo Sze <sz...@gmail.com>>
Sent: Thursday, November 18, 2021 10:12:48 AM
To: user@ratis.apache.org<ma...@ratis.apache.org> <us...@ratis.apache.org>>
Subject: Re: Replication factor

1. Yes.  In Ratis, we have a BlockingApi and an AsyncApi; see https://github.com/apache/ratis/blob/master/ratis-client/src/main/java/org/apache/ratis/client/api/ .  The send(Message message) method is for "write".  The client will get a succeeded reply only after the message has been replicated to a majority of servers and has been committed by the leader.

2. Yes and yes.  The sendReadOnly(Message message) method is for "read".  It will read from the leader so that we have strong consistency.

Thanks for your questions.
Tsz-Wo


On Thu, Nov 18, 2021 at 7:48 PM Asad Awadia <as...@gmail.com>> wrote:
Thanks,  yes that helps.

Few more questions around read/write semantics:

1. Writes are acknowledged to the client when committed to majority?

2. Are reads via the query method strongly consistent? Do they get routed to the leader transparently?

Regards,
Asad
________________________________
From: Tsz Wo Sze <sz...@gmail.com>>
Sent: Wednesday, November 17, 2021, 7:18 p.m.
To: user@ratis.apache.org<ma...@ratis.apache.org>
Subject: Re: Replication factor

Hi Asad,

Yes, you are right.  Replication factor is the same as the number of members (servers) in a Raft group since each member has a copy of the states.  To change the replication factor, change the number of the members.

Hope it helps.
Tsz-Wo


On Thu, Nov 18, 2021 at 5:49 AM Asad Awadia <as...@gmail.com>> wrote:
Apache Ratis - In Search of a Usable Raft Library<https://www.slideshare.net/TszWoNicholasSze/apache-ratis-in-search-of-a-usable-raft-library> slide 9/23 it talks about membership changes and replication factor.

How is the replication factor configured? I don't see any functions or mention of that? Only on the watch rpc.

Is replication factor how many servers should keep a copy of the data? Is my understanding correct? Or is this something completely different?

Thank you for all the work! I am really looking forward to using this project.

Regards,
Asad


Re: Replication factor

Posted by Tsz Wo Sze <sz...@gmail.com>.
Yes.  A new server will load the latest snapshot and the logs.  It will
then talk to the leader in order to catch up the remaining logs.  Of
course, we have to set up the configuration and start the server manually.
Tsz-Wo

On Fri, Nov 19, 2021 at 1:13 AM Asad Awadia <as...@gmail.com> wrote:

> Ok ok yes that makes sense.
>
> One more thing around adding servers
>
>
> 1. When adding a new server - what is the process? Will it load the state
> snapshot and start iterating over the log automatically? Anything manually
> required?
>
> Thanks for all the help!
>
> Asad
>
> ------------------------------
> *From:* Tsz Wo Sze <sz...@gmail.com>
> *Sent:* Thursday, November 18, 2021 10:12:48 AM
> *To:* user@ratis.apache.org <us...@ratis.apache.org>
> *Subject:* Re: Replication factor
>
> 1. Yes.  In Ratis, we have a BlockingApi and an AsyncApi; see
> https://github.com/apache/ratis/blob/master/ratis-client/src/main/java/org/apache/ratis/client/api/
> .  The send(Message message) method is for "write".  The client will get a
> succeeded reply only after the message has been replicated to a majority of
> servers and has been committed by the leader.
>
> 2. Yes and yes.  The sendReadOnly(Message message) method is for "read".
> It will read from the leader so that we have strong consistency.
>
> Thanks for your questions.
> Tsz-Wo
>
>
> On Thu, Nov 18, 2021 at 7:48 PM Asad Awadia <as...@gmail.com> wrote:
>
> Thanks,  yes that helps.
>
> Few more questions around read/write semantics:
>
> 1. Writes are acknowledged to the client when committed to majority?
>
> 2. Are reads via the query method strongly consistent? Do they get routed
> to the leader transparently?
>
> Regards,
> Asad
> ------------------------------
> *From:* Tsz Wo Sze <sz...@gmail.com>
> *Sent:* Wednesday, November 17, 2021, 7:18 p.m.
> *To:* user@ratis.apache.org
> *Subject:* Re: Replication factor
>
> Hi Asad,
>
> Yes, you are right.  Replication factor is the same as the number of
> members (servers) in a Raft group since each member has a copy of the
> states.  To change the replication factor, change the number of the members.
>
> Hope it helps.
> Tsz-Wo
>
>
> On Thu, Nov 18, 2021 at 5:49 AM Asad Awadia <as...@gmail.com> wrote:
>
> Apache Ratis - In Search of a Usable Raft Library
> <https://www.slideshare.net/TszWoNicholasSze/apache-ratis-in-search-of-a-usable-raft-library>
> slide 9/23 it talks about membership changes and replication factor.
>
> How is the replication factor configured? I don't see any functions or
> mention of that? Only on the watch rpc.
>
> Is replication factor how many servers should keep a copy of the data? Is
> my understanding correct? Or is this something completely different?
>
> Thank you for all the work! I am really looking forward to using this
> project.
>
> Regards,
> Asad
>
>
>

Re: Replication factor

Posted by Asad Awadia <as...@gmail.com>.
Ok ok yes that makes sense.

One more thing around adding servers


1. When adding a new server - what is the process? Will it load the state snapshot and start iterating over the log automatically? Anything manually required?

Thanks for all the help!

Asad

________________________________
From: Tsz Wo Sze <sz...@gmail.com>
Sent: Thursday, November 18, 2021 10:12:48 AM
To: user@ratis.apache.org <us...@ratis.apache.org>
Subject: Re: Replication factor

1. Yes.  In Ratis, we have a BlockingApi and an AsyncApi; see https://github.com/apache/ratis/blob/master/ratis-client/src/main/java/org/apache/ratis/client/api/ .  The send(Message message) method is for "write".  The client will get a succeeded reply only after the message has been replicated to a majority of servers and has been committed by the leader.

2. Yes and yes.  The sendReadOnly(Message message) method is for "read".  It will read from the leader so that we have strong consistency.

Thanks for your questions.
Tsz-Wo


On Thu, Nov 18, 2021 at 7:48 PM Asad Awadia <as...@gmail.com>> wrote:
Thanks,  yes that helps.

Few more questions around read/write semantics:

1. Writes are acknowledged to the client when committed to majority?

2. Are reads via the query method strongly consistent? Do they get routed to the leader transparently?

Regards,
Asad
________________________________
From: Tsz Wo Sze <sz...@gmail.com>>
Sent: Wednesday, November 17, 2021, 7:18 p.m.
To: user@ratis.apache.org<ma...@ratis.apache.org>
Subject: Re: Replication factor

Hi Asad,

Yes, you are right.  Replication factor is the same as the number of members (servers) in a Raft group since each member has a copy of the states.  To change the replication factor, change the number of the members.

Hope it helps.
Tsz-Wo


On Thu, Nov 18, 2021 at 5:49 AM Asad Awadia <as...@gmail.com>> wrote:
Apache Ratis - In Search of a Usable Raft Library<https://www.slideshare.net/TszWoNicholasSze/apache-ratis-in-search-of-a-usable-raft-library> slide 9/23 it talks about membership changes and replication factor.

How is the replication factor configured? I don't see any functions or mention of that? Only on the watch rpc.

Is replication factor how many servers should keep a copy of the data? Is my understanding correct? Or is this something completely different?

Thank you for all the work! I am really looking forward to using this project.

Regards,
Asad


Re: Replication factor

Posted by Tsz Wo Sze <sz...@gmail.com>.
1. Yes.  In Ratis, we have a BlockingApi and an AsyncApi; see
https://github.com/apache/ratis/blob/master/ratis-client/src/main/java/org/apache/ratis/client/api/
.  The send(Message message) method is for "write".  The client will get a
succeeded reply only after the message has been replicated to a majority of
servers and has been committed by the leader.

2. Yes and yes.  The sendReadOnly(Message message) method is for "read".
It will read from the leader so that we have strong consistency.

Thanks for your questions.
Tsz-Wo


On Thu, Nov 18, 2021 at 7:48 PM Asad Awadia <as...@gmail.com> wrote:

> Thanks,  yes that helps.
>
> Few more questions around read/write semantics:
>
> 1. Writes are acknowledged to the client when committed to majority?
>
> 2. Are reads via the query method strongly consistent? Do they get routed
> to the leader transparently?
>
> Regards,
> Asad
> ------------------------------
> *From:* Tsz Wo Sze <sz...@gmail.com>
> *Sent:* Wednesday, November 17, 2021, 7:18 p.m.
> *To:* user@ratis.apache.org
> *Subject:* Re: Replication factor
>
> Hi Asad,
>
> Yes, you are right.  Replication factor is the same as the number of
> members (servers) in a Raft group since each member has a copy of the
> states.  To change the replication factor, change the number of the members.
>
> Hope it helps.
> Tsz-Wo
>
>
> On Thu, Nov 18, 2021 at 5:49 AM Asad Awadia <as...@gmail.com> wrote:
>
>> Apache Ratis - In Search of a Usable Raft Library
>> <https://www.slideshare.net/TszWoNicholasSze/apache-ratis-in-search-of-a-usable-raft-library>
>> slide 9/23 it talks about membership changes and replication factor.
>>
>> How is the replication factor configured? I don't see any functions or
>> mention of that? Only on the watch rpc.
>>
>> Is replication factor how many servers should keep a copy of the data? Is
>> my understanding correct? Or is this something completely different?
>>
>> Thank you for all the work! I am really looking forward to using this
>> project.
>>
>> Regards,
>> Asad
>>
>
>

Re: Replication factor

Posted by Asad Awadia <as...@gmail.com>.
Thanks,  yes that helps.

Few more questions around read/write semantics:

1. Writes are acknowledged to the client when committed to majority?

2. Are reads via the query method strongly consistent? Do they get routed to the leader transparently?

Regards,
Asad
________________________________
From: Tsz Wo Sze <sz...@gmail.com>
Sent: Wednesday, November 17, 2021, 7:18 p.m.
To: user@ratis.apache.org
Subject: Re: Replication factor

Hi Asad,

Yes, you are right.  Replication factor is the same as the number of members (servers) in a Raft group since each member has a copy of the states.  To change the replication factor, change the number of the members.

Hope it helps.
Tsz-Wo


On Thu, Nov 18, 2021 at 5:49 AM Asad Awadia <as...@gmail.com>> wrote:
Apache Ratis - In Search of a Usable Raft Library<https://www.slideshare.net/TszWoNicholasSze/apache-ratis-in-search-of-a-usable-raft-library> slide 9/23 it talks about membership changes and replication factor.

How is the replication factor configured? I don't see any functions or mention of that? Only on the watch rpc.

Is replication factor how many servers should keep a copy of the data? Is my understanding correct? Or is this something completely different?

Thank you for all the work! I am really looking forward to using this project.

Regards,
Asad


Re: Replication factor

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

Yes, you are right.  Replication factor is the same as the number of
members (servers) in a Raft group since each member has a copy of the
states.  To change the replication factor, change the number of the members.

Hope it helps.
Tsz-Wo


On Thu, Nov 18, 2021 at 5:49 AM Asad Awadia <as...@gmail.com> wrote:

> Apache Ratis - In Search of a Usable Raft Library
> <https://www.slideshare.net/TszWoNicholasSze/apache-ratis-in-search-of-a-usable-raft-library>
> slide 9/23 it talks about membership changes and replication factor.
>
> How is the replication factor configured? I don't see any functions or
> mention of that? Only on the watch rpc.
>
> Is replication factor how many servers should keep a copy of the data? Is
> my understanding correct? Or is this something completely different?
>
> Thank you for all the work! I am really looking forward to using this
> project.
>
> Regards,
> Asad
>