Skip to content

Conversation

@scotthart
Copy link
Member

@scotthart scotthart commented Feb 6, 2026

This PR changes the default Spanner Session type for v3. All sessions are now Multiplexed Sessions and the legacy Session Pool is no longer used. Session Pool specific tests have been removed. The existing Session Pool related Options are now marked deprecated and will be removed in the future. Compiler deprecation warnings have been squelched in spanner files that include the deprecated Options. The remaining inert Session Pool specific code will be removed at a later date.


This change is Reviewable

@scotthart scotthart requested a review from a team as a code owner February 6, 2026 15:30
@gemini-code-assist
Copy link

Summary of Changes

Hello @scotthart, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the Spanner client library by making multiplexed sessions the default and only session type for v3. This change simplifies the client's architecture by removing the legacy session pool and its associated configuration options, leading to a more consistent and efficient session management experience. The update primarily involves deprecating old options, removing legacy test code, and ensuring that existing codebases can gracefully transition by suppressing deprecation warnings.

Highlights

  • Multiplexed Sessions Always Enabled: Spanner v3 now defaults to always-on Multiplexed Sessions, eliminating the need for explicit configuration.
  • Legacy Session Pool Removal: The legacy Session Pool mechanism is no longer utilized, simplifying session management.
  • Deprecated Options: Several Session Pool related options have been marked as deprecated and will be removed in future releases, as they are no longer relevant with multiplexed sessions.
  • Test Refactoring: Tests specific to the legacy Session Pool have been removed or updated to reflect the new multiplexed session behavior.
  • Deprecation Warning Handling: Compiler deprecation warnings for the newly deprecated options are now explicitly squelched in relevant Spanner source files.
Changelog
  • google/cloud/spanner/README.md
    • Added includes to disable and re-enable deprecation warnings around quickstart code snippets.
  • google/cloud/spanner/admin/integration_tests/backup_extra_integration_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/admin/integration_tests/backup_integration_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/benchmarks/multiple_rows_cpu_benchmark.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/benchmarks/single_row_throughput_benchmark.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/client.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/client_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/commit_options.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/connection.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/integration_tests/client_integration_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/integration_tests/client_stress_test.cc
    • Added includes to disable and re-enable deprecation warnings.
    • Added GTEST_SKIP() for UpsertAndSelect and UpsertAndRead tests when running against an emulator, pending emulator updates.
  • google/cloud/spanner/integration_tests/data_types_integration_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/integration_tests/session_pool_integration_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/connection_impl.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/defaults.cc
    • Added includes to disable and re-enable deprecation warnings.
    • Explicitly set spanner::EnableMultiplexedSessionOption to enable multiplexed sessions by default.
  • google/cloud/spanner/internal/defaults_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/partial_result_set_resume_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/partial_result_set_source.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/partial_result_set_source_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/route_to_leader.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/route_to_leader_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/session_pool.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/internal/session_pool_test.cc
    • Removed TextFormat, StrictMock, and UnorderedElementsAre from using declarations.
    • Removed the MakeSessionsResponse helper function.
    • Updated MakeTestSessionPool calls to remove the EnableMultiplexedSessionOption as it is now implicitly enabled.
    • Changed BatchCreateSessions expectations to CreateSession with IsMultiplexed() matcher.
    • Removed numerous tests related to legacy session pool behaviors, including ReleaseBadSession, CreateError (for non-multiplexed), Lifo, MinSessionsEagerAllocation, MinSessionsMultipleAllocations, MaxSessionsFailOnExhaustion, MaxSessionsBlockUntilRelease, Labels (for non-multiplexed), CreatorRole (for non-multiplexed), MultipleChannels, MultipleChannelsPreAllocation, SessionRefresh, and SessionRefreshNotFound.
    • Updated session names in remaining tests from generic 'session1' to 'multiplexed' to align with the new default.
  • google/cloud/spanner/options.h
    • Marked EnableMultiplexedSessionOption as deprecated with the message 'Multiplex Sessions are always enabled'.
    • Marked SessionPoolMinSessionsOption, SessionPoolMaxSessionsPerChannelOption, SessionPoolMaxIdleSessionsOption, ActionOnExhaustion, SessionPoolActionOnExhaustionOption, and SessionPoolKeepAliveIntervalOption as deprecated with the message 'Option not used with Multiplex Sessions'.
    • Updated SessionPoolOptionList to remove the newly deprecated options.
  • google/cloud/spanner/partition_options.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/query_options.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/query_options_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/query_partition.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/query_partition_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/quickstart/quickstart.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/read_options.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/read_partition.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/read_partition_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/results_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/samples/client_samples.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/samples/graph_samples.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/samples/mock_execute_query.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/samples/postgresql_samples.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/samples/samples.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/session_pool_options_test.cc
    • Added includes to disable and re-enable deprecation warnings.
  • google/cloud/spanner/transaction.cc
    • Added includes to disable and re-enable deprecation warnings.
Activity
  • No specific activity (comments, reviews, or progress updates) was provided in the context for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request makes multiplexed sessions the default for Spanner v3, which is a significant and welcome simplification. The changes correctly deprecate the old session pool options and remove a substantial amount of related test code, improving maintainability. The necessary adjustments to enable this by default and suppress deprecation warnings in existing code have been applied broadly. My review includes a couple of minor suggestions to remove commented-out code from tests for better code hygiene.

Copy link
Collaborator

@diegomarquezp diegomarquezp left a comment

Choose a reason for hiding this comment

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

@diegomarquezp reviewed all commit messages.
Reviewable status: 0 of 42 files reviewed, 2 unresolved discussions (waiting on @diegomarquezp and @scotthart).

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.62%. Comparing base (56d7714) to head (e47e68f).
⚠️ Report is 3 commits behind head on prepare-for-v3.0.0.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           prepare-for-v3.0.0   #15941      +/-   ##
======================================================
- Coverage               92.79%   92.62%   -0.18%     
======================================================
  Files                    2332     2332              
  Lines                  214327   213322    -1005     
======================================================
- Hits                   198895   197587    -1308     
- Misses                  15432    15735     +303     

☔ 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.

@scotthart scotthart enabled auto-merge (squash) February 6, 2026 17:30
@scotthart scotthart disabled auto-merge February 6, 2026 19:23
@scotthart scotthart merged commit 54b6476 into googleapis:prepare-for-v3.0.0 Feb 6, 2026
55 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants