Repository navigation
fix(bigtable): ignore blank client-config-override and enforce IT protocol - #15206
Merged
Merged
Conversation
…tocol Fixes a bug where setting `-Dbigtable.internal.client-config-override=""` (as maven-failsafe-plugin does when the property is declared empty in pom.xml) caused ClientConfigurationManager to treat the empty string as an active local override instead of polling GetClientConfiguration. Also strengthens Bigtable integration test protocol & transport assertions: - ClientConfigurationManager: treat blank `bigtable.internal.client-config-override` values as unset so default IT runs poll `GetClientConfiguration`. - CloudEnv: skip the remote-address IP check for `GetClientConfiguration` under `REQUIRE_DIRECT_PATH` / `REQUIRE_DIRECT_PATH_IPV4` (since `GetClientConfiguration` always uses CloudPath regardless of data transport), while keeping the check under `REQUIRE_CFE`. - AbstractTestEnv / CloudEnv / pom.xml: add `-Dbigtable.expected-protocol` (`ANY` | `CLASSIC` | `SESSION`), enforce resolved session config in `CloudEnv.start()`, and attach a suite-wide protocol enforcement interceptor blocking `Bigtable/Open*` under `CLASSIC` and classic `MutateRow`, `CheckAndMutateRow`, `ReadModifyWriteRow`, and single-point `ReadRows` (`rows_limit == 1`) under `SESSION`. - SessionIT: gate `assume()` on `ExpectedProtocol.SESSION` so partial-ramp environments (e.g. 50% diversion) do not flake. - `.kokoro/presubmit/bigtable-integration.cfg`: pass `-Dbigtable.expected-protocol=CLASSIC` for the prod default presubmit.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to enforce and verify the expected protocol (CLASSIC or SESSION) during integration testing. It adds a new bigtable.expected-protocol system property, updates test configurations, and implements a ProtocolEnforcementInterceptor in CloudEnv to block invalid RPCs based on the expected protocol. Additionally, it ensures blank system property overrides are ignored in ClientConfigurationManager. The review feedback suggests normalizing the protocol string to uppercase in AbstractTestEnv.parseExpectedProtocol to make the configuration more robust against lowercase or mixed-case inputs.
…e javax.annotation.Nullable
nimf
approved these changes
Nov 24, 2026
igorbernstein2
added a commit
that referenced
this pull request
Nov 24, 2026
…ofile (#15215) Follow-up to #15181 and #15206 (which were branched independently before merging). Sets `<bigtable.expected-protocol>CLASSIC</bigtable.expected-protocol>` in the `bigtable-classic-it` Maven profile so `Classic CFE` and `Classic DirectPath` integration test runs enforce the classic protocol via `CloudEnv`'s startup check and `ProtocolEnforcementInterceptor`, matching `bigtable-session-it` (`SESSION`) and prod `Default` (`CLASSIC`). ## Verification - Verified `mvn help:effective-pom -P bigtable-cfe-it,bigtable-classic-it` resolves `bigtable.expected-protocol=CLASSIC` in `maven-failsafe-plugin`'s `cfe-it` execution.
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.
Summary
Fixes a bug where Maven Failsafe's empty
-Dbigtable.internal.client-config-override=""bypassedGetClientConfigurationpolling on default integration test runs, and adds suite-wide protocol enforcement (-Dbigtable.expected-protocol) for Bigtable integration tests.Changes
bigtable.internal.client-config-override(ClientConfigurationManager):.filter(str -> !str.trim().isEmpty())) so empty default<properties>inpom.xmlare treated as unset and default IT runs genuinely pollGetClientConfiguration.testBlankSysPropOverrideIsIgnoredAndPollsServerinClientConfigurationManagerTest.GetClientConfigurationin DirectPath remote-address check (CloudEnv):REQUIRE_DIRECT_PATH/REQUIRE_DIRECT_PATH_IPV4, skip the remote IP check forGetClientConfigurationsinceClientConfigurationManageralways polls over CloudPath regardless of data transport.GetClientConfigurationunderREQUIRE_CFEsoShimImpl's DirectAccess probe over DirectPath continues to be rejected and forces CFE.AbstractTestEnv,CloudEnv,pom.xml,.kokoro/presubmit/bigtable-integration.cfg):-Dbigtable.expected-protocol(ANY|CLASSIC|SESSION), defaulting toANYwhen unset/blank, set toSESSIONinbigtable-session-it, and passed asCLASSICin.kokoro/presubmit/bigtable-integration.cfg(follow-up: addCLASSICtobigtable-classic-itonce ci(bigtable): add bigtable-classic-it profile and use it in CFE/DirectPath presubmits #15181 merges).CloudEnv.start()viaverifyExpectedProtocol(...).ConnectionMode.DEFAULT):CLASSIC: aborts anyBigtable/Open*RPC withStatus.FAILED_PRECONDITION.SESSION: aborts classicMutateRow,CheckAndMutateRow,ReadModifyWriteRow, and single-pointReadRows(rows_limit == 1with single key or equal closed-closed range) withStatus.FAILED_PRECONDITION, leaving bulk/rangeReadRowsandMutateRowsunblocked.CloudEnvTestcovering protocol parsing, startup validation, remote-address skipping, and protocol enforcement.SessionITonExpectedProtocol.SESSION:SessionIT'sassume()fromisSessionsEnabled()togetExpectedProtocol() == ExpectedProtocol.SESSIONso environments mid-ramp (e.g. 50% diversion) don't flake onceGetClientConfigurationpolling is restored.Verification
mvn com.spotify.fmt:fmt-maven-plugin:formatmvn help:effective-pomforbigtable-prod-it,bigtable-prod-it -Dbigtable.expected-protocol=CLASSIC, andbigtable-cfe-it,bigtable-session-itmvn test -Dtest=CloudEnvTest,ClientConfigurationManagerTest(34/34 passed, 0 Checkstyle violations)