You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by Rui Wang <am...@apache.org> on 2020/08/15 05:47:30 UTC

PAUSING and PAUSED states in LifeCycle

Hi community,

I am working on RATIS-624 and my thought was:

for pause request, transit state from RUNNING to PAUSED
for unpause request, transit state from PAUSED to RUNNING.

However, I found in Ratis LifeCyle, there are both PAUSING and PAUSED
states existing. My question is, is there any documentation on what should
happen between RUNNING and PAUSING, PAUSING and PAUSED? (is this in the
raft paper some where?) What was the design intention to introduce a
PAUSING state?


After some thinking, I am guessing PAUSING is useful for async calls. E.g.
client send a pause request, state transits to PAUSING and return
immediately. The client will keep checking until the server becomes PAUSED
to do next steps. Is this correct?

-Rui

Re: PAUSING and PAUSED states in LifeCycle

Posted by Rui Wang <am...@apache.org>.
Thanks Tsz-Wo for the confirmation! It does make sense to me.

Then at least it means a pause request will transite state from RUNNING to
PAUSING. I will implement based on this idea.


-Rui

On Wed, Aug 19, 2020 at 10:22 PM Tsz Wo Sze <sz...@gmail.com> wrote:

> Hi Rui,
>
> In many applications, it is impossible to transit immediately from running
> to paused since it takes time to "pause".  For example, a file is being
> written, it takes time to flush the buffer (or even close the file) so that
> the server is in a consistent state.  Therefore, we need the pausing
> state.  In the pausing state, the server probably would finish the current
> operations but won't start new operations.
>
> Hope it helps.
> Tsz-Wo
>
> On Wed, Aug 19, 2020 at 9:38 PM Rui Wang <ru...@google.com.invalid>
> wrote:
>
> > Friendly ping to raise attention: is there anyone how know the context
> > about PAUSING and PAUSED states?
> >
> >
> > -Rui
> >
> > On Fri, Aug 14, 2020 at 10:47 PM Rui Wang <am...@apache.org> wrote:
> >
> > > Hi community,
> > >
> > > I am working on RATIS-624 and my thought was:
> > >
> > > for pause request, transit state from RUNNING to PAUSED
> > > for unpause request, transit state from PAUSED to RUNNING.
> > >
> > > However, I found in Ratis LifeCyle, there are both PAUSING and PAUSED
> > > states existing. My question is, is there any documentation on what
> > should
> > > happen between RUNNING and PAUSING, PAUSING and PAUSED? (is this in the
> > > raft paper some where?) What was the design intention to introduce a
> > > PAUSING state?
> > >
> > >
> > > After some thinking, I am guessing PAUSING is useful for async calls.
> > E.g.
> > > client send a pause request, state transits to PAUSING and return
> > > immediately. The client will keep checking until the server becomes
> > PAUSED
> > > to do next steps. Is this correct?
> > >
> > > -Rui
> > >
> >
>

Re: PAUSING and PAUSED states in LifeCycle

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

In many applications, it is impossible to transit immediately from running
to paused since it takes time to "pause".  For example, a file is being
written, it takes time to flush the buffer (or even close the file) so that
the server is in a consistent state.  Therefore, we need the pausing
state.  In the pausing state, the server probably would finish the current
operations but won't start new operations.

Hope it helps.
Tsz-Wo

On Wed, Aug 19, 2020 at 9:38 PM Rui Wang <ru...@google.com.invalid> wrote:

> Friendly ping to raise attention: is there anyone how know the context
> about PAUSING and PAUSED states?
>
>
> -Rui
>
> On Fri, Aug 14, 2020 at 10:47 PM Rui Wang <am...@apache.org> wrote:
>
> > Hi community,
> >
> > I am working on RATIS-624 and my thought was:
> >
> > for pause request, transit state from RUNNING to PAUSED
> > for unpause request, transit state from PAUSED to RUNNING.
> >
> > However, I found in Ratis LifeCyle, there are both PAUSING and PAUSED
> > states existing. My question is, is there any documentation on what
> should
> > happen between RUNNING and PAUSING, PAUSING and PAUSED? (is this in the
> > raft paper some where?) What was the design intention to introduce a
> > PAUSING state?
> >
> >
> > After some thinking, I am guessing PAUSING is useful for async calls.
> E.g.
> > client send a pause request, state transits to PAUSING and return
> > immediately. The client will keep checking until the server becomes
> PAUSED
> > to do next steps. Is this correct?
> >
> > -Rui
> >
>

Re: PAUSING and PAUSED states in LifeCycle

Posted by Rui Wang <ru...@google.com.INVALID>.
Friendly ping to raise attention: is there anyone how know the context
about PAUSING and PAUSED states?


-Rui

On Fri, Aug 14, 2020 at 10:47 PM Rui Wang <am...@apache.org> wrote:

> Hi community,
>
> I am working on RATIS-624 and my thought was:
>
> for pause request, transit state from RUNNING to PAUSED
> for unpause request, transit state from PAUSED to RUNNING.
>
> However, I found in Ratis LifeCyle, there are both PAUSING and PAUSED
> states existing. My question is, is there any documentation on what should
> happen between RUNNING and PAUSING, PAUSING and PAUSED? (is this in the
> raft paper some where?) What was the design intention to introduce a
> PAUSING state?
>
>
> After some thinking, I am guessing PAUSING is useful for async calls. E.g.
> client send a pause request, state transits to PAUSING and return
> immediately. The client will keep checking until the server becomes PAUSED
> to do next steps. Is this correct?
>
> -Rui
>