lalinsky / python-phoenixdb

Phoenix database adapter for Python (migrated to the Apache Phoenix repo)

Home Page:https://issues.apache.org/jira/browse/PHOENIX-4636

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for HA failover

lalinsky opened this issue · comments

https://community.hortonworks.com/articles/9377/deploying-the-phoenix-query-server-in-production-e.html#comment-9387

Lukas Lalinsky · Jan 11, 2016 at 12:49 PM 0
I have a question about the stateless load balancing. In Avatica 1.5, there is an explicit request for opening a connection. I'm assuming the connection only exists in memory on one server. Even before 1.5, the connection had some parameters associated with it and they also only live on one server. How can it resume the state on another server?

https://calcite.apache.org/docs/avatica_protobuf_reference.html#openconnectionrequest

https://calcite.apache.org/docs/avatica_protobuf_reference.html#connectionsyncrequest

Josh Elser Lukas Lalinsky · Jan 11, 2016 at 02:42 PM 0
The big pieces needed to recover the state for a query automatically are the connection and statement missing in the server's memory (as you point out). In 1.5 (I believe), I added the ability to pass back specific context on the relevant RPC messages stating when this necessary state was missing in the server. This allows the client to send the necessary RPC to recreate the state and try to fetch the results again.

Josh Elser Lukas Lalinsky · Jan 11, 2016 at 02:43 PM 0
For example, take a look at the recently updated FetchResponse docs. The missingStatement attribute signifies that the Statement in the server's memory is missing. Likewise, the missingResults attribute signifies that the ResultSet in the server's memory is missing. It is up to the client to hold on to the necessary information and recover from these cases.