fix(bigtable): report swallowed batch flush errors and unacknowledged entries - #18122
fix(bigtable): report swallowed batch flush errors and unacknowledged entries#18122mutianf wants to merge 3 commits into
Conversation
… mutate_rows entries Change-Id: I61a1444656d46f5b8e62aea0d16670dc9115659f
There was a problem hiding this comment.
Code Review
This pull request improves error handling in Google Cloud Bigtable by surfacing exceptions raised during asynchronous flushes in the batcher and ensuring that mutations without response entries in successfully closed streams are treated as incomplete rather than silently dropped. The review feedback points out a potential CancelledError when calling future.exception() on a cancelled future in _batch_completed_callback, suggesting a check for future.cancelled() to avoid unhandled exceptions.
Change-Id: Ib6727718ec0e39dd7aad1298532b5e2e64439070
|
Adding https://github.com/googleapis/google-cloud-python/actions/runs/31780116767
|
parthea
left a comment
There was a problem hiding this comment.
Something is wrong with tests. The duration of unit tests increased from ~ 7 minutes to > 1 hour
|
Hmm I wonder if the fork could be causing the issue? I'm looking into this |
|
The errors seems to be: |
|
I think my fix on the async client broke the test: The async MutateRows operation retries by tracking remaining_indices — the set of entries still needing a response. At the start of each attempt it resets remaining_indices = [] and only re-adds an entry when the server explicitly returns a non-OK status for it. This means that if the stream closes cleanly (gRPC OK) but simply omits the response entry for a mutation, that entry is neither re-queued nor recorded as an error — it's silently treated as successful. Since the server sends one response entry per request entry and the client cannot know the true outcome of an omitted one, assuming success risks reporting a write as applied when it may not have been (silent data loss). The correct behavior is to treat an omitted entry as an unknown outcome: retry it if idempotent, or surface it as a failure otherwise. The catch is that the existing V3 unit tests bake in the old assumption — their mock responses return an entry only for the mutations they care about and let the rest be "omitted = success" (e.g. _mock_response([DeadlineExceeded]) returns a single entry for a 3-entry request). So fixing the omitted-entry handling changes established behavior and breaks |
… batcher fix Change-Id: If379b98672c53286ab3dcb3d788006fbeb027b9c


report swallowed batch flush errors and unacknowledged mutate_rows entries.
Double check if there's any active requests left to avoid incomplete mutations.