You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@helix.apache.org by Xue Junkai <ju...@gmail.com> on 2017/11/10 12:05:27 UTC

Re: External view change notifications to clients

If you attach the external view listener through HelixManager, all the
listener will be notified at same time.

On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
leela_maheshwar@yahoo.com.invalid> wrote:

> Team,Does helix ensure whether all clients see same external view at same
> time ? Or application should handle this?
>
> Regards,Mahesh




-- 
Junkai Xue

Re: External view change notifications to clients

Posted by leela maheswararao <le...@yahoo.com>.
 thanks kishore.
    On Saturday, November 11, 2017, 10:24:08 PM GMT+5:30, kishore g <g....@gmail.com> wrote:  
 
 Yes that’s a good idea to read external view when server returns error.
Add exponential back off policy here. Make sure the server returns proper
error code indicating it’s no longer the master. You don’t want to read
external view on every error.



On Fri, Nov 10, 2017 at 6:11 PM leela maheswararao <
leela_maheshwar@yahoo.com> wrote:

> Thanks Kishore and Xue for quick reply.
>
> Basically my scenario is like this.
>
> Initially assume partition P1(Master) is on node N1. As part of new node
> addition, P1 (M) moved to N2. It's possible that client C1
> still sees P1(M) on N1 due to late processing of notification and client
> C2 sees P1(M) on N2 due to immediate processing of notification.
>
> Agree that getting consensus is bit tough. One way our application client
> can solve this is getting an error from server when it receives PUT/GET for
> partition it doesn't own and client call below API to make an explicit
> Zookeeper call to get current state and invoke operation on right server.
>
> manager.getClusterManagmentTool().getResourceExternalView(clusterName,
> resourceName);
>
> Im assuming above API makes an explicit call to ZK.
>
> do you see any other alternative solution?
>
> Regards,
> Mahesh
> On Friday, November 10, 2017, 9:49:57 PM GMT+5:30, kishore g <
> g.kishore@gmail.com> wrote:
>
>
> lets break it into two parts. Update to ExternalView is done by the
> controller. The clients are notified of the change through a Zookeeper
> callback. Its not guaranteed that all clients will receive the callback at
> the same time.
>
> In general, its not a good idea to rely on every client seeing the same
> view at the same time (its impossible to achieve this in a distributed
> system). However, it is the view is timeline consistent. For e.g if
> controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
> will get notified in the same order. Another thing you should be aware is
> that if these changes happen in quick succession, its possible that the
> client only sees EV(t1) and EV(t3).
>
> Can you provide more details on what you are planning to achieve. We can
> suggest the right design.
>
>
> On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:
>
> > If you attach the external view listener through HelixManager, all the
> > listener will be notified at same time.
> >
> > On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> > leela_maheshwar@yahoo.com.invalid> wrote:
> >
> > > Team,Does helix ensure whether all clients see same external view at
> same
> > > time ? Or application should handle this?
> > >
> > > Regards,Mahesh
> >
> >
> >
> >
> > --
> > Junkai Xue
> >
>  

Re: External view change notifications to clients

Posted by leela maheswararao <le...@yahoo.com.INVALID>.
 thanks kishore.
    On Saturday, November 11, 2017, 10:24:08 PM GMT+5:30, kishore g <g....@gmail.com> wrote:  
 
 Yes that’s a good idea to read external view when server returns error.
Add exponential back off policy here. Make sure the server returns proper
error code indicating it’s no longer the master. You don’t want to read
external view on every error.



On Fri, Nov 10, 2017 at 6:11 PM leela maheswararao <
leela_maheshwar@yahoo.com> wrote:

> Thanks Kishore and Xue for quick reply.
>
> Basically my scenario is like this.
>
> Initially assume partition P1(Master) is on node N1. As part of new node
> addition, P1 (M) moved to N2. It's possible that client C1
> still sees P1(M) on N1 due to late processing of notification and client
> C2 sees P1(M) on N2 due to immediate processing of notification.
>
> Agree that getting consensus is bit tough. One way our application client
> can solve this is getting an error from server when it receives PUT/GET for
> partition it doesn't own and client call below API to make an explicit
> Zookeeper call to get current state and invoke operation on right server.
>
> manager.getClusterManagmentTool().getResourceExternalView(clusterName,
> resourceName);
>
> Im assuming above API makes an explicit call to ZK.
>
> do you see any other alternative solution?
>
> Regards,
> Mahesh
> On Friday, November 10, 2017, 9:49:57 PM GMT+5:30, kishore g <
> g.kishore@gmail.com> wrote:
>
>
> lets break it into two parts. Update to ExternalView is done by the
> controller. The clients are notified of the change through a Zookeeper
> callback. Its not guaranteed that all clients will receive the callback at
> the same time.
>
> In general, its not a good idea to rely on every client seeing the same
> view at the same time (its impossible to achieve this in a distributed
> system). However, it is the view is timeline consistent. For e.g if
> controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
> will get notified in the same order. Another thing you should be aware is
> that if these changes happen in quick succession, its possible that the
> client only sees EV(t1) and EV(t3).
>
> Can you provide more details on what you are planning to achieve. We can
> suggest the right design.
>
>
> On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:
>
> > If you attach the external view listener through HelixManager, all the
> > listener will be notified at same time.
> >
> > On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> > leela_maheshwar@yahoo.com.invalid> wrote:
> >
> > > Team,Does helix ensure whether all clients see same external view at
> same
> > > time ? Or application should handle this?
> > >
> > > Regards,Mahesh
> >
> >
> >
> >
> > --
> > Junkai Xue
> >
>  

Re: External view change notifications to clients

Posted by kishore g <g....@gmail.com>.
Yes that’s a good idea to read external view when server returns error.
Add exponential back off policy here. Make sure the server returns proper
error code indicating it’s no longer the master. You don’t want to read
external view on every error.



On Fri, Nov 10, 2017 at 6:11 PM leela maheswararao <
leela_maheshwar@yahoo.com> wrote:

> Thanks Kishore and Xue for quick reply.
>
> Basically my scenario is like this.
>
> Initially assume partition P1(Master) is on node N1. As part of new node
> addition, P1 (M) moved to N2. It's possible that client C1
> still sees P1(M) on N1 due to late processing of notification and client
> C2 sees P1(M) on N2 due to immediate processing of notification.
>
> Agree that getting consensus is bit tough. One way our application client
> can solve this is getting an error from server when it receives PUT/GET for
> partition it doesn't own and client call below API to make an explicit
> Zookeeper call to get current state and invoke operation on right server.
>
> manager.getClusterManagmentTool().getResourceExternalView(clusterName,
> resourceName);
>
> Im assuming above API makes an explicit call to ZK.
>
> do you see any other alternative solution?
>
> Regards,
> Mahesh
> On Friday, November 10, 2017, 9:49:57 PM GMT+5:30, kishore g <
> g.kishore@gmail.com> wrote:
>
>
> lets break it into two parts. Update to ExternalView is done by the
> controller. The clients are notified of the change through a Zookeeper
> callback. Its not guaranteed that all clients will receive the callback at
> the same time.
>
> In general, its not a good idea to rely on every client seeing the same
> view at the same time (its impossible to achieve this in a distributed
> system). However, it is the view is timeline consistent. For e.g if
> controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
> will get notified in the same order. Another thing you should be aware is
> that if these changes happen in quick succession, its possible that the
> client only sees EV(t1) and EV(t3).
>
> Can you provide more details on what you are planning to achieve. We can
> suggest the right design.
>
>
> On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:
>
> > If you attach the external view listener through HelixManager, all the
> > listener will be notified at same time.
> >
> > On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> > leela_maheshwar@yahoo.com.invalid> wrote:
> >
> > > Team,Does helix ensure whether all clients see same external view at
> same
> > > time ? Or application should handle this?
> > >
> > > Regards,Mahesh
> >
> >
> >
> >
> > --
> > Junkai Xue
> >
>

Re: External view change notifications to clients

Posted by kishore g <g....@gmail.com>.
Yes that’s a good idea to read external view when server returns error.
Add exponential back off policy here. Make sure the server returns proper
error code indicating it’s no longer the master. You don’t want to read
external view on every error.



