You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@helix.apache.org by Santiago Perez <sa...@santip.com.ar> on 2013/11/04 22:14:14 UTC

Recommended approach to redefining state model

Hi,

I need to redefine a state model on a live cluster and would like to know
the recommended (safe) way to do so.

My current plan was to do the fololwing:

1) Stop all controllers
2) Remove the node from STATEMODELDEFS
3) Run code that will rewrite the state model
4) Start controllers again

I'm assuming that only controllers load the state models, but I may be
mistaken.

Please advice.

Thanks,
Santiago

Re: Recommended approach to redefining state model

Posted by Santiago Perez <sa...@santip.com.ar>.
Great, I've actually verified that for my case the approach worked as
expected.

Thanks,
Santi


On Mon, Nov 4, 2013 at 8:27 PM, Zhen Zhang <ne...@gmail.com> wrote:

> Hi Santi, as long as the new state model definition is compatible with the
> old one, your approach should be fine. I've added a test for this.
>
>
> On Mon, Nov 4, 2013 at 1:34 PM, Santiago Perez <sa...@santip.com.ar>
> wrote:
>
> > Participants are already running with code that supports new state
> > transitions.
> >
> > Also all states currently in CURRENT_STATES are in both models.
> >
> >
> > On Mon, Nov 4, 2013 at 6:29 PM, Shi Lu <lu...@gmail.com> wrote:
> >
> >> Hi Santi:
> >>
> >> For your updated statemodel, does it involve adding new state
> transitions?
> >>
> >> If yes then the helix participant will need to be updated as well, since
> >> they need to implement the new added state transitions. If not then the
> >> participant will not be able to process the updated state transition
> >> messages and most likely will go into error state.
> >>
> >>
> >>
> >>
> >> On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar>
> >> wrote:
> >>
> >> > Hi,
> >> >
> >> > I need to redefine a state model on a live cluster and would like to
> >> know
> >> > the recommended (safe) way to do so.
> >> >
> >> > My current plan was to do the fololwing:
> >> >
> >> > 1) Stop all controllers
> >> > 2) Remove the node from STATEMODELDEFS
> >> > 3) Run code that will rewrite the state model
> >> > 4) Start controllers again
> >> >
> >> > I'm assuming that only controllers load the state models, but I may be
> >> > mistaken.
> >> >
> >> > Please advice.
> >> >
> >> > Thanks,
> >> > Santiago
> >> >
> >>
> >
> >
>

Re: Recommended approach to redefining state model

Posted by Santiago Perez <sa...@santip.com.ar>.
Great, I've actually verified that for my case the approach worked as
expected.

Thanks,
Santi


On Mon, Nov 4, 2013 at 8:27 PM, Zhen Zhang <ne...@gmail.com> wrote:

> Hi Santi, as long as the new state model definition is compatible with the
> old one, your approach should be fine. I've added a test for this.
>
>
> On Mon, Nov 4, 2013 at 1:34 PM, Santiago Perez <sa...@santip.com.ar>
> wrote:
>
> > Participants are already running with code that supports new state
> > transitions.
> >
> > Also all states currently in CURRENT_STATES are in both models.
> >
> >
> > On Mon, Nov 4, 2013 at 6:29 PM, Shi Lu <lu...@gmail.com> wrote:
> >
> >> Hi Santi:
> >>
> >> For your updated statemodel, does it involve adding new state
> transitions?
> >>
> >> If yes then the helix participant will need to be updated as well, since
> >> they need to implement the new added state transitions. If not then the
> >> participant will not be able to process the updated state transition
> >> messages and most likely will go into error state.
> >>
> >>
> >>
> >>
> >> On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar>
> >> wrote:
> >>
> >> > Hi,
> >> >
> >> > I need to redefine a state model on a live cluster and would like to
> >> know
> >> > the recommended (safe) way to do so.
> >> >
> >> > My current plan was to do the fololwing:
> >> >
> >> > 1) Stop all controllers
> >> > 2) Remove the node from STATEMODELDEFS
> >> > 3) Run code that will rewrite the state model
> >> > 4) Start controllers again
> >> >
> >> > I'm assuming that only controllers load the state models, but I may be
> >> > mistaken.
> >> >
> >> > Please advice.
> >> >
> >> > Thanks,
> >> > Santiago
> >> >
> >>
> >
> >
>

Re: Recommended approach to redefining state model

Posted by Zhen Zhang <ne...@gmail.com>.
Hi Santi, as long as the new state model definition is compatible with the
old one, your approach should be fine. I've added a test for this.


On Mon, Nov 4, 2013 at 1:34 PM, Santiago Perez <sa...@santip.com.ar> wrote:

