[ 
https://issues.apache.org/jira/browse/CALCITE-5581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17704166#comment-17704166
 ] 

Istvan Toth commented on CALCITE-5581:
--------------------------------------

I agree that the current state of the patch is already useful, but I think that 
we improve on it 
I would like to achieve feature parity with the (already pretty bare-bones) 
Knox implementation at least. (where it makes sense)

*Identifiying failed hosts*

We can sidestep most of the complexity if we don't try to process the reasons 
for failure.
We can ignore when an alredy active connection fails, and only mark a host 
failed if the original connection attempt is unsuccessful. We know that the 
other end is either an avatica server, or some kind of proxy, and the only 
processing we need to do ignoring  401/403 errors.

*Handling failed hosts*

One option is to move the failed host to the end of the list, like Knox does.
This of course is not feasible for random. One option is to simply not maintain 
a failed list for the random strategy.

*Timeouts*
If we want to handle failover during connection establishment, then we must 
make sure to use a relatively short timeout. I.e. if the normal connect tiemout 
is 30 seconds, then we do not want to wait a total of 150 seconds  if we try 5 
hosts.

> Implement Basic client side load balancing in Avatica Driver
> ------------------------------------------------------------
>
>                 Key: CALCITE-5581
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5581
>             Project: Calcite
>          Issue Type: New Feature
>          Components: avatica
>    Affects Versions: 1.33.0
>            Reporter: Vaibhav Joshi
>            Assignee: Vaibhav Joshi
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: Avatica Basic client side load balancing.docx
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Implement mechanism to support Client side load balancing by configuring 
> connection properties for load balancing  
> {code:java}
> jdbc:phoenix:thin:
> url=https://<host>:<port>;
> serialization=PROTOBUF;
> authentication=BASIC;
> avatica_user=<userName>;
> avatica_password=<userPw>
> useClientSideLB: [true/false]
> lbStrategy: [RandomDistribution/Sequential/RoundRobin]
> lbURLs: <comma separated URls e.g. URL1, URL2,URL3,...URLn> {code}
> Client should connect to any of the URLs specified in lbURLs ( depending on 
> LB strategy selected).  Please refer to [^Avatica Basic client side load 
> balancing.docx]for more details
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to