Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Modify client lib retry policy for CreateWriteStream with longer backoff, more error code and longer overall time #279

Merged
merged 6 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions protos/google/cloud/bigquery/storage/v1/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ message CreateReadSessionRequest {
// Max initial number of streams. If unset or zero, the server will
// provide a value of streams so as to produce reasonable throughput. Must be
// non-negative. The number of streams may be lower than the requested number,
// depending on the amount parallelism that is reasonable for the table. Error
// will be returned if the max count is greater than the current system
// max limit of 1,000.
// depending on the amount parallelism that is reasonable for the table.
// There is a default system max limit of 1,000.
//
// Streams must be read starting from offset 0.
// This must be greater than or equal to preferred_min_stream_count.
// Typically, clients should either leave this unset to let the system to
// determine an upper bound OR set this a size for the maximum "units of work"
// it can gracefully handle.
int32 max_stream_count = 3;
}

Expand Down Expand Up @@ -329,7 +331,7 @@ message ReadRowsResponse {

// The schema for the read. If read_options.selected_fields is set, the
// schema may be different from the table schema as it will only contain
// the selected fields. This schema is equivelant to the one returned by
// the selected fields. This schema is equivalent to the one returned by
// CreateSession. This field is only populated in the first ReadRowsResponse
// RPC.
oneof schema {
Expand Down Expand Up @@ -488,6 +490,11 @@ message AppendRowsResponse {
// use it to input new type of message. It will be empty when no schema
// updates have occurred.
TableSchema updated_schema = 3;

// If a request failed due to corrupted rows, no rows in the batch will be
// appended. The API will return row level error info, so that the caller can
// remove the bad rows and retry the request.
repeated RowError row_errors = 4;
}

// Request message for `GetWriteStreamRequest`.
Expand Down Expand Up @@ -622,3 +629,24 @@ message StorageError {
// Message that describes the error.
string error_message = 3;
}

// The message that presents row level error info in a request.
message RowError {
// Error code for `RowError`.
enum RowErrorCode {
// Default error.
ROW_ERROR_CODE_UNSPECIFIED = 0;

// One or more fields in the row has errors.
FIELDS_ERROR = 1;
}

// Index of the malformed row in the request.
int64 index = 1;

// Structured error reason for a row error.
RowErrorCode code = 2;

// Description of the issue encountered when processing the row.
string message = 3;
}
3 changes: 2 additions & 1 deletion protos/google/cloud/bigquery/storage/v1/stream.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1";

// Data format for input or output data.
enum DataFormat {
// Data format is unspecified.
DATA_FORMAT_UNSPECIFIED = 0;

// Avro is a standard open source row based file format.
Expand Down Expand Up @@ -91,7 +92,7 @@ message ReadSession {
// automatically assigned and currently cannot be specified or updated.
google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Immutable. Data format of the output data.
// Immutable. Data format of the output data. DATA_FORMAT_UNSPECIFIED not supported.
DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE];

// The schema for the read. If read_options.selected_fields is set, the
Expand Down
4 changes: 3 additions & 1 deletion protos/google/cloud/bigquery/storage/v1/table.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ option java_outer_classname = "TableProto";
option java_package = "com.google.cloud.bigquery.storage.v1";
option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1";

// Schema of a table.
// Schema of a table. This schema is a subset of
// google.cloud.bigquery.v2.TableSchema containing information necessary to
// generate valid message to write to BigQuery.
message TableSchema {
// Describes the fields in a table.
repeated TableFieldSchema fields = 1;
Expand Down
117 changes: 117 additions & 0 deletions protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading