helix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kishore g <g.kish...@gmail.com>
Subject Re: how to monitor partition state change
Date Thu, 14 Apr 2016 18:04:47 GMT
Hi,

Yes, that is the expected behavior. If there are N changes to External
View, you can get any where between 1 to N callbacks. But Helix guarantees
that spectator will always receive the last change (its timeline
consistent). This ensures that you will always read the final routing
table.

The reasoning is in most cases, spectator should not care about every
change instead just work on the final state.

Is there any reason why you need to know each and every change. Can you
confirm  external view you read via callback matches the final state (If
not, that would be a bug)



On Thu, Apr 14, 2016 at 10:45 AM, Neutron sharc <neutronsharc@gmail.com>
wrote:

> Hi Helix team,
>
> I'm testing helix in our environment.  I have an example resource with
> 4 partitions, each partition has 1 master 2 slaves replicas.  When a
> replica state changes (for example, a master demotes to slave, a slave
> promotes to master),  my application shall react by updating the
> routing logic.  How to get notifications when the state of a partition
> changes?
>
> I tried the code snippet from SPECTATOR example
> (http://helix.apache.org/0.6.5-docs/tutorial_spectator.html).  That
> sample only monitors external view change.  I ran the helix
> "quickstart" example to create many state transitions in a test
> cluster, so I believe the external view changes multiple times.
> However the spectator callback is triggered only once on the external
> view change.
>
> Any comments appreciated.
>
>
> -neutron
>

Mime
View raw message