Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) Persist sessions to ZooKeeper #7

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

kmaehashi
Copy link
Member

By applying this patch, JubaQL gateway now persists session records to ZooKeeper, so that:

  • gateway instances can be clustered to provide high availability and performance
  • session records can be recovered after restarting Gateway, even in non-HA configuration

In other words, this patch resolves SPoF issue of JubaQL system.

External changes introduced in this patch

  • This patch adds the following options to Gateway.
    • --persist: enables session persisntence. When using this option, ZooKeeper hosts must be specified like -Djubaql.zookeeper=localhost:2181.
    • --gatewayId xxx: specify gateway cluster name. Runs in single node mode when omitted.
  • This patch adds dependency to Apache Curator library, which is a client library for ZooKeeper.
  • This patch changes the login protocol between Client and Gateway. When clients reconnect to the existing session, clients need to send login request (along with the session ID) to ensure that the session exists. (client side fix: Send session ID immediately when reconnecting to existing sessions jubaql-client#1)
  • Session persistence creates ZooKeeper node under /jubaql/session.

TODOs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants