-
Notifications
You must be signed in to change notification settings - Fork 144
chore(spanner): implement dynamic channel pooling and transaction affinity #6728
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
Changes from all commits
d82af44
70b79d8
deb0bbb
98920dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -168,7 +168,7 @@ impl BatchReadOnlyTransaction { | |||||||||
| .partition_query( | ||||||||||
| request, | ||||||||||
| crate::RequestOptions::default(), | ||||||||||
| self.inner.context.channel_hint, | ||||||||||
| self.inner.context.affinity(), | ||||||||||
| ) | ||||||||||
| .await?; | ||||||||||
|
|
||||||||||
|
|
@@ -231,7 +231,7 @@ impl BatchReadOnlyTransaction { | |||||||||
| .partition_read( | ||||||||||
| request, | ||||||||||
| crate::RequestOptions::default(), | ||||||||||
| self.inner.context.channel_hint, | ||||||||||
| self.inner.context.affinity(), | ||||||||||
| ) | ||||||||||
| .await?; | ||||||||||
|
|
||||||||||
|
|
@@ -405,15 +405,11 @@ impl Partition { | |||||||||
| req: &ExecuteSqlRequest, | ||||||||||
| gax_options: GaxRequestOptions, | ||||||||||
| ) -> crate::Result<ResultSet> { | ||||||||||
| let channel_hint = client.next_channel_hint(); | ||||||||||
| let gax_options = client.attach_request_id(gax_options, channel_hint); | ||||||||||
| let builder = client.execute_streaming_sql(req.clone(), gax_options, None); | ||||||||||
| let actual_gax_options = builder.options().clone(); | ||||||||||
| let (stream, attempt_start_time) = | ||||||||||
| Self::execute_partition_stream(client, "ExecuteStreamingSql", || { | ||||||||||
| client | ||||||||||
| .execute_streaming_sql(req.clone(), gax_options.clone(), channel_hint) | ||||||||||
| .send() | ||||||||||
| }) | ||||||||||
| .await?; | ||||||||||
| Self::execute_partition_stream(client, "ExecuteStreamingSql", move || builder.send()) | ||||||||||
|
olavloite marked this conversation as resolved.
|
||||||||||
| .await?; | ||||||||||
|
olavloite marked this conversation as resolved.
olavloite marked this conversation as resolved.
Comment on lines
+411
to
+412
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Since the stream builder (
Suggested change
|
||||||||||
|
|
||||||||||
| ResultSet::create(ResultSetParams { | ||||||||||
| stream, | ||||||||||
|
|
@@ -428,8 +424,7 @@ impl Partition { | |||||||||
| session_name: req.session.clone(), | ||||||||||
| transaction_tag: None, | ||||||||||
| operation: StreamOperation::Query(req.clone()), | ||||||||||
| channel_hint, | ||||||||||
| gax_options, | ||||||||||
| gax_options: actual_gax_options, | ||||||||||
|
olavloite marked this conversation as resolved.
|
||||||||||
| method_name: "ExecuteStreamingSql", | ||||||||||
| attempt_start_time: Some(attempt_start_time), | ||||||||||
| operation_start_time: Some(attempt_start_time), | ||||||||||
|
|
@@ -443,15 +438,10 @@ impl Partition { | |||||||||
| req: &ReadRequest, | ||||||||||
| gax_options: GaxRequestOptions, | ||||||||||
| ) -> crate::Result<ResultSet> { | ||||||||||
| let channel_hint = client.next_channel_hint(); | ||||||||||
| let gax_options = client.attach_request_id(gax_options, channel_hint); | ||||||||||
| let builder = client.streaming_read(req.clone(), gax_options, None); | ||||||||||
| let actual_gax_options = builder.options().clone(); | ||||||||||
| let (stream, attempt_start_time) = | ||||||||||
| Self::execute_partition_stream(client, "StreamingRead", || { | ||||||||||
| client | ||||||||||
| .streaming_read(req.clone(), gax_options.clone(), channel_hint) | ||||||||||
| .send() | ||||||||||
| }) | ||||||||||
| .await?; | ||||||||||
| Self::execute_partition_stream(client, "StreamingRead", move || builder.send()).await?; | ||||||||||
|
olavloite marked this conversation as resolved.
olavloite marked this conversation as resolved.
olavloite marked this conversation as resolved.
olavloite marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the
Suggested change
|
||||||||||
|
|
||||||||||
| ResultSet::create(ResultSetParams { | ||||||||||
| stream, | ||||||||||
|
|
@@ -466,8 +456,7 @@ impl Partition { | |||||||||
| session_name: req.session.clone(), | ||||||||||
| transaction_tag: None, | ||||||||||
| operation: StreamOperation::Read(req.clone()), | ||||||||||
| channel_hint, | ||||||||||
| gax_options, | ||||||||||
| gax_options: actual_gax_options, | ||||||||||
|
olavloite marked this conversation as resolved.
|
||||||||||
| method_name: "StreamingRead", | ||||||||||
| attempt_start_time: Some(attempt_start_time), | ||||||||||
| operation_start_time: Some(attempt_start_time), | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.