googleapis / googleapis/google-cloud-cpp

Bigtable BulkApply does not respect custom retry policies for individual mutation errors

Aperta
#14,656 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
api: bigtable priority: p3 type: bug
Lingua principale
C++
Stelle
659
Fork
462
Merge medio
1g 2h
PR unite (30g)
89

Descrizione

## Problem

We use the current retry policy (which can be customized by the application) to determine whether stream failures are transient.

However, we use the *default* retry policy to determine whether individual mutation errors are transient. Specifically, we only add mutations with default transient errors to the next batch:

https://github.com/googleapis/google-cloud-cpp/blob/0117ba9d7c97f6b512da5e683015f59a07699d74/google/cloud/bigtable/internal/bulk_mutator.cc#L109-L110

## Implementation notes

- The annoying this is that the `BulkMutatorState` code path is shared by a client with `Options` and one without. So there will not always be a retry policy available. We likely will have to have branching in the common code path, which is a red-flag that it should not be a common code path. :shrug:

- We should only check if the error is transient, with `IsPermanentFailure() const`. We should not be pinging `OnFailure()` for individual mutations. (e.g. consider a `DataLimitedErrorCountPolicy(...)`. We want that to apply to stream failures only, not individual mutations).

https://github.com/googleapis/google-cloud-cpp/blob/0117ba9d7c97f6b512da5e683015f59a07699d74/google/cloud/bigtable/retry_policy.h#L71-L73

- We do not need to check `IsExhausted() const`. That will be done in the DataConnection's retry loop.

https://github.com/googleapis/google-cloud-cpp/blob/0117ba9d7c97f6b512da5e683015f59a07699d74/google/cloud/bigtable/internal/data_connection_impl.cc#L181

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.