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

Vaibhav Joshi commented on CALCITE-5581:
----------------------------------------

[~stoty] 

This is Interesting.

I think if we implement retry logic ( retrying different host), "failed host 
scenarios" are already taken care off. 

Following are my thoughts.
 * {*}Round Robin LB Strategy{*}: We treat lbURLs as a circular list. When 
connection fails, we pick up the next host in the list. Failed host will be 
attempted after N attempts. So technically we are getting the effect which you 
suggested above.
 * {*}Random Select{*}: Probability of recalling same host is very less due to 
randomization. So even if we don't implement the host blacklisting logic, we 
pick up a different host in 2nd or 3rd attempt (max). 

 

So retry mechanism should be sufficient in first cut implementation.

High level we can have following. Behavior
 # Define two parameters named *LB_FAILOVER_CONNECTION_TIMEOUT* and 
*LB_FAILOVER_RETRIES*
 # Try to create HTTP connection with the *LB_FAILOVER_CONNECTION_TIMEOUT* as 
timeout parameter.
 # When connection is failed, get a new URL using LBStrategy and retry that URL.
 # Repeat #1 to #3 till {*}LB_FAILOVER_RETRIES.{*}{*}{*}

We can anyway have contribution in future and enhance this behavior in case we 
have specific observations in the field.

> 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