feat(bigtable): add explicit instance MakeDataConnection#16191
feat(bigtable): add explicit instance MakeDataConnection#16191scotthart wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new overload of MakeDataConnection that accepts a vector of InstanceResource objects to encourage explicit instance declaration during client initialization, enabling dynamic channel pooling. The previous overload has been deprecated, and examples, benchmarks, and tests have been updated accordingly. The review feedback suggests using std::move on Options objects passed to MakeDataConnection to avoid unnecessary copies, aligning with the repository's style guide.
2850839 to
f2ebcbd
Compare
f2ebcbd to
09e636c
Compare
09e636c to
f70e8fa
Compare
f70e8fa to
6db9498
Compare
| GCP_LOG(INFO) << "Dynamic connection resolution adding new channel pool " | ||
| << "for instance: " << instance_name; |
There was a problem hiding this comment.
This is to help alert users of the new overload that they're sending RPCs to an instance that was not named at time of construction. This may be anticipated behavior for some applications, but may prompt other applications to update the instances named when creating the DataConnection.
| EXPECT_THAT(log.ExtractLines(), | ||
| Contains(HasSubstr( | ||
| "Dynamic connection resolution adding new channel pool"))); |
There was a problem hiding this comment.
comment: deprecating an API that 100% of customers use seems like a big push for an optional feature.
I am sure @igorbernstein2 told you to do it though.
There was a problem hiding this comment.
Replacing the existing fixed connection pool with the dynamic pool is less of an optional feature and more of an evolution of the library. The dynamic pool has performance benefits from channel priming and is more efficient with resources. Deprecating the existing MakeDataConnection helps provide "better defaults" when using the library.

This pull request introduces a new overload of MakeDataConnection that accepts a vector of InstanceResource objects to encourage explicit instance declaration during client initialization, enabling dynamic channel pooling and channel priming. Instances not initially named can be used, but will incur additionally latency on first use as a dynamic channel pool is created for that instance and priming is skipped in favor of immediately sending the RPC.