Skip to content

impl(spanner): add transaction to channel affinity for multiplexed sesssions#15261

Merged
scotthart merged 1 commit intogoogleapis:mainfrom
scotthart:spanner_multiplexed_channel_affinity_2
Jul 10, 2025
Merged

impl(spanner): add transaction to channel affinity for multiplexed sesssions#15261
scotthart merged 1 commit intogoogleapis:mainfrom
scotthart:spanner_multiplexed_channel_affinity_2

Conversation

@scotthart
Copy link
Copy Markdown
Member

@scotthart scotthart commented Jul 10, 2025

fixes #15220


This change is Reviewable

@scotthart scotthart requested a review from a team July 10, 2025 19:32
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Jul 10, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 87.01299% with 20 lines in your changes missing coverage. Please review.

Project coverage is 92.92%. Comparing base (81c1d01) to head (d267ddc).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
google/cloud/spanner/internal/connection_impl.cc 76.19% 10 Missing ⚠️
google/cloud/spanner/internal/session_pool.cc 62.50% 6 Missing ⚠️
...le/cloud/spanner/internal/transaction_impl_test.cc 95.69% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15261      +/-   ##
==========================================
- Coverage   92.93%   92.92%   -0.01%     
==========================================
  Files        2394     2394              
  Lines      215384   215461      +77     
==========================================
+ Hits       200163   200225      +62     
- Misses      15221    15236      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +676 to +681
std::shared_ptr<SpannerStub> stub;
if (session->is_multiplexed()) {
stub = session_pool_->GetStub(*session, ctx);
} else {
stub = session_pool_->GetStub(*session);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same code to get stub appears multiple times, maybe we can consider to make a helper function.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call. I will look into doing that as part of the next multiplexed session PR.

Copy link
Copy Markdown
Member Author

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @cuiy0006)

Comment on lines +676 to +681
std::shared_ptr<SpannerStub> stub;
if (session->is_multiplexed()) {
stub = session_pool_->GetStub(*session, ctx);
} else {
stub = session_pool_->GetStub(*session);
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call. I will look into doing that as part of the next multiplexed session PR.

@scotthart scotthart merged commit 6b004d9 into googleapis:main Jul 10, 2025
78 of 79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add Channel Affinity for Spanner Multiplexed Sessions

2 participants