-
Notifications
You must be signed in to change notification settings - Fork 623
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
Shard awareness extension for Scylla patchset 2 #1211
base: trunk
Are you sure you want to change the base?
Conversation
b5f7b2e
to
f25f8d4
Compare
f25f8d4
to
967e0b3
Compare
conn_test.go
Outdated
} | ||
readyFrame := frames[0] | ||
|
||
supportedFrame := frames[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supportedFrame is actually a gocql type, so rename to avoid confusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, do you have an idea for a better name? We could also introduce var f ObservedFrameHeader
and reassign that or even inline them all...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, just call it something simpler, like sFrame
, no need to overcomplicate this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd fix that in the other PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I resolved to if f := frames[0]; f.Opcode != frameOp(opSupported)
and applied that to other if branches because readyFrame is also a type.
967e0b3
to
06a786d
Compare
06a786d
to
0e50e36
Compare
0e50e36
to
7effd2a
Compare
7effd2a
to
1fe272b
Compare
1fe272b
to
f702adf
Compare
f702adf
to
bd1a67a
Compare
Co-authored-by: Henrik Johansson <[email protected]> Co-authored-by: Michał Matczuk <[email protected]>
This allows tokenAwareHostPolicy return token from ExecutableQuery. Co-authored-by: Henrik Johansson <[email protected]> Co-authored-by: Michał Matczuk <[email protected]>
The hostConnPool logic around conns slice is moved to defaultConnPicker. Co-authored-by: Henrik Johansson <[email protected]> Co-authored-by: Michał Matczuk <[email protected]>
This is an extension to tokenAwareHostPolicy supported by the Scylla 2.3 and onwards. It allows driver to select a connection to shard on a host based on the token. The protocol extension spec is available at [1]. [1] https://github.com/scylladb/scylla/blob/master/docs/protocol-extensions.md Co-authored-by: Henrik Johansson <[email protected]> Co-authored-by: Michał Matczuk <[email protected]>
A list of excess connections is maintained to allow for lazy removal of. excess connections. Keeping excess connections open helps reaching equilibrium faster since the likelihood of hitting the same shard decreases with the number of connections to the shard. The excess connections list is currently capped to 10 times the number of shards. This magic number has no backing statistics but sounds reasonable.
When the pool is not yet fully materialized we give the caller a random connection to allow the session to start working.
The driver silently replaced the current token with the closest one from the token ring that it could find. This worked well enough to route the request to the correct host but to pick the right shard we need the actual token for the qiven query.
d172663
to
1ad3b47
Compare
Friendly ping |
Any news ? |
Why is this being delayed ? |
Oh well. |
This patchset contains the Scylla specific part of #1206, the relevant commit is b5f7b2e. This work depends on #1210. It's changed form #1206 to limit scope of Scylla related code.
This is an extension to tokenAwareHostPolicy supported by the Scylla 2.3
and onwards. It allows driver to select a connection to shard on a host
based on the token. The protocol extension spec is available at [1].
[1] https://github.com/scylladb/scylla/blob/master/docs/protocol-extensions.md