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

Addresses comments on original PR #1

Merged
merged 9 commits into from
Jun 9, 2017
Merged

Addresses comments on original PR #1

merged 9 commits into from
Jun 9, 2017

Conversation

fcvarela
Copy link

@fcvarela fcvarela commented Jun 7, 2017

I'm splitting these simple changes from the TLS setup. Working on that next.

@@ -72,6 +75,39 @@ func newCassandraBackend(conf map[string]string, logger log.Logger) (Backend, er
connectStart := time.Now()
cluster := gocql.NewCluster(hosts...)
cluster.Keyspace = keyspace

cluster.ProtoVersion = 2
Copy link
Owner

Choose a reason for hiding this comment

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

Why set this to 2? I agree with letting users specify the version explicitly in the config, but in the case they do not, leaving it as 0 which causes gocql to try to auto-detect the version seems better.

Copy link
Owner

Choose a reason for hiding this comment

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

Oh I see… is it for consistency with this?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. I'm all up for 0 but their comment also suggested 2.

Copy link
Owner

Choose a reason for hiding this comment

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

🤔 Fair enough, given their goal is to unify the Cassandra connection implementations.


tlsOn, err := strconv.Atoi(tlsOnStr)
if err != nil {
return fmt.Errorf("'tls' must be an integer (0 or 1)")
Copy link
Owner

Choose a reason for hiding this comment

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

Can this be made a bool?

Copy link
Author

Choose a reason for hiding this comment

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

Ill double check. Their config examples use ints and it seems unquoted strings for representing bools trigger parsing errors inconsistently.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, interesting. In the same example there is disable_hostname = true further down 🤔

Copy link
Author

Choose a reason for hiding this comment

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

It's a bit confusing. I'll dig deeper but while trying unquoted literals in both config formats I had this same issue: hashicorp#1559

Copy link
Owner

Choose a reason for hiding this comment

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

Interesting. Let's leave it as an integer ¯_(ツ)_/¯

I think if you can add the documentation for the new config params then we should be good to submit upstream 🚀

Copy link
Author

Choose a reason for hiding this comment

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

AWESOME! 👍

@obeattie
Copy link
Owner

obeattie commented Jun 7, 2017

These parameters should probably also be documented.

if err != nil {
return nil, fmt.Errorf("'connection_timeout' must be an integer")
}
cluster.Timeout = time.Duration(connectionTimeout) * time.Millisecond
Copy link
Owner

@obeattie obeattie Jun 7, 2017

Choose a reason for hiding this comment

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

Just noticed that in this file, this parameter is specified in seconds rather than milliseconds. Should we align the two for consistency? If they aren't the same unit then unifying the two implementations (as they would like) is going to be impossible.

Copy link
Author

Choose a reason for hiding this comment

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

Sure, makes perfect sense.

@fcvarela
Copy link
Author

fcvarela commented Jun 8, 2017

@obeattie I'm fixing an issue with pem parsing, please don't merge just yet 👎

@fcvarela
Copy link
Author

fcvarela commented Jun 8, 2017

👍 good to go and tested

Copy link
Owner

@obeattie obeattie left a comment

Choose a reason for hiding this comment

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

❤️

@obeattie obeattie merged this pull request into obeattie:cassandra Jun 9, 2017
obeattie pushed a commit that referenced this pull request Jun 9, 2017
created structure for permissions and modified parsePaths in policy.g…
@fcvarela fcvarela deleted the cassandra branch June 9, 2017 09:31
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