-
Notifications
You must be signed in to change notification settings - Fork 441
Support bigtable routing cookies #13447
Description
Background
All client calls need to:
- create some state that persists across retries
- use that state to update the
grpc::ClientContextbefore a call - use the
grpc::ClientContextto update the state after a call has finished with an error
The state update function will look for trailers returned that start with the prefix x-goog-cbt-cookie-*. It will remember these trailers and add them as metadata pairs for any subsequent retries.
Vague Design
We are just going to add a bigtable_internal::RetryContext class for keeping track of the state.
Generally, we will create one of these from within each client call in the DataConnectionImpl class. (Some connection impl methods already have state, such as the BulkMutator. These may create/hold the RetryContext, depending on what is most convenient.)
Vague Alternatives Considered
We considered several more generic solutions that would be common/generated code, that could be reused by all libraries. We think this could unlock some other use cases.
We recognized that this would take a lot of effort. We could not get it done in the 2 weeks we have to close this feature request. We hope that something is learned from the effort in Bigtable though.
Testing
We will only have unit tests initially. There is not any useful behavior to test in an integration test. I have heard there are conformance tests on the way.
Work
Internal State
- Add
bigtable_internal::RetryContext
Client support
- Sync unary (
Apply,CheckAndMutateRow,)ReadModifyWriteRow - Async unary (
AsyncApply,AsyncCheckAndMutateRow,)AsyncReadModifyWriteRow -
BulkApply -
ReadRows -
SampleRows -
AsyncBulkApply -
AsyncReadRows -
AsyncSampleRows