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
feat(bigtable): run E2E test over DirectPath #3116
Conversation
Let's tackle the other PR first. This won't work until that is in, released and bumped the dependency here. |
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.
+1 to Cody's comment. Also FYI @kolea2
ffe411b
to
b3ee65b
Compare
ebb00f7
to
687595b
Compare
@mohanli-ml I did release a new version of |
280901d
to
79b12f6
Compare
bigtable/bigtable.go
Outdated
@@ -81,6 +83,13 @@ func NewClientWithConfig(ctx context.Context, project, instance string, config C | |||
// TODO(grpc/grpc-go#1388) using connection pool without WithBlock | |||
// can cause RPCs to fail randomly. We can delete this after the issue is fixed. | |||
option.WithGRPCDialOption(grpc.WithBlock())) | |||
|
|||
// Expose an experimental flag to make client attempt DirectPath. | |||
// Once e2e tests are finished, this flag will be removed, and client |
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.
What does "Once e2e tests are finished" mean? Seems like we should be able to add this option from the test directly, rather than through an environment variable?
As-is, this seems to be doing more than adding a test, given this is a non-test file. In general, we should avoid adding to the public API when we know we're going to remove it in the future.
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.
We are going to release directpath for bigtable, and we designed some e2e test scenarios that needs to be covered before the release (See the background and what we have done for java-bigtable in go/directpath-e2e-test-scenarios). I replace the environment with a global variable, but the idea should be the same.
We need this option now because we do not want to rashly set internaloption.EnableDirectPath
to true, which is what we will do after all e2e tests. A similar PR for previous work in java-bigtable can be found googleapis/java-bigtable#467
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.
Sorry, I'm still confused. Can we avoid adding anything to the exported API? Can the test pass the internaloption.EnableDirectPath
option when appropriate?
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.
Hey Tyler, sorry I did not make myself clear. So DirectPath is a new feature for bigtable, and ultimately we will need to add internaloption.EnableDirectPath(true)
to the library code to support this feature. For now, we are using a flag that is passed from tests in internaloption.EnableDirectPath()
because we needs to test this feature first. But since ultimately we will change the library code, I think it is reasonable to add the internal option now. Does this make sense to you? Please let me know if you have more questions. Thanks!
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 moved the internal option to test files, and the flag is removed.
79b12f6
to
2e50a4d
Compare
4a99910
to
2b0d170
Compare
bigtable/export_test.go
Outdated
@@ -71,6 +77,7 @@ type IntegrationEnv interface { | |||
NewInstanceAdminClient() (*InstanceAdminClient, error) | |||
NewClient() (*Client, error) | |||
Close() | |||
GetPeer() *peer.Peer |
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 can just be called Peer
. See https://golang.org/doc/effective_go.html#Getters.
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.
Fixed. Thanks!
Also, no need to force push. We'll squash into a single commit with the right message when merging. |
In the relevant GAX library PR googleapis/google-api-go-client#732, we removed environment variable GOOGLE_CLOUD_ENABLE_DIRECT_PATH, and expose an internal option to Yoshi library, so that Yoshi library can decide if it want to attempt DirectPath or not. In this PR,
we make use of this option to run E2E test over DirectPath. Relevant bug is b/172700854.