Repository navigation
fix(bigtable): restore the mutation lifecycle in mutate_rows and DirectRow.commit - #18856
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves mutation handling and error reporting in the Bigtable client. It updates mutate_rows to clear mutations only for successfully applied rows, documents mutation lifecycle behaviors, and introduces _get_status_from_operation_error to unwrap synthetic DeadlineExceeded exceptions and expose the underlying terminal wire errors. Additionally, feedback was provided to use exc.details or [] in _get_status to prevent a potential TypeError in protobuf when exc.details is None.
d80e09f to
7e49603
Compare
…ctRow.commit Change-Id: Ie61267e3c48af161c0a1a0d8d06ee1e68ebb10f9
7e49603 to
403ca01
Compare
Change-Id: Ice21169fa5a2c0063ab5542d94db2eb1b7bccb1f
| # is what commit() has always done. An exception that cannot be turned | ||
| # into a status escapes instead (it did before the reroute too, where | ||
| # clear() ran after mutate_rows returned), and the caller gets no | ||
| # outcome to act on, so the mutations are left in place for them. |
There was a problem hiding this comment.
nit: this comment is a bit long, and it currently reads more like a commit message referencing past states ("before the reroute"). It could be confusing in the future, reviewing the code in isolation
There was a problem hiding this comment.
Good call — reworded so it describes the behaviour rather than the history:
# Clear once a status is produced, success or failure. An error that
# cannot be turned into a status propagates instead, and the mutations
# stay on the row so the caller can retry them.Fixed in 1d27cbb.
Change-Id: I3b960f653adc766c6e703d4da1e95a4e37442546
Table.mutate_rowsdocuments that rows which fail keep their mutations so theycan be applied again, and rows that succeed are cleaned up, but the reroute to
the data client dropped the clearing entirely — so the retry idiom the docstring
describes resent mutations that had already committed.
DirectRow.commitkeptits own documented behaviour of clearing after every returned status, but it
reported the synthetic
DeadlineExceededon timeout instead of the real errorfrom the wire, and the migration's
finallyhad started discarding the mutationseven when the call raised and left the caller nothing to act on. Also documents
MutationsBatcher.mutate, which keeps no reference to the rows it batches and socannot clear them.