Skip to content

feat(bigtable): add traffic diverter and table shim for bigtable#14633

Merged
sushanb merged 5 commits into
googleapis:mainfrom
sushanb:diverter
May 30, 2026
Merged

feat(bigtable): add traffic diverter and table shim for bigtable#14633
sushanb merged 5 commits into
googleapis:mainfrom
sushanb:diverter

Conversation

@sushanb

@sushanb sushanb commented May 22, 2026

Copy link
Copy Markdown
Contributor

We will read the ClientConfig and call Diverter for how much load we will use for session.
We will use TableShim for diverting traffic between classic and session impl.

@sushanb sushanb requested review from mutianf and nimf May 22, 2026 18:48
@sushanb sushanb requested review from a team as code owners May 22, 2026 18:48
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the Bigtable API. label May 22, 2026

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

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.

Code Review

This pull request introduces a Diverter utility in the bigtable/internal/transport package to probabilistically determine whether to use a session-based or classic protocol. The implementation uses atomic operations for thread-safe load updates and includes comprehensive tests covering edge cases, probabilistic accuracy, and concurrent access. Feedback was provided regarding the package naming, suggesting that it should be changed from internal to transport to align with the directory structure.

Comment thread bigtable/internal/transport/diverter.go
Comment thread bigtable/internal/transport/diverter_test.go
@sushanb sushanb changed the title feat(bigtable): add traffic diverter for bigtable feat(bigtable): add traffic diverter and table shim for bigtable May 22, 2026

@nimf nimf left a comment

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.

Looks good but I don't think we need a fallback from session to classic (except for unimplemented error, but in java I think we have it in a different place, worth double checking), because otherwise we'll be doubling our RPC calls in case of not found / server errors.

@sushanb

sushanb commented May 23, 2026

Copy link
Copy Markdown
Contributor Author

Looks good but I don't think we need a fallback from session to classic (except for unimplemented error, but in java I think we have it in a different place, worth double checking), because otherwise we'll be doubling our RPC calls in case of not found / server errors.

removed the fallback in this layer for now.

@sushanb sushanb requested a review from nimf May 23, 2026 04:48
@sushanb sushanb merged commit 2f3c918 into googleapis:main May 30, 2026
17 checks passed
bhshkh added a commit that referenced this pull request Jun 10, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.20.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:b7e38e80d677dc6b7266896bb99a33fa62348d3e39d7b8f2f6423e7dc4b35a60
<details><summary>bigtable: v1.49.0</summary>

##
[v1.49.0](bigtable/v1.48.0...bigtable/v1.49.0)
(2026-06-10)

### Features

* enable new auth library and remove async refresh (#19943)
([0d3697b](0d3697b2))

* add traffic diverter and table shim for bigtable (#14633)
([2f3c918](2f3c9184))

* add virtual RPC descriptors (#14648)
([5eedda1](5eedda18))

* add opensession descriptors for bigtable (#14647)
([8968f4f](8968f4fd))

* update API sources and regenerate (#14701)
([a9b7921](a9b79215))

### Bug Fixes

* retry unexpected EOF errors (#13157)
([2b4ac42](2b4ac429))

* disable dynamic channel pool by default and raise default pool size to
10 (#19945)
([5ddf8d4](5ddf8d46))

* raise default connection-recycler MaxAge to 7 days (#19940)
([a7959ef](a7959efc))

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants