feat(bigtable): add traffic diverter and table shim for bigtable#14633
Conversation
There was a problem hiding this comment.
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.
nimf
left a comment
There was a problem hiding this comment.
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. |
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>
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.