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

fix(spanner): remove session from pool upon "not found" refresh failure #9954

Merged
merged 2 commits into from
Sep 30, 2022

Conversation

devbww
Copy link
Contributor

@devbww devbww commented Sep 29, 2022

When the "SELECT 1" session-refresh query fails with "Session not found", remove the bad session from the pool, if possible. Previously we did nothing because (1) it shouldn't happen, and (2) we have other mechanisms in place to deal with bad sessions (which must remain). But it is better dealt with directly if we can.

Fixes #4026.


This change is Reviewable

When the "SELECT 1" session-refresh query fails with "Session not found",
remove the bad session from the pool, if possible.  Previously we did
nothing because (1) it shouldn't happen, and (2) we have other mechanisms
in place to deal with bad sessions (which must remain).  But it is better
dealt with directly if we can.

Fixes googleapis#4026.
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Sep 29, 2022
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 4b86029cd384efc64a371f36cc6e096b528e3fa3

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Base: 94.21% // Head: 94.21% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (50e7894) compared to base (5291bb8).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9954   +/-   ##
=======================================
  Coverage   94.21%   94.21%           
=======================================
  Files        1497     1497           
  Lines      140428   140489   +61     
=======================================
+ Hits       132301   132362   +61     
  Misses       8127     8127           
Impacted Files Coverage Δ
google/cloud/spanner/internal/session_pool.h 100.00% <ø> (ø)
google/cloud/spanner/internal/session_pool.cc 90.55% <100.00%> (+0.63%) ⬆️
google/cloud/spanner/internal/session_pool_test.cc 99.73% <100.00%> (+0.03%) ⬆️
...le/cloud/internal/default_completion_queue_impl.cc 96.59% <0.00%> (-0.57%) ⬇️
google/cloud/pubsub/samples/samples.cc 90.70% <0.00%> (-0.08%) ⬇️
google/cloud/storage/parallel_upload.cc 98.61% <0.00%> (+0.34%) ⬆️
...integration_tests/schema_admin_integration_test.cc 100.00% <0.00%> (+1.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 50e78948d08f2087cf42ca43ba8eb479bfd1b118

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@devbww devbww marked this pull request as ready for review September 29, 2022 21:37
@devbww devbww requested a review from a team as a code owner September 29, 2022 21:37
});
auto handler =
[pool, session_name = refresh.second](
future<StatusOr<google::spanner::v1::ResultSet>> result) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: use auto result

@devbww devbww merged commit 779207a into googleapis:main Sep 30, 2022
@devbww devbww deleted the session-refresh branch September 30, 2022 02:57
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.

remove the Session from the allocation pool if refresh fails with "not found"
3 participants