-
Notifications
You must be signed in to change notification settings - Fork 101
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: add support for spanner client resource base routing #780
feat: add support for spanner client resource base routing #780
Conversation
fix the system test and unit test
fix the existing test cases pass the formattedName_ instead of instanceId and check the instanceId on one place
disable the resource based routing while system test
improve the unit test cases
fix the related changes pending the test case
Codecov Report
@@ Coverage Diff @@
## master #780 +/- ##
=======================================
Coverage 76.74% 76.74%
=======================================
Files 43 43
Lines 20467 20467
Branches 597 597
=======================================
Hits 15707 15707
Misses 4753 4753
Partials 7 7
Continue to review full report at Codecov.
|
6ac1e29
to
0b7e83e
Compare
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.
There are still some unresolved comments so I will wait for you to resolve them before approving.
One more request @laljikanjareeya. Please be more descriptive in the PR description. Follow googleapis/google-cloud-python#10183 as an example. |
@skuruppu Regarding #780 (comment) on the minimum number of sessions in the pool: The Nodejs client currently still uses See nodejs-spanner/src/session-pool.ts Line 128 in f9af78a
|
Oh got it. Thanks for pointing this out @olavloite. |
done(); //no resolved endpoint. | ||
} | ||
//user specific apiEndpoint | ||
spanner.options.apiEndpoint = resolvedEndpoint[0]; |
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.
Isn't this using the resolved endpoint instead of a user-specified endpoint?
} | ||
//user specific apiEndpoint | ||
spanner.options.apiEndpoint = resolvedEndpoint[0]; | ||
spanner.options.enableResourceBasedRouting = true; |
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 think at line 4417, resource routing is already enabled so don't think you need this.
We have decided to implement this functionality on the server side so we no longer need to add this support on the client side. |
Implement resource based routing.
When preparing Gapic Request for a
SpannerClient
, If Client code does not specify theapiEndpoint
than check for suggestedendpointUris
.If
endpointUris
are returned, use the first one asapiEndpoint
.In case of no
endpointUris
are returned, use defaultapiEndpoint
.Gapic Clients are cached per instance on the
SpannerClient
.This feature is disabled by default and is enabled by setting the environment variable to true.
Environment variable to enable this feature:
GOOGLE_CLOUD_SPANNER_ENABLE_RESOURCE_BASED_ROUTING
Closes : #779