> Participants are already running with code that supports new state
> transitions.
>
> Also all states currently in CURRENT_STATES are in both models.
>
>
> On Mon, Nov 4, 2013 at 6:29 PM, Shi Lu <lu...@gmail.com> wrote:
>
>> Hi Santi:
>>
>> For your updated statemodel, does it involve adding new state transitions?
>>
>> If yes then the helix participant will need to be updated as well, since
>> they need to implement the new added state transitions. If not then the
>> participant will not be able to process the updated state transition
>> messages and most likely will go into error state.
>>
>>
>>
>>
>> On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar>
>> wrote:
>>
>> > Hi,
>> >
>> > I need to redefine a state model on a live cluster and would like to
>> know
>> > the recommended (safe) way to do so.
>> >
>> > My current plan was to do the fololwing:
>> >
>> > 1) Stop all controllers
>> > 2) Remove the node from STATEMODELDEFS
>> > 3) Run code that will rewrite the state model
>> > 4) Start controllers again
>> >
>> > I'm assuming that only controllers load the state models, but I may be
>> > mistaken.
>> >
>> > Please advice.
>> >
>> > Thanks,
>> > Santiago
>> >
>>
>
>

Re: Recommended approach to redefining state model

Posted by Zhen Zhang <ne...@gmail.com>.
Hi Santi, as long as the new state model definition is compatible with the
old one, your approach should be fine. I've added a test for this.


On Mon, Nov 4, 2013 at 1:34 PM, Santiago Perez <sa...@santip.com.ar> wrote:

> Participants are already running with code that supports new state
> transitions.
>
> Also all states currently in CURRENT_STATES are in both models.
>
>
> On Mon, Nov 4, 2013 at 6:29 PM, Shi Lu <lu...@gmail.com> wrote:
>
>> Hi Santi:
>>
>> For your updated statemodel, does it involve adding new state transitions?
>>
>> If yes then the helix participant will need to be updated as well, since
>> they need to implement the new added state transitions. If not then the
>> participant will not be able to process the updated state transition
>> messages and most likely will go into error state.
>>
>>
>>
>>
>> On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar>
>> wrote:
>>
>> > Hi,
>> >
>> > I need to redefine a state model on a live cluster and would like to
>> know
>> > the recommended (safe) way to do so.
>> >
>> > My current plan was to do the fololwing:
>> >
>> > 1) Stop all controllers
>> > 2) Remove the node from STATEMODELDEFS
>> > 3) Run code that will rewrite the state model
>> > 4) Start controllers again
>> >
>> > I'm assuming that only controllers load the state models, but I may be
>> > mistaken.
>> >
>> > Please advice.
>> >
>> > Thanks,
>> > Santiago
>> >
>>
>
>

Re: Recommended approach to redefining state model

Posted by Santiago Perez <sa...@santip.com.ar>.
Participants are already running with code that supports new state
transitions.

Also all states currently in CURRENT_STATES are in both models.


On Mon, Nov 4, 2013 at 6:29 PM, Shi Lu <lu...@gmail.com> wrote:

> Hi Santi:
>
> For your updated statemodel, does it involve adding new state transitions?
>
> If yes then the helix participant will need to be updated as well, since
> they need to implement the new added state transitions. If not then the
> participant will not be able to process the updated state transition
> messages and most likely will go into error state.
>
>
>
>
> On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar>
> wrote:
>
> > Hi,
> >
> > I need to redefine a state model on a live cluster and would like to know
> > the recommended (safe) way to do so.
> >
> > My current plan was to do the fololwing:
> >
> > 1) Stop all controllers
> > 2) Remove the node from STATEMODELDEFS
> > 3) Run code that will rewrite the state model
> > 4) Start controllers again
> >
> > I'm assuming that only controllers load the state models, but I may be
> > mistaken.
> >
> > Please advice.
> >
> > Thanks,
> > Santiago
> >
>

Re: Recommended approach to redefining state model

Posted by Santiago Perez <sa...@santip.com.ar>.
Participants are already running with code that supports new state
transitions.

Also all states currently in CURRENT_STATES are in both models.


On Mon, Nov 4, 2013 at 6:29 PM, Shi Lu <lu...@gmail.com> wrote:

> Hi Santi:
>
> For your updated statemodel, does it involve adding new state transitions?
>
> If yes then the helix participant will need to be updated as well, since
> they need to implement the new added state transitions. If not then the
> participant will not be able to process the updated state transition
> messages and most likely will go into error state.
>
>
>
>
> On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar>
> wrote:
>
> > Hi,
> >
> > I need to redefine a state model on a live cluster and would like to know
> > the recommended (safe) way to do so.
> >
> > My current plan was to do the fololwing:
> >
> > 1) Stop all controllers
> > 2) Remove the node from STATEMODELDEFS
> > 3) Run code that will rewrite the state model
> > 4) Start controllers again
> >
> > I'm assuming that only controllers load the state models, but I may be
> > mistaken.
> >
> > Please advice.
> >
> > Thanks,
> > Santiago
> >
>

