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

Session acquisition update #232

Merged
merged 8 commits into from
Sep 22, 2016
Merged

Conversation

pontusmelke
Copy link
Contributor

@pontusmelke pontusmelke commented Sep 21, 2016

Adopt the driver to server-side changes:

  • getServers now returns a single row containing all the information.
  • Whenever we do a call to getServers we should forget about any servers that is not in the return and update our view of routers, readers, and writers
  • Respect the ttl coming from the server. On acquisition we check if our knowledge is stale, if so ask the server to update our view of the cluster.

Note that this PR assumes the response from getServers looks like

{"ttl": 1234, "servers": [
    {"role": "ROUTE", "addresses": [...]}, 
    {"role": "READ", "addresses": [...]}, 
    {"role": "WRITE", "addresses": [...]}
 ]
}

where ttl is measured in seconds.

`getServers` now only returns a single row containing all the information, together with a
`ttl` that is no longer per server but a global `ttl` for the returned servers.
Whenever we go down to the database to call `getServers` we should use the
values returned from the call and forget about any servers returned in previous
calls.
The returned `ttl` from server is now respected. Whenever we do acquisition we check if
the information is stale, if so we do new `getServers` call.
Whenever we do rediscovery and the server forces us to discard all connections to
endpoints no longer valid in the servers point-of-view, there is a chance there are
still open connections to those endpoints and when closing these open sessions we
must make sure we properly close these connections without putting them back to the
connection pool.
@technige technige merged commit 91cdb30 into neo4j:1.1 Sep 22, 2016
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