You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3c15c5c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(bigtable): resolve session diversion through a single shared rule
Follow-up to #14681. Three issues found reviewing the merged change.
1. The per-RPC diversion decision (DivertingUnaryCallable.resolveSessionLoad)
and the client-wide "are sessions in use at all" decision
(ClientConfigurationManager.divertsAnyTrafficToSessions) implemented two
different, drifting rules. The client-wide one was the more permissive:
it ORed the deprecated flat session_load with the diversion config and
scanned every scope key, including methods no DivertingUnaryCallable asks
for. So a config such as
per_scope_diversion { "method:Bigtable.MutateRows": {session_load: 1.0} }
made areSessionsRequired() true, flipping the sessions_required /
sessions_compatible feature flags advertised to the server and keeping the
session config and channel pool alive, while not a single request was ever
diverted.
Both now go through SessionScope, which owns the list of scopes this client
actually serves, whether each honours the deprecated flat session_load, and
the one resolution rule. The disagreement is no longer representable.
2. The default client config carried a zero-valued per_scope_diversion for
ReadRow and MutateRow. A diversion configuration is authoritative once
present, so those entries shadowed the flat session_load for every scope in
any config derived from the default: the initial config before the first
GetClientConfiguration response, the handleFailedFetch fallback when the
validity window expires, and anything merged from the
bigtable.internal.client-config-override sys-prop. The entries were purely
documentary (an absent key and an absent config both resolve to 0), so they
are removed.
3. ReadModifyWriteRow on the session path extracted its row with
`r.hasRow() ? r.getRow() : null`, so a response without a row handed user
code a null that the classic path never produces. Unlike ReadRow, where a
missing key legitimately means null, ReadModifyWriteRow always mutates and
always yields a row, so it now extracts unconditionally.
Also forwards the per-method retry settings to the default call context for
CheckAndMutateRow and ReadModifyWriteRow, matching ReadRow and MutateRow.
Change-Id: Ifa30efb0e07cf07495d753200bfec6d277f0e5e9
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImpl.java
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/DivertingUnaryCallable.java
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManager.java
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImplTest.java
0 commit comments