Re: Recommended approach to redefining state model

Posted by Shi Lu <lu...@gmail.com>.
Hi Santi:

For your updated statemodel, does it involve adding new state transitions?

If yes then the helix participant will need to be updated as well, since
they need to implement the new added state transitions. If not then the
participant will not be able to process the updated state transition
messages and most likely will go into error state.




On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar> wrote:

> Hi,
>
> I need to redefine a state model on a live cluster and would like to know
> the recommended (safe) way to do so.
>
> My current plan was to do the fololwing:
>
> 1) Stop all controllers
> 2) Remove the node from STATEMODELDEFS
> 3) Run code that will rewrite the state model
> 4) Start controllers again
>
> I'm assuming that only controllers load the state models, but I may be
> mistaken.
>
> Please advice.
>
> Thanks,
> Santiago
>

Re: Recommended approach to redefining state model

Posted by Shi Lu <lu...@gmail.com>.
Hi Santi:

For your updated statemodel, does it involve adding new state transitions?

If yes then the helix participant will need to be updated as well, since
they need to implement the new added state transitions. If not then the
participant will not be able to process the updated state transition
messages and most likely will go into error state.




On Mon, Nov 4, 2013 at 1:14 PM, Santiago Perez <sa...@santip.com.ar> wrote:

> Hi,
>
> I need to redefine a state model on a live cluster and would like to know
> the recommended (safe) way to do so.
>
> My current plan was to do the fololwing:
>
> 1) Stop all controllers
> 2) Remove the node from STATEMODELDEFS
> 3) Run code that will rewrite the state model
> 4) Start controllers again
>
> I'm assuming that only controllers load the state models, but I may be
> mistaken.
>
> Please advice.
>
> Thanks,
> Santiago
>

Re: Recommended approach to redefining state model

Posted by Kanak Biscuitwala <kb...@linkedin.com>.
Hi Santiago,

You're correct in your assumption that only controllers directly read your state model, but I think you also need to be aware of your participants. I think in your case, the states in your new state model comprise a superset of the old one, so your approach should be fine (as long as there's a way for your current states to reach your new ones).

Ordinarily it's safer to first disable your instances (so that they go into the initial state) and then enable once the state model is updated (or even drop your instances and re-add them).

Kanak

From: Santiago Perez <sa...@santip.com.ar>>
Reply-To: "user@helix.incubator.apache.org<ma...@helix.incubator.apache.org>" <us...@helix.incubator.apache.org>>
Date: Monday, November 4, 2013 2:14 PM
To: "dev@helix.incubator.apache.org<ma...@helix.incubator.apache.org>" <de...@helix.incubator.apache.org>>, "user@helix.incubator.apache.org<ma...@helix.incubator.apache.org>" <us...@helix.incubator.apache.org>>
Subject: Recommended approach to redefining state model

Hi,

I need to redefine a state model on a live cluster and would like to know the recommended (safe) way to do so.

My current plan was to do the fololwing:

1) Stop all controllers
2) Remove the node from STATEMODELDEFS
3) Run code that will rewrite the state model
4) Start controllers again

I'm assuming that only controllers load the state models, but I may be mistaken.

Please advice.

Thanks,
Santiago

Re: Recommended approach to redefining state model

Posted by Kanak Biscuitwala <kb...@linkedin.com>.
Hi Santiago,

You're correct in your assumption that only controllers directly read your state model, but I think you also need to be aware of your participants. I think in your case, the states in your new state model comprise a superset of the old one, so your approach should be fine (as long as there's a way for your current states to reach your new ones).

Ordinarily it's safer to first disable your instances (so that they go into the initial state) and then enable once the state model is updated (or even drop your instances and re-add them).

Kanak

From: Santiago Perez <sa...@santip.com.ar>>
Reply-To: "user@helix.incubator.apache.org<ma...@helix.incubator.apache.org>" <us...@helix.incubator.apache.org>>
Date: Monday, November 4, 2013 2:14 PM
To: "dev@helix.incubator.apache.org<ma...@helix.incubator.apache.org>" <de...@helix.incubator.apache.org>>, "user@helix.incubator.apache.org<ma...@helix.incubator.apache.org>" <us...@helix.incubator.apache.org>>
Subject: Recommended approach to redefining state model

Hi,

I need to redefine a state model on a live cluster and would like to know the recommended (safe) way to do so.

My current plan was to do the fololwing:

1) Stop all controllers
2) Remove the node from STATEMODELDEFS
3) Run code that will rewrite the state model
4) Start controllers again

I'm assuming that only controllers load the state models, but I may be mistaken.

Please advice.

Thanks,
Santiago