Skip to content

Support bigtable routing cookies #13447

@dbolduc

Description

@dbolduc

Background

All client calls need to:

  1. create some state that persists across retries
  2. use that state to update the grpc::ClientContext before a call
  3. use the grpc::ClientContext to 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

Metadata

Metadata

Assignees

Labels

api: bigtableIssues related to the Bigtable API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions