Repository navigation
fix(bigtable): deprecate no-op FailedMutation add - #16646
Conversation
BulkMutation::emplace_back(FailedMutation) does not retain or re-add the original mutation payload to the underlying MutateRowsRequest, causing retry batches built from FailedMutation objects to short-circuit as empty and silently drop writes. Mark BulkMutation::emplace_back(FailedMutation) deprecated while preserving ABI compatibility, emit a GCP_LOG(ERROR) diagnostic if called at runtime, and update stale Doxygen comments on FailedMutation and PermanentMutationFailure::failures().
There was a problem hiding this comment.
Code Review
This pull request deprecates the BulkMutation::emplace_back(FailedMutation) overload in the Cloud Bigtable library, as FailedMutation no longer retains the original mutation payload. The method is now a no-op that logs an error, and documentation has been updated to instruct users to use FailedMutation::original_index() to look up and re-add the original SingleRowMutation. Unit tests have been added to verify this deprecated behavior and demonstrate the correct pattern for resending failed mutations. I have no feedback to provide as there are no review comments to assess.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16646 +/- ##
=======================================
Coverage 92.51% 92.52%
=======================================
Files 2269 2269
Lines 222804 222843 +39
=======================================
+ Hits 206126 206177 +51
+ Misses 16678 16666 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Deprecate the no-op
BulkMutation::emplace_back(FailedMutation)overload, log an error if invoked at runtime, and updateFailedMutation/PermanentMutationFailureDoxygen comments.Motivation
FailedMutationstores only the failureStatusandoriginal_index()—it does not retain theSingleRowMutationpayload. Consequently,BulkMutation::emplace_back(FailedMutation)did not append an entry torequest_. Callers building a retryBulkMutationfromFailedMutationresults produced an empty batch (empty() == true), causingBulkApply/AsyncBulkApplyto return{}immediately without sending an RPC and silently dropping the failed writes.Changes
BulkMutation::emplace_back(FailedMutation)withGOOGLE_CLOUD_CPP_DEPRECATED(...)while preserving ABI compatibility, and emit aGCP_LOG(ERROR)diagnostic includingoriginal_index()if called.FailedMutationandPermanentMutationFailure::failures()to document usingoriginal_index()with the originalSingleRowMutationlist.mutations_test.ccverifying the deprecation diagnostic and retry-batch construction viaoriginal_index().Validation
bazel test //google/cloud/bigtable:mutations_test