Repository navigation
feat: Session support for mutateRows - #14644
alexoneill wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for mutateRows (bulk mutations) across the Bigtable client's async API and compatibility layers, including TableAsync, AuthorizedViewAsync, and TableBase, along with a new MutateRowsShim implementation. The review feedback suggests importing com.google.common.base.Preconditions and adding a defensive null check for the client parameter in the MutateRowsShim constructor to ensure object integrity.
57573a1 to
85c58c9
Compare
85c58c9 to
e2111ee
Compare
mutianf
left a comment
There was a problem hiding this comment.
We're returning RateLimitInfo in SessionMutateRowsResponse, but nothing checks / uses it in the session client path?
| return sessionMap.apply( | ||
| (AuthorizedViewId) targetId, | ||
| SessionKey.Permission.WRITE, | ||
| v -> v.mutateRows(innerReq, deadline).thenApply(r -> null)); |
There was a problem hiding this comment.
Hmm, I think this only reports RPC level status? if there are entry level failures it'll get silently dropped?
There was a problem hiding this comment.
Good catch — fixed in 7633592:
- Added
MutateRowsRetryingVRpcininternal.middleware(wired inTableBase.mutateRows) to handle partial entry-level retries on the session path: transient entry errors (DEADLINE_EXCEEDED,UNAVAILABLE) are retried only for idempotent entries while locking in priorOK/ permanent entry outcomes and remapping indices back to0..N-1(plus recording missing response indices as permanentINTERNALerrors). - Updated
MutateRowsShim/Shim.decorateMutateRowsto returnMutateRowsAttemptResult(and translate whole-vRPC failures intoMutateRowsException, preserved intact byDivertingUnaryCallable.translateException), and movedsessionShim.decorateMutateRowsintoEnhancedBigtableStub.createMutateRowsBaseCallable()so bothbulkMutateRowsandBatcher(newMutateRowsBatcher) have full entry-error parity with the classic path.
| req.getEntriesList().stream() | ||
| .flatMap(entry -> entry.getMutationsList().stream()) | ||
| .collect(toImmutableList()); | ||
| boolean idempotent = Util.isIdempotent(mutations); |
There was a problem hiding this comment.
full copy of every mutation to compute one boolean
Util.isIdempotent short-circuits, but toImmutableList() materializes everything first — up to BulkMutation.MAX_MUTATION (100k) references per call on the hot path. Use flatMap(...).allMatch(...) or a nested loop with early return.
There was a problem hiding this comment.
Fixed in 7633592 — replaced the toImmutableList() copy with short-circuiting req.getEntriesList().stream().allMatch(entry -> Util.isIdempotent(entry.getMutationsList())).
…o in SessionMutateRows
|
@mutianf Addressed
|
…LimitInfo in SessionMutateRows" This reverts commit 7633592.
No description provided.