On Fri, Nov 10, 2017 at 6:11 PM leela maheswararao <
leela_maheshwar@yahoo.com> wrote:

> Thanks Kishore and Xue for quick reply.
>
> Basically my scenario is like this.
>
> Initially assume partition P1(Master) is on node N1. As part of new node
> addition, P1 (M) moved to N2. It's possible that client C1
> still sees P1(M) on N1 due to late processing of notification and client
> C2 sees P1(M) on N2 due to immediate processing of notification.
>
> Agree that getting consensus is bit tough. One way our application client
> can solve this is getting an error from server when it receives PUT/GET for
> partition it doesn't own and client call below API to make an explicit
> Zookeeper call to get current state and invoke operation on right server.
>
> manager.getClusterManagmentTool().getResourceExternalView(clusterName,
> resourceName);
>
> Im assuming above API makes an explicit call to ZK.
>
> do you see any other alternative solution?
>
> Regards,
> Mahesh
> On Friday, November 10, 2017, 9:49:57 PM GMT+5:30, kishore g <
> g.kishore@gmail.com> wrote:
>
>
> lets break it into two parts. Update to ExternalView is done by the
> controller. The clients are notified of the change through a Zookeeper
> callback. Its not guaranteed that all clients will receive the callback at
> the same time.
>
> In general, its not a good idea to rely on every client seeing the same
> view at the same time (its impossible to achieve this in a distributed
> system). However, it is the view is timeline consistent. For e.g if
> controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
> will get notified in the same order. Another thing you should be aware is
> that if these changes happen in quick succession, its possible that the
> client only sees EV(t1) and EV(t3).
>
> Can you provide more details on what you are planning to achieve. We can
> suggest the right design.
>
>
> On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:
>
> > If you attach the external view listener through HelixManager, all the
> > listener will be notified at same time.
> >
> > On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> > leela_maheshwar@yahoo.com.invalid> wrote:
> >
> > > Team,Does helix ensure whether all clients see same external view at
> same
> > > time ? Or application should handle this?
> > >
> > > Regards,Mahesh
> >
> >
> >
> >
> > --
> > Junkai Xue
> >
>

Re: External view change notifications to clients

Posted by leela maheswararao <le...@yahoo.com>.
 Thanks Kishore and Xue for quick reply.
Basically my scenario is like this.
Initially assume partition P1(Master) is on node N1. As part of new node addition, P1 (M) moved to N2. It's possible that client C1still sees P1(M) on N1 due to late processing of notification and client C2 sees P1(M) on N2 due to immediate processing of notification.
Agree that getting consensus is bit tough. One way our application client can solve this is getting an error from server when it receives PUT/GET for partition it doesn't own and client call below API to make an explicit Zookeeper call to get current state and invoke operation on right server.
manager.getClusterManagmentTool().getResourceExternalView(clusterName, resourceName);
Im assuming above API makes an explicit call to ZK.
do you see any other alternative solution?
Regards,Mahesh    On Friday, November 10, 2017, 9:49:57 PM GMT+5:30, kishore g <g....@gmail.com> wrote:  
 
 lets break it into two parts. Update to ExternalView is done by the
controller. The clients are notified of the change through a Zookeeper
callback. Its not guaranteed that all clients will receive the callback at
the same time.

In general, its not a good idea to rely on every client seeing the same
view at the same time (its impossible to achieve this in a distributed
system). However, it is the view is timeline consistent. For e.g if
controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
will get notified in the same order. Another thing you should be aware is
that if these changes happen in quick succession, its possible that the
client only sees EV(t1) and EV(t3).

Can you provide more details on what you are planning to achieve. We can
suggest the right design.


On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:

> If you attach the external view listener through HelixManager, all the
> listener will be notified at same time.
>
> On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> leela_maheshwar@yahoo.com.invalid> wrote:
>
> > Team,Does helix ensure whether all clients see same external view at same
> > time ? Or application should handle this?
> >
> > Regards,Mahesh
>
>
>
>
> --
> Junkai Xue
>
  

Re: External view change notifications to clients

Posted by leela maheswararao <le...@yahoo.com.INVALID>.
 Thanks Kishore and Xue for quick reply.
Basically my scenario is like this.
Initially assume partition P1(Master) is on node N1. As part of new node addition, P1 (M) moved to N2. It's possible that client C1still sees P1(M) on N1 due to late processing of notification and client C2 sees P1(M) on N2 due to immediate processing of notification.
Agree that getting consensus is bit tough. One way our application client can solve this is getting an error from server when it receives PUT/GET for partition it doesn't own and client call below API to make an explicit Zookeeper call to get current state and invoke operation on right server.
manager.getClusterManagmentTool().getResourceExternalView(clusterName, resourceName);
Im assuming above API makes an explicit call to ZK.
do you see any other alternative solution?
Regards,Mahesh    On Friday, November 10, 2017, 9:49:57 PM GMT+5:30, kishore g <g....@gmail.com> wrote:  
 
 lets break it into two parts. Update to ExternalView is done by the
controller. The clients are notified of the change through a Zookeeper
callback. Its not guaranteed that all clients will receive the callback at
the same time.

In general, its not a good idea to rely on every client seeing the same
view at the same time (its impossible to achieve this in a distributed
system). However, it is the view is timeline consistent. For e.g if
controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
will get notified in the same order. Another thing you should be aware is
that if these changes happen in quick succession, its possible that the
client only sees EV(t1) and EV(t3).

Can you provide more details on what you are planning to achieve. We can
suggest the right design.


On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:

> If you attach the external view listener through HelixManager, all the
> listener will be notified at same time.
>
> On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> leela_maheshwar@yahoo.com.invalid> wrote:
>
> > Team,Does helix ensure whether all clients see same external view at same
> > time ? Or application should handle this?
> >
> > Regards,Mahesh
>
>
>
>
> --
> Junkai Xue
>
  

Re: External view change notifications to clients

Posted by kishore g <g....@gmail.com>.
lets break it into two parts. Update to ExternalView is done by the
controller. The clients are notified of the change through a Zookeeper
callback. Its not guaranteed that all clients will receive the callback at
the same time.

In general, its not a good idea to rely on every client seeing the same
view at the same time (its impossible to achieve this in a distributed
system). However, it is the view is timeline consistent. For e.g if
controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
will get notified in the same order. Another thing you should be aware is
that if these changes happen in quick succession, its possible that the
client only sees EV(t1) and EV(t3).

Can you provide more details on what you are planning to achieve. We can
suggest the right design.


On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:

> If you attach the external view listener through HelixManager, all the
> listener will be notified at same time.
>
> On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> leela_maheshwar@yahoo.com.invalid> wrote:
>
> > Team,Does helix ensure whether all clients see same external view at same
> > time ? Or application should handle this?
> >
> > Regards,Mahesh
>
>
>
>
> --
> Junkai Xue
>

Re: External view change notifications to clients

Posted by kishore g <g....@gmail.com>.
lets break it into two parts. Update to ExternalView is done by the
controller. The clients are notified of the change through a Zookeeper
callback. Its not guaranteed that all clients will receive the callback at
the same time.

In general, its not a good idea to rely on every client seeing the same
view at the same time (its impossible to achieve this in a distributed
system). However, it is the view is timeline consistent. For e.g if
controller changes the external view to EV(t1), EV(t2), EV(t3) the clients
will get notified in the same order. Another thing you should be aware is
that if these changes happen in quick succession, its possible that the
client only sees EV(t1) and EV(t3).

Can you provide more details on what you are planning to achieve. We can
suggest the right design.


On Fri, Nov 10, 2017 at 4:05 AM, Xue Junkai <ju...@gmail.com> wrote:

> If you attach the external view listener through HelixManager, all the
> listener will be notified at same time.
>
> On Fri, Nov 10, 2017 at 4:02 AM, leela maheswararao <
> leela_maheshwar@yahoo.com.invalid> wrote:
>
> > Team,Does helix ensure whether all clients see same external view at same
> > time ? Or application should handle this?
> >
> > Regards,Mahesh
>
>
>
>
> --
> Junkai Xue
>