Skip to content

feat(spanner): Add E2E fallback to the spanner client.#13518

Merged
rahul2393 merged 12 commits intogoogleapis:mainfrom
kinsaurralde:eef
Mar 17, 2026
Merged

feat(spanner): Add E2E fallback to the spanner client.#13518
rahul2393 merged 12 commits intogoogleapis:mainfrom
kinsaurralde:eef

Conversation

@kinsaurralde
Copy link
Contributor

Adding E2E fallback will allow spanner clients to fallback to cloudpath when directpath is unavailable

@kinsaurralde kinsaurralde requested review from a team December 29, 2025 18:01
@kinsaurralde kinsaurralde requested a review from a team as a code owner December 29, 2025 18:01
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kinsaurralde, 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 critical reliability feature for the Spanner client by implementing an end-to-end fallback mechanism. This allows the client to seamlessly transition from using "directpath" to "cloudpath" when "directpath" becomes unavailable, significantly enhancing the client's resilience and ensuring continuous operation without manual intervention.

Highlights

  • E2E Fallback Mechanism: Implemented an end-to-end fallback mechanism for the Spanner client, enabling it to switch from "directpath" to "cloudpath" if "directpath" is unavailable.
  • FallbackWrapper Introduction: Introduced a new fallbackWrapper struct that encapsulates grpcgcp.GCPFallback along with primary and fallback connection pools, managing their lifecycle.
  • Conditional Fallback Activation: Modified the newClientWithConfig function to conditionally enable the fallback logic based on the GOOGLE_SPANNER_ENABLE_GCP_FALLBACK environment variable and isDirectPathEnabled.
  • Dependency Update: Updated the grpc-gcp-go/grpcgcp dependency to version v1.6.0 to support the new fallback features.
  • Session Client Integration: Updated the sessionClient.nextClient method to correctly handle the newly introduced fallbackWrapper type for connection management.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

@kinsaurralde kinsaurralde changed the title [feat] Add E2E fallback to the spanner client. feat(spanner): Add E2E fallback to the spanner client. Dec 29, 2025
Copy link
Contributor

@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 introduces a fallback mechanism for the Spanner client, allowing it to switch from DirectPath to CloudPath when DirectPath is unavailable. This is a valuable feature. However, the current implementation has several critical issues, including potential panics from nil pointer dereferences, resource leaks due to improper connection handling in error paths, and incorrect error propagation. I've provided specific comments and suggestions to address these issues to ensure the stability and correctness of the new fallback logic.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Dec 30, 2025
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 26, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 26, 2026
@kinsaurralde kinsaurralde requested review from a team as code owners March 4, 2026 22:39
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 5, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 5, 2026
@rahul2393 rahul2393 enabled auto-merge (squash) March 9, 2026 04:01
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 10, 2026
@rahul2393
Copy link
Contributor

@kinsaurralde can you please fix the conflict?

auto-merge was automatically disabled March 13, 2026 04:35

Head branch was pushed to by a user without write access

@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 13, 2026
@rahul2393 rahul2393 enabled auto-merge (squash) March 13, 2026 06:28
auto-merge was automatically disabled March 16, 2026 02:59

Head branch was pushed to by a user without write access

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 16, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 16, 2026
@rahul2393 rahul2393 merged commit 16af6a1 into googleapis:main Mar 17, 2026
10 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.

4 participants