Skip to content

V3 spanner mux session default#15934

Draft
scotthart wants to merge 5 commits intogoogleapis:prepare-for-v3.0.0from
scotthart:v3_spanner_mux_session_default
Draft

V3 spanner mux session default#15934
scotthart wants to merge 5 commits intogoogleapis:prepare-for-v3.0.0from
scotthart:v3_spanner_mux_session_default

Conversation

@scotthart
Copy link
Member

@scotthart scotthart commented Feb 4, 2026

This change is Reviewable

@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 introduces a significant change to the Google Cloud Spanner C++ client library by making multiplexed sessions the default operational mode. This streamlines the user experience by eliminating the need for explicit configuration of multiplexing and deprecating various session pool options that are no longer relevant. The changes also include comprehensive updates to tests and examples to ensure they align with this new default behavior, enhancing code consistency and maintainability.

Highlights

  • Default Multiplexed Sessions: Multiplexed sessions are now enabled by default in the Google Cloud Spanner C++ client library, simplifying session management for users.
  • Deprecation of Session Pool Options: Several session pool configuration options, such as minimum/maximum sessions, action on exhaustion, and keep-alive interval, have been deprecated as they are no longer applicable with the default multiplexed session behavior.
  • Test and Example Alignment: Spanner tests and examples have been updated to reflect the new default, removing explicit multiplexed session enablement and adapting to the single multiplexed session model, along with general cleanup of irrelevant session pool tests.
  • C++ Style Refinement: A minor C++ style change was applied in Bigtable snippets, modifying a function parameter to be passed by const& for better practice.
Changelog
  • google/cloud/bigtable/examples/table_admin_snippets.cc
    • Changed BigtableTableAdminClient admin to BigtableTableAdminClient const& admin in WaitForConsistencyCheck function signature and a lambda.
  • google/cloud/spanner/README.md
    • Added includes for disabling and re-enabling deprecation warnings around the quickstart code snippet.
  • google/cloud/spanner/admin/integration_tests/backup_extra_integration_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/admin/integration_tests/backup_integration_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/benchmarks/multiple_rows_cpu_benchmark.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/benchmarks/single_row_throughput_benchmark.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/client.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/client_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/commit_options.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/connection.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/integration_tests/client_integration_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/integration_tests/client_stress_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/integration_tests/data_types_integration_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/integration_tests/session_pool_integration_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/connection_impl.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/defaults.cc
    • Enabled multiplexed sessions by default using spanner::EnableMultiplexedSessionOption.
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/defaults_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/partial_result_set_resume_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/partial_result_set_source.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/partial_result_set_source_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/route_to_leader.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/route_to_leader_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/session_pool.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/internal/session_pool_test.cc
    • Removed unused TextFormat, StrictMock, and UnorderedElementsAre using declarations.
    • Removed MakeSessionsResponse helper function.
    • Updated MakeTestSessionPool calls to remove explicit EnableMultiplexedSessionOption setting.
    • Modified test cases to use pool->Multiplexed() instead of pool->Allocate().
    • Changed BatchCreateSessions expectations to CreateSession with IsMultiplexed() matcher.
    • Removed several tests related to non-multiplexed session pool behavior (e.g., ReleaseBadSession, Lifo, MinSessionsEagerAllocation, MaxSessionsFailOnExhaustion, SessionRefresh).
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/options.h
    • Deprecated EnableMultiplexedSessionOption as multiplexed sessions are now always enabled.
    • Deprecated SessionPoolMinSessionsOption, SessionPoolMaxSessionsPerChannelOption, SessionPoolMaxIdleSessionsOption, ActionOnExhaustion enum, SessionPoolActionOnExhaustionOption, and SessionPoolKeepAliveIntervalOption as they are not used with multiplexed sessions.
    • Updated SessionPoolOptionList to remove the deprecated options.
  • google/cloud/spanner/partition_options.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/query_options.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/query_options_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/query_partition.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/query_partition_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/quickstart/quickstart.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/read_options.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/read_partition.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/read_partition_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/results_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/samples/client_samples.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/samples/graph_samples.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/samples/mock_execute_query.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/samples/postgresql_samples.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/samples/samples.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/session_pool_options_test.cc
    • Added includes for disabling and re-enabling deprecation warnings.
  • google/cloud/spanner/transaction.cc
    • Added includes for disabling and re-enabling deprecation warnings.
Activity
  • No human activity (comments, reviews, etc.) has been recorded for this pull request yet.
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 updates the Spanner client to enable multiplexed sessions by default, deprecating several session pool options that are no longer relevant in this new model. It also includes minor C++ style improvements in Bigtable examples and adjusts Spanner tests to reflect the new session management strategy. The changes are consistent with the goal of simplifying session handling by making multiplexed sessions the standard.

@scotthart scotthart force-pushed the v3_spanner_mux_session_default branch from bab8f40 to 8b3bd0b Compare February 5, 2026 22:49
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

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

Additional details and impacted files
@@                  Coverage Diff                   @@
##           prepare-for-v3.0.0   #15934      +/-   ##
======================================================
- Coverage               92.79%   92.62%   -0.18%     
======================================================
  Files                    2332     2332              
  Lines                  214386   213386    -1000     
======================================================
- Hits                   198946   197651    -1295     
- Misses                  15440    15735     +295     

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

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.

1 participant