FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(bigtable): report swallowed batch flush errors and unacknowledged entries by mutianf · Pull Request #18122 · googleapis/google-cloud-python · GitHub

fix(bigtable): report swallowed batch flush errors and unacknowledged entries - #18122

Merged
parthea merged 3 commits into
googleapis:mainfrom
mutianf:bigtable-batcher-partial-failure-dataloss
Aug 15, 2026
Merged

fix(bigtable): report swallowed batch flush errors and unacknowledged entries#18122
parthea merged 3 commits into
googleapis:mainfrom
mutianf:bigtable-batcher-partial-failure-dataloss

Conversation

mutianf commented Aug 14, 2026
edited by daniel-sanche
Loading

Copy link
Copy Markdown
Contributor

report swallowed batch flush errors and unacknowledged mutate_rows entries.

Double check if there's any active requests left to avoid incomplete mutations.

… mutate_rows entries

Change-Id: I61a1444656d46f5b8e62aea0d16670dc9115659f
mutianf requested a review from a team as a code owner August 14, 2026 17:52

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

daniel-sanche 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

mutianf enabled auto-merge (squash) August 14, 2026 18:20
parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Aug 14, 2026
yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Aug 14, 2026
daniel-sanche changed the title fix(bigtable): report swallowed batch flush errors and unacknowledged… fix(bigtable): report swallowed batch flush errors and unacknowledged entries Aug 14, 2026

parthea left a comment
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The unit tests seem to be running for more than an hour. Please can you check if it is related to the changes in this PR?

https://github.com/googleapis/google-cloud-python/actions/runs/31826948380/attempts/1?pr=18122

parthea disabled auto-merge August 14, 2026 19:10
parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 14, 2026

parthea commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Adding do not merge to investigate the delay with the unit tests. In the last PR that was merged to packages/google-cloud-bigtable, tests only took 7 minutes

#18112

https://github.com/googleapis/google-cloud-python/actions/runs/31780116767

parthea 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Something is wrong with tests. The duration of unit tests increased from ~ 7 minutes to > 1 hour

Copy link
Copy Markdown
Contributor

Hmm I wonder if the fork could be causing the issue? I'm looking into this

mutianf commented Aug 14, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

The errors seems to be:

 raise exceptions.from_grpc_error(exc) from exc
E           google.api_core.exceptions.ResourceExhausted: 429 Quota exceeded for quota metric 'Instance and cluster metadata write requests' and limit 'Instance and cluster metadata write requests per day' of service 'bigtableadmin.googleapis.com' for consumer 'project_number:'. [reason: "RATE_LIMIT_EXCEEDED"

mutianf commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

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
those tests, which is what surfaced in CI.

… batcher fix

Change-Id: If379b98672c53286ab3dcb3d788006fbeb027b9c
mutianf removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 14, 2026
daniel-sanche requested a review from parthea August 14, 2026 21:06
parthea enabled auto-merge (squash) August 14, 2026 22:03
daniel-sanche added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 15, 2026
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 15, 2026
daniel-sanche added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 15, 2026
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 15, 2026
parthea merged commit 2fe5bdc into googleapis:main Aug 15, 2026
48 checks passed
release-please Bot mentioned this pull request Aug 14, 2026
parthea pushed a commit that referenced this pull request Aug 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.42.0](google-cloud-bigtable-v2.41.0...google-cloud-bigtable-v2.42.0)
(2026-08-19)


### Features

* **bigtable:** client side metrics handlers
([#16760](#16760))
([43b786c](43b786c))
* **bigtable:** initialize internal data client in classic client
([#18080](#18080))
([92008e2](92008e2))


### Bug Fixes

* **bigtable:** data client should acknowledge all mutations in batch
([#18124](#18124))
([e7f6a34](e7f6a34))
* **bigtable:** report swallowed batch flush errors and unacknowledged
entries
([#18122](#18122))
([2fe5bdc](2fe5bdc))
* **bigtable:** standardize client side metrics
([#17899](#17899))
([a69e2cb](a69e2cb))
* **bigtable:** surface batcher flush errors and disable timer
([#18145](#18145))
([fac536e](fac536e))
* bump grpcio to 1.59.0; require Python 3.10+
([#17351](#17351))
([a53487a](a53487a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
mutianf pushed a commit that referenced this pull request Aug 20, 2026
Add warning to upgrade to MutationsBatcher docstrings, related to
#18122
hebaalazzeh pushed a commit that referenced this pull request Aug 21, 2026
In #18122, the
tests would stall without any logs after `Running tests across 1
package(s) using 1 parallel worker(s)...`

This is because the unit test job would wait until tests were complete
before printing outputs, which isn't helpful when a job freezes

This PR attempts to improve the usability of unit tests by:
- showing live logs when PARALLEL_WORKERS is 1
  - this is always the case for unit tests, but mypy runs in parallel
  - parallel jobs still buffer their writes, to avoid overlapping logs
- fail-fast. If one nox session or package fails, the CI worker exits
with an error immediately
- use emojis to designate pass/fail (✅/❌), to make it logs to scan
- added `--no-tags`, to avoid unneeded download and printing

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL