You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@helix.apache.org by Tong Wei <to...@gmail.com> on 2015/06/11 23:42:07 UTC

Change current state of replicas

Hi Kishore,
In our case, each node has multiple disks. We need to maintain a topology of the cluster (nodes, disks in a node, replica to disk mapping). Now, when a disk of a node goes down (detected by a thread in participant), I change the current state of replicas on that disk from ONLINE to OFFLINE, and then update the topology(delete disk) in the onExternViewChangeEvent().
Another questions is that how to manually update the ideal state when those replicas/disks are unavailable.
Thanks,
Tong        
------------------------------------------
Hi Tong,

Were the replicas on a participant deleted manually?. Generally deletion of
replicas are controlled through changes in ideal state. Deleting
replica->server mapping in idealstate will trigger state transitions such
as online-> offline and then offline->dropped.

Can you provide additional info on how you got into this state.

thanks,
Kishore G

On Wed, Jun 10, 2015 at 11:12 AM, Tong Wei <to...@gmail.com> wrote:

> How can I change the current state of a participant manually? For example,
> if some replicas on a participant are deleted, do we need to manually
> change the state of the replicas from ONLINE to OFFLINE?


Re: Change current state of replicas

Posted by kishore g <g....@gmail.com>.
What is the ideal state mode (CUSTOM, AUTO, SEMI_AUTO), you can get this by
reading the idealstate. Changing the current state is not recommended. You
can disable the partition on that participant using the below api in
HelixAdmin.

abstract voidenablePartition
<http://helix.apache.org/apidocs/reference/org/apache/helix/HelixAdmin.html#enablePartition(boolean,
java.lang.String, java.lang.String, java.lang.String,
java.util.List<java.lang.String>)>(boolean enabled, String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>
 clusterName, String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>
 instanceName, String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>
 resourceName, List
<http://download.oracle.com/javase/6/docs/api/index.html?java/util/List.html>
<String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>>
partitionNames)
Disable or enable a list of partitions on an instance

On Thu, Jun 11, 2015 at 2:42 PM, Tong Wei <to...@gmail.com> wrote:

> Hi Kishore,
>
> In our case, each node has multiple disks. We need to maintain a topology of the cluster (nodes, disks in a node, replica to disk mapping). Now, when a disk of a node goes down (detected by a thread in participant), I change the current state of replicas on that disk from ONLINE to OFFLINE, and then update the topology(delete disk) in the onExternViewChangeEvent().
>
> Another questions is that how to manually update the ideal state when those replicas/disks are unavailable.
>
> Thanks,
>
> Tong
>
> ------------------------------------------
>
> Hi Tong,
>
> Were the replicas on a participant deleted manually?. Generally deletion of
> replicas are controlled through changes in ideal state. Deleting
> replica->server mapping in idealstate will trigger state transitions such
> as online-> offline and then offline->dropped.
>
> Can you provide additional info on how you got into this state.
>
> thanks,
> Kishore G
>
> On Wed, Jun 10, 2015 at 11:12 AM, Tong Wei <to...@gmail.com> wrote:
>
> > How can I change the current state of a participant manually? For example,
> > if some replicas on a participant are deleted, do we need to manually
> > change the state of the replicas from ONLINE to OFFLINE?
>
>
>