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

Fix setting up connection to non-IP sockets #178

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

sylwiaszunejko
Copy link
Collaborator

@sylwiaszunejko sylwiaszunejko commented May 27, 2024

Before the fix using a custom Dialer which connects to unix socket would fail: scylladb/scylla-manager#3831 (comment).

This PR makes the code default to the defaultPort in case unix socket is used and we cannot get tcp address by conn.conn.RemoteAddr().(*net.TCPAddr). I also added test for that.

Fixes: #175

@sylwiaszunejko
Copy link
Collaborator Author

I am not sure how to access maintenance socket (cql.m). Mounting directories seem to not work properly (permission denied). I could use some advice here how to solve it.

@sylwiaszunejko
Copy link
Collaborator Author

sylwiaszunejko commented May 31, 2024

v2.

  • I changed CI to use latest version of scylla for all tests
  • I granted permissions to socket file to resolve error messages

@avelanarius @Michal-Leszczynski

@sylwiaszunejko sylwiaszunejko marked this pull request as ready for review May 31, 2024 13:25
@@ -2,7 +2,7 @@ version: "3.7"

services:
node_1:
image: ${SCYLLA_IMAGE}
image: scylladb/scylla-nightly
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad idea, this CICD needs to be stable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that scylla-enterprise-nightly:latest-enterprise is more stable and still allows for testing the newest release without changing docker tags in every PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before this PR you could test it by SCYLLA_VERSION=scylla-enterprise-nightly:latest-enterpris ./integration.sh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perfect example of why you should not run cicd on nightly builds:
https://github.com/scylladb/gocql/actions/runs/9346882983/job/25722658483?pr=186

It is failing because image is broken, now you either ignore pipeline failure, or wait till working image is published.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create separate PR to use newer version of SCYLLA_IMAGE for all of the nodes and I will bump scylla version in github workflows

Copy link
Collaborator

@roydahan roydahan Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use "latest" tag which is the latest release we have (Not RC) in (scylladb/scylla not nightly).

@@ -42,7 +42,7 @@ CREATE TABLE gocqlx_table.monkeyspecies (
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 1
AND read_repair_chance = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please clarify how this is related to the PR?

@sylwiaszunejko sylwiaszunejko force-pushed the unix_socket branch 2 times, most recently from 0f066e8 to b9620cb Compare June 7, 2024 13:16
@sylwiaszunejko
Copy link
Collaborator Author

v3:
I changed the scylla version to 6.0.0 and now CI works.

@sylwiaszunejko
Copy link
Collaborator Author

@avelanarius Could you take a look?

if err != nil {
panic(fmt.Sprintf("unable to create session: %v", err))
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you ran a query to make sure session is operational ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could add it, but I thought it was not necessary cause the issue was discovered without it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but you know, lot's of things happening between session creation and query being executed, aren't we need to make sure that whole thing is working ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the queries

@sylwiaszunejko
Copy link
Collaborator Author

@avelanarius ping

Copy link
Collaborator

@dkropachev dkropachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beside force_schema_commit_log issue, look greate.

@@ -8,5 +8,4 @@ client_encryption_options:
keyfile: /etc/scylla/db.key
truststore: /etc/scylla/ca.crt
require_client_auth: true
# when using 5.4.x we have to specify force_schema_commit_log option
force_schema_commit_log: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you deleted it intentionaly, since it is used by dirver-matrix I do not recommend deleting it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was only necessary to specify it in 5.4.x. In the 6.0 it should be enabled be default

@sylwiaszunejko
Copy link
Collaborator Author

@avelanarius @roydahan Could you look at it?

Comment on lines 8 to +11
keyfile: /etc/scylla/db.key
truststore: /etc/scylla/ca.crt
require_client_auth: true
# when using 5.4.x we have to specify force_schema_commit_log option
force_schema_commit_log: true
maintenance_socket: workdir
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of maintenance_socket here is not related to the commit description. Why is it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right it should be in the second commit

Comment on lines 58 to 61
err = createTable(sess, `DROP KEYSPACE IF EXISTS `+keyspace)
if err != nil {
t.Fatal("unable to drop keyspace:", err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say: "unable to drop keyspace if exists", because otherwise the message would imply unconditional dropping of a keyspace, and such could fail due to e.g. lack of such keyspace defined.

control_integration_test.go Show resolved Hide resolved
Remove {dclocal_,}read_repair_chance options from tests as they
are deprecated in scylladb/scylladb#18087.

Remove `tablets` and `consistent-topology-feature` experimental
flags as they are not longer experimental.
@sylwiaszunejko sylwiaszunejko merged commit 790b1a8 into scylladb:master Jun 19, 2024
1 check passed
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.

RFE: add option to connect to UNIX socket
5 participants