Hi Jianqiu, In Helix we typically discourage participants from changing the states of partitions they serve because then we have multiple brains in the system.
It seems like the read property is a participant-level property rather than a partition-level state. Is this true? Can an instance have different speeds per partition on the same instance? If it is purely participant-level, then you can use HelixAdmin#setConfig to set this flag for the participant, and you can register an InstanceConfigChangeListener with HelixManager in order to listen for changes. It is certainly possible to use HelixDataAccessor#updateIdealState to only update the partitions that currently belong to an instance, but that feels more like a hack, and it requires you to fully customize the ideal state calculation logic, rather than using FULL_AUTO or SEMI_AUTO mode. Kanak ________________________________ > From: [email protected] > To: [email protected] > CC: [email protected] > Subject: question on a state change scenario > Date: Wed, 18 Jun 2014 02:05:00 +0000 > > Hi team, > First I want to thanks all for this great software. > I am using helix for our storage system. In our system we have 3 > states read , weak read and offline. The state transactions are > read-> <- weak read-> <-offline, very similar to the master/slave > example. But the difference is that we need participate to control its > status , which means a participate can decide what is itself's current > ideal state. If a participate find he can’t follow write speed(we use a > queue to do write , participate consumes message from this queue), then > it can change its state from read to weak read. Is there a proper way > to do this state change from participate side? I looked into Helix java > doc and found in HelixAdmin there is a method “rebalance” seems can > achieve my goal, but my scenario is only need to change one server’s > state,“rebalance” seems too over. Or does this a Helix fit scenario? > The other solution I thought about is using zookeeper to manage read > and weak read states, and helix only maintain the online offline state. > Once I get an online server from helix , then I will look up into > zookeeper to find out what is the current read state of this > server(maybe push mode from zookeeper is more proper). In this > solution we don’t need to change helix ideal state from participate > side, but this seems like mix helix and zookeeper to maintain state > machine together. Could you please give me some advise on my thoughts? > > Thanks > Jianqiu
