Skip to content

feat(bigtable): support SessionCheckAndMutateRow on the session client - #14464

Draft
mutianf wants to merge 11 commits into
googleapis:mainfrom
mutianf:feat/bigtable-session-check-and-mutate-row
Draft

mutianf wants to merge 11 commits into
googleapis:mainfrom
mutianf:feat/bigtable-session-check-and-mutate-row

Conversation

@mutianf

@mutianf mutianf commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds CheckAndMutateRowShim to route CheckAndMutateRow RPCs through the session client path
  • Wires SessionCheckAndMutateRow support into TableBase, TableAsync, AuthorizedViewAsync, MaterializedViewAsync, ShimImpl, DisabledShim, and EnhancedBigtableStub
  • Adds VRpcDescriptor support and extends ConditionalRowMutation with session-aware targeting
  • supports() returns false for now pending diversion-by-method support

Test plan

  • CheckAndMutateRowShimTest covers the shim logic
  • VRpcDescriptorTest covers descriptor routing
  • ConditionalRowMutationTest covers the new targeting APIs
  • TableBaseTest covers session client dispatch

mutianf added 9 commits July 31, 2026 16:15
Change-Id: Idf64e537c143b94716d8f0ae474f9b3099bdd23c
Change-Id: I6ed7a039e0ad29d253f50484fe83d62584a44a9a
Change-Id: I52860fa3ed2c8e176930a4a35cd8c3125c034852
Introduce VRpcResumptionStrategy so RetryingVRpc can resume a streaming
vRPC after a retryable failure instead of restarting from scratch:

- VRpcResumptionStrategy: per-operation policy with onResponse (record
  progress) and getResumeRequest (narrow the request for the next
  attempt); noOp() preserves the pre-streaming behavior for unary ops.
- SessionReadRowsResumptionStrategy: tracks last delivered key / count
  and narrows the RowSet + rowsLimit on resume (forward and reversed).
- RetryingVRpc: fold Suspended into Idle (an attempt launches only when
  demand is outstanding), guard requestNext on the started flag via a
  DebugTagTracer precondition (request_more_before_start), and complete
  OK when the scan is already fully satisfied — carrying the triggering
  frame's cluster attribution and logging an INFO error_at_end_of_read.
- VRpcResult.createLocalOk now takes cluster info for that attribution.
- TableBase wires noOp() + the debug tracer into the unary ops.

Change-Id: Idfc80ef9cdc9f5378678a0847d9c47d523f0b157
Change-Id: Ie1a0462991c3b14a0f5e629f2e786d59d7e02fc8
…ient layer

Change-Id: I24e8880194f9cebb4d49b14d4e2964c3dd980615
…session

Seed DEFAULT_SESSION_PARAMS with a default softmax_streaming_prefetch_buffer_size
and add SessionImpl.getSoftmaxStreamingPrefetchBufferSize() so the
streaming-response assembly layer can read the server-advertised prefetch budget.
sessionParameters is now volatile so a mid-session SessionParametersResponse
update is visible to readers off the session sync context.

Change-Id: I1b4ec5b05978d7b25de13a91ba854d5920056d52
Fold streaming prefetch into the single VRpcImpl and add the session-side
transport for it, so a vRPC is modeled as a server stream (unary being the
degenerate one-response case).

- VRpcImpl: demand-gated delivery backed by an eager prefetch buffer bounded by
  the live softmax byte budget, one pull (initial request or continue) in flight
  at a time, terminal close on has_more=false, decode/user-callback error
  handling, and idle-stream cancel.
- SessionImpl: continueRpc/cancelRpc transport, has_more terminal detection,
  heartbeat re-arm, and stale-frame discard.
- Gate on VRpcCallContext.autoFlowControl -- the same flag that drives
  requestNext -- so unary ops take an untouched fast path and a bug in the
  streaming machinery cannot affect them.
- Test fake (SessionHandler/FakeDescriptor/fake.proto) gains scripted streaming
  with has_more, continue/cancel, and dynamic softmax updates; SessionImplTest
  covers ordering, byte-budget bounding, decode/user errors, idle cancel, and
  live softmax pickup.

Change-Id: Idb659fdecbf148056c02cf23539afbd028a62a33
…and heartbeat

handleSessionParamsResponse now merges SessionParametersResponse updates
field-by-field, adopting only valid values and keeping the last-known-good
otherwise. A non-positive keep_alive would zero the heartbeat interval and
force-close a healthy stream; a non-positive softmax prefetch budget would
deadlock streaming prefetch (maybeContinue never pulls). Both fields treat
0/unset as "no opinion, keep current" so a malformed update can no longer
wedge the session.

Change-Id: I991b6c4ce22bc8a5bb4490ebbf6f410a66a629f5
@mutianf
mutianf requested review from a team as code owners September 21, 2026 18:28

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for streaming ReadRows and conditional CheckAndMutateRow operations over the session-based data path in the Java Bigtable client. It implements a demand-gated prefetch flow control mechanism for streaming vRPCs, along with a resumption strategy (SessionReadRowsResumptionStrategy) to handle mid-stream failures gracefully. It also adds the necessary shims, descriptors, and session-level handling (continueRpc, cancelRpc) to support these operations across tables, authorized views, and materialized views. I have no feedback to provide as there are no review comments to evaluate.

- README.md: bump version references to 2.83.0
- FeatureFlagsProto.java: take upstream descriptor (adds microsecond_timestamp field + extension registry init)
- SessionImplTest.java: keep jetstream streaming tests; add upstream's missedHeartbeatDeliversUnavailableStatus test

Change-Id: Ia0873342916ba3522688b6a13dac9326469982ad
…sion by method

supports() returns false for now; will be re-enabled once diversion by method is added.

Change-Id: I7d28fd21b55aa45c67a4dd40f903bc1839540852
@mutianf
mutianf marked this pull request as draft September 21, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant