Repository navigation
BigTable: don't collapse the gRPC channel pool to a single channel - #12917
Merged
Merged
Conversation
Member
|
Inheriting Bigtable’s initial channel count changes the validity of partial existing configurations. For example, Minor follow-up: the new Javadocs say setting |
Channel pool settings were derived from ChannelPoolSettings.builder() -- gax's generic defaults -- rather than the settings the BigTable client library has already tuned. Those defaults set min-rpcs-per-channel=0 and max-rpcs-per-channel=Integer.MAX_VALUE, which makes isStaticSize() return true, so gax never schedules its resize task and the pool stays pinned at initial-channel-count (1) for the lifetime of the client. Since gRPC queues requests locally beyond 100 concurrent RPCs per channel, this silently capped BigTable throughput per Nessie instance and surfaced as DEADLINE_EXCEEDED once the queuing exhausted a request's total timeout. Derive the pool settings from the transport provider already present in the stub settings, overriding only what is explicitly configured. This preserves both the tuned dynamic pool installed by BigtableDataSettings.newBuilder() and the deliberate staticallySized(1) pool installed by newBuilderForEmulator(). preemptive-refresh is now inherited rather than hardcoded to true: a no-op for the real client, and correctly false for the emulator. Also expose the pool settings as bigtable.channelPool in the Helm chart, so they no longer need to go through advancedConfig.
dimas-b
approved these changes
Sep 3, 2026
snazy
added a commit
that referenced
this pull request
Sep 22, 2026
…ackport #12917) (#13065) Channel pool settings were derived from ChannelPoolSettings.builder() -- gax's generic defaults -- rather than the settings the BigTable client library has already tuned. Those defaults set min-rpcs-per-channel=0 and max-rpcs-per-channel=Integer.MAX_VALUE, which makes isStaticSize() return true, so gax never schedules its resize task and the pool stays pinned at initial-channel-count (1) for the lifetime of the client. Since gRPC queues requests locally beyond 100 concurrent RPCs per channel, this silently capped BigTable throughput per Nessie instance and surfaced as DEADLINE_EXCEEDED once the queuing exhausted a request's total timeout. Derive the pool settings from the transport provider already present in the stub settings, overriding only what is explicitly configured. This preserves both the tuned dynamic pool installed by BigtableDataSettings.newBuilder() and the deliberate staticallySized(1) pool installed by newBuilderForEmulator(). preemptive-refresh is now inherited rather than hardcoded to true: a no-op for the real client, and correctly false for the emulator. Also expose the pool settings as bigtable.channelPool in the Helm chart, so they no longer need to go through advancedConfig. Co-authored-by: Alexandre Dutra <adutra@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
BigTableClientsFactory.createDataClient()built its channel-pool settings by starting fromChannelPoolSettings.builder()— gax's generic defaults — and overriding only the properties thathad been explicitly configured. Those generic defaults are:
ChannelPoolSettings.isStaticSize()returnstruewhenminRpcsPerChannel == 0 && maxRpcsPerChannel == Integer.MAX_VALUE, and for a statically sized poolChannelPoolnever schedules its resize task at all:So with nothing configured, every Nessie instance ran one gRPC channel to BigTable, permanently,
and
maxChannelCount = 200was dead configuration. Since gRPC starts queuing requests locallybeyond 100 concurrent RPCs per channel, this silently capped BigTable throughput per instance. Under
a burst the queued RPCs consume the request's total timeout and the call fails with
DEADLINE_EXCEEDED, reported as a small residual deadline on the final gax attempt (a clampedremainder, not a configured timeout — see
ExponentialRetryAlgorithm.createNextAttempt).This also meant each instance held exactly one connection, hence one Google frontend, which makes
"all failing calls resolve to the same frontend IP" an expected consequence rather than a signal.
Change
Derive the pool settings from whatever the BigTable client library has already tuned for the
settings flavour in use, overriding only what is explicitly configured. Verified against
google-cloud-bigtable2.60.0:BigtableDataSettings.newBuilder()installs a dynamically sized pool;newBuilderForEmulator()deliberately installs
ChannelPoolSettings.staticallySized(1). Inheriting preserves the intent ofboth, where deriving from gax's builder discarded both.
Two notes for reviewers:
.setPreemptiveRefreshEnabled(true)is dropped in favour of inheriting it. For thereal client path this is a no-op (the library default is already
true); for the emulator it nowcorrectly stays
false, consistent with the emulator'ssetRefreshingChannel(false). This isseparable from the rest of the change if you would rather keep the explicit call.
channelPoolSettings(...)is extracted as a package-private static method so the behaviour can beunit-tested without constructing a client.
The Helm chart gains a
bigtable.channelPoolblock, so these no longer have to be set throughadvancedConfig.Threat model
This change alters only client-side connection concurrency to BigTable.
The one security-adjacent dimension is resource consumption: instances will now open more
connections to BigTable than before (10 initially rather than 1, growing under load). This is the
BigTable client library's own default and is bounded by
max-channel-count, and it reduces ratherthan increases the availability risk the previous behavior created — the old single-channel cap was
itself a self-inflicted denial-of-service under load. Operators who need the old shape can pin
initial-channel-count=1andmax-channel-count=1, as noted in the changelog upgrade notes.