Skip to content

fix(bigtable): enforce batcher outstanding limit - #16649

Merged
sushanb merged 1 commit into
googleapis:mainfrom
sushanb:fix/bigtable-mutation-batcher-max-outstanding-size
Nov 10, 2026
Merged

sushanb merged 1 commit into
googleapis:mainfrom
sushanb:fix/bigtable-mutation-batcher-max-outstanding-size

Conversation

@sushanb

@sushanb sushanb commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject SingleRowMutation requests in MutationBatcher::IsValid whose byte size exceeds std::min(options_.max_size_per_batch, options_.max_outstanding_size) (as well as when options_.max_batches == 0) with StatusCode::kInvalidArgument.
  • Prevents admitting a pending mutation larger than max_outstanding_size into pending_mutations_ where CanAppendToBatch can never admit it, which previously stalled all subsequent mutations and AsyncWaitForNoPendingRequests() indefinitely.

Testing

  • Added MutationsExceedingMaxOutstandingSizeAreRejected and ZeroMaxBatchesIsRejected in google/cloud/bigtable/mutation_batcher_test.cc.
  • Verified bazel test //google/cloud/bigtable:mutation_batcher_test.

@sushanb
sushanb requested a review from a team as a code owner November 10, 2026 17:57
@sushanb
sushanb requested a review from scotthart November 10, 2026 17:57
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the Bigtable API. label Nov 10, 2026

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

Copy link
Copy Markdown

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 updates MutationBatcher::IsValid to reject mutations when Options::max_batches is 0, and limits the allowed mutation size to the minimum of max_size_per_batch and max_outstanding_size. It also adds corresponding unit tests to verify these validation rules. I have no feedback to provide as the changes are correct and conform to the repository style guide.

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.53%. Comparing base (5dcdef5) to head (771b51b).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16649      +/-   ##
==========================================
- Coverage   92.53%   92.53%   -0.01%     
==========================================
  Files        2269     2269              
  Lines      222896   222947      +51     
==========================================
+ Hits       206250   206294      +44     
- Misses      16646    16653       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Reject SingleRowMutation requests whose byte size exceeds Options::max_outstanding_size (as well as Options::max_batches == 0) up front with INVALID_ARGUMENT instead of enqueuing an un-admittable pending mutation that permanently stalls pending_mutations_ and AsyncWaitForNoPendingRequests().
@sushanb
sushanb force-pushed the fix/bigtable-mutation-batcher-max-outstanding-size branch from 1ddde01 to 771b51b Compare November 10, 2026 19:27
@sushanb
sushanb merged commit a286534 into googleapis:main Nov 10, 2026
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo