-
Notifications
You must be signed in to change notification settings - Fork 70
[#591] Merge upstream commit 63b6d78: "CASSGO 1 Support for Native Protocol 5"
#593
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
base: master
Are you sure you want to change the base?
Conversation
d894ba4 to
b5ee23f
Compare
What's the value of the v5 protocol? |
It will allow to test modern Cassandra side by side, bring proper metadata handling, which we will use in next pr. |
For proper metada handling we need this change to the wire protocol? v5 doesn't seem to be providing huge value, maybe I'm missing something. Modern cassandra isn't exciting. CQL5 - I'm not sure it's on our todo list just yet. |
We don't need it, but if we don't bring CQL5 now, later we will have to deal with rewiring metadata updates when CQL5 going to get it, which will make it way harder, out of experience with other drivers I can tell that bringing CQL5 first and then implementing metadata update feature way easier than otherway around. |
80e1137 to
18a0652
Compare
Native Protocol 5 was introduced with the release of C* 4.0. This PR provides full support for a newer version including new format frames (segments), and new fields for QUERY, BATCH, and EXECUTE messages. Also, this PR brings changes to the Compressor interface to follow an append-like design. One more thing, it bumps Go version to the newer 1.19. Patch by Bohdan Siryk; Reviewed by João Reis, James Hartig for CASSGO-1 CASSGO-30
e7022a5 to
5a76087
Compare
63b6d78: "CASSGO 1 Support for Native Protocol 5"
…y to internal package. Integration tests config changes. Reverting unwanted merge changes.
Detailed summary:
- Moving CRC functionality to internal package.
- Update test cluster hosts to match CCM-created cluster
- Update flagCluster default from 127.0.0.1 to 127.0.2.1,127.0.2.2,127.0.2.3 to align with the 3-node cluster configuration created by CCM. Fixes connection refused errors in integration tests.
- Adding validation to `ReadTimeout` value in `ClusterConfig`
- Removing `headSize` from `framer`.
- Adding `.vscode` to `.gitignore`.
5a76087 to
a2cb754
Compare
63b6d78: "CASSGO 1 Support for Native Protocol 5"63b6d78: "CASSGO 1 Support for Native Protocol 5"
control.go
Outdated
| hosts = shuffleHosts(hosts) | ||
|
|
||
| connCfg := *c.session.connCfg | ||
| connCfg.ProtoVersion = protoVersion4 // TODO: define maxProtocol |
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.
Please set it to 5
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.
it is still protoVersion4
cassandra_test.go
Outdated
| text string | ||
| ) | ||
|
|
||
| q := session.Query("SELECT * FROM gocql_query_keyspace_override_test.query_keyspace"). |
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.
Please remove ks from the query.
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.
it is still there.
cassandra_test.go
Outdated
| id = 0 | ||
| text = "" | ||
|
|
||
| q = session.Query("SELECT * FROM gocql_query_keyspace_override_test.query_keyspace"). |
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.
Please remove ks from the query.
common_test.go
Outdated
|
|
||
| var ( | ||
| flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port tuples") | ||
| flagCluster = flag.String("cluster", "127.0.2.1,127.0.2.2,127.0.2.3", "a comma-separated list of host:port tuples") |
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.
Please roll it back
conn.go
Outdated
| if c.r.GetTimeout() > 0 { | ||
| c.r.SetReadDeadline(time.Time{}) | ||
| } |
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.
This one does not make any sense to have it here, it will be overridden on next .Read call on the reader, please drop it
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.
Let's do the following instead, on first io.ReadFull(r, p[:1]) in the readHeader(r io.Reader, p []byte) (head frameHeader, err error) let's handle read timeout and wrap/or return an error that signals that it is an expected situation and handle it gracefully on serve(ctx context.Context).
The problem is the following, if there is no traffic serve(ctx context.Context) is still calling readHeader, in which situation it is ok to get timeout on reading begging of the frame.
conn.go
Outdated
|
|
||
| // ConnReader is like net.Conn but also allows to set timeout duration. | ||
| type ConnReader interface { | ||
| net.Conn |
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.
Please remove net.Conn and add only methods that are used.
conn.go
Outdated
| func (c *connReader) LocalAddr() net.Addr { | ||
| return c.conn.LocalAddr() | ||
| } |
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.
It is not used, drop it
conn.go
Outdated
| return c.conn.RemoteAddr() | ||
| } | ||
|
|
||
| func (c *connReader) SetDeadline(t time.Time) error { |
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.
It is not used, drop it
conn.go
Outdated
| func (c *connReader) SetReadDeadline(t time.Time) error { | ||
| return c.conn.SetReadDeadline(t) | ||
| } |
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.
It should not be used, please drop it.
conn.go
Outdated
| func (c *connReader) SetWriteDeadline(t time.Time) error { | ||
| return c.conn.SetWriteDeadline(t) | ||
| } |
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.
SetWriteDeadline on a connReader ? Please drop it.
…nhancements. Refactor keyspace handling in `TestQuery_SetKeyspace`
dkropachev
left a comment
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.
Please go over all the comments, make sure they are fixed.
control.go
Outdated
| hosts = shuffleHosts(hosts) | ||
|
|
||
| connCfg := *c.session.connCfg | ||
| connCfg.ProtoVersion = protoVersion4 // TODO: define maxProtocol |
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.
it is still protoVersion4
cassandra_test.go
Outdated
| text string | ||
| ) | ||
|
|
||
| q := session.Query("SELECT * FROM gocql_query_keyspace_override_test.query_keyspace"). |
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.
it is still there.
Merging upstream commit 63b6d78:
These changes introduce functionality necessary to implement
SCYLLA_USE_METADATA_IDprotocol extension (see #527).Extra changes:
headSizefromframer.ReadTimeoutvalue inClusterConfig.vscodeto.gitignore.