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

Adding protoversion as a config value #4252

Conversation

iamrodrigo
Copy link
Contributor

What changed?
ProtoVersion can now be defined in development.yaml. If not present, the default value will be 4. This will be done in a 2 steps process:

  1. Adding the variable in the structs without adding them in the config files (to make sure compatibility is working)
  2. Adding the config files in a different PR

Why?
Labeled as Up for grabs as good first issue in #3536

How did you test it?
Playing with some values in the development.yaml file. Happy to add some unit test if you indicate me where

Potential risks
There was a default value set in newCassandraCluster, however the value is sent by value and not by reference so it won't be set somewhere else. Potentially the right place would be tools/cassandra/handler.go but please let me know where you think I should set this value in case this is not the right place

Release notes
Maybe? Let me know if you want me to do that in the second step

Documentation Changes
Likely to be the case. Let me know if I need to do this in the second step

@iamrodrigo
Copy link
Contributor Author

@yycptt @longquanzheng I was having some weird issues when I was running make bins in #4188 so I closed that PR and created a new branch/PR.

Since this is a really big change I thought it might be a good idea if I first make all the changes without the config files (to see if it's working properly and passing all the test, my test fail in local because I dont have mysql). If everything looks correct, I would create a 2nd PR where I would add all the changes on the yaml, config and env files (if that's ok to you)

@longquanzheng
Copy link
Collaborator

@yycptt @longquanzheng I was having some weird issues when I was running make bins in #4188 so I closed that PR and created a new branch/PR.

Since this is a really big change I thought it might be a good idea if I first make all the changes without the config files (to see if it's working properly and passing all the test, my test fail in local because I dont have mysql). If everything looks correct, I would create a 2nd PR where I would add all the changes on the yaml, config and env files (if that's ok to you)

I am fine with it. Thanks for the contribution.

Copy link
Collaborator

@longquanzheng longquanzheng left a comment

Choose a reason for hiding this comment

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

Mostly LGTM. Only a few minor comments.

@@ -35,6 +35,9 @@ const (
// CreateSession creates a new session
// TODO this will be converted to private later, after all cassandra code moved to plugin pkg
func CreateSession(cfg config.Cassandra) (gocql.Session, error) {
if cfg.ProtoVersion == 0 {
cfg.ProtoVersion = cassandraProtoVersion
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also here

@@ -23,18 +23,22 @@ package cassandra
import (
"time"

"github.com/uber/cadence/environment"

Copy link
Collaborator

Choose a reason for hiding this comment

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

can you remove this empty line?

@coveralls
Copy link

Pull Request Test Coverage Report for Build fb32b7a0-0ee2-4007-9c32-df3151ab6a1b

  • 42 of 60 (70.0%) changed or added relevant lines in 12 files are covered.
  • 102 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.04%) to 60.213%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/persistence/persistence-tests/persistenceTestBase.go 0 1 0.0%
tools/cli/adminCommands.go 0 1 0.0%
common/persistence/nosql/nosqlplugin/cassandra/gocql/client.go 2 4 50.0%
tools/cassandra/main.go 0 5 0.0%
tools/cassandra/handler.go 0 9 0.0%
Files with Coverage Reduction New Missed Lines %
common/persistence/executionStore.go 2 75.5%
common/persistence/statsComputer.go 2 95.71%
service/history/execution/mutable_state_builder.go 2 70.02%
common/persistence/serialization/parser.go 4 69.32%
common/persistence/serialization/thrift_decoder.go 4 63.44%
service/history/shard/context.go 10 64.94%
common/persistence/sql/workflowStateMaps.go 12 83.12%
service/history/execution/context.go 14 66.78%
common/persistence/serialization/getters.go 16 60.69%
common/persistence/sql/sqlExecutionManager.go 16 62.04%
Totals Coverage Status
Change from base Build 226c70d5-3325-4c49-aae7-d8c4128638d7: 0.04%
Covered Lines: 88871
Relevant Lines: 147595

💛 - Coveralls

@longquanzheng longquanzheng merged commit 7e6fbdb into uber:master Jun 9, 2021
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.

3 participants