Skip to content

Commit

Permalink
Merge branch 'main' into renovate/actions-checkout-4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljbruce authored Oct 13, 2023
2 parents 74d0b3f + fe285c6 commit 92c6f40
Show file tree
Hide file tree
Showing 19 changed files with 5,980 additions and 623 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest
digest: sha256:e08f9a3757808cdaf7a377e962308c65c4d7eff12db206d4fae702dd50d43430
# created: 2023-08-03T18:46:14.719706948Z
digest: sha256:8b6a07a38d1583d96b6e251ba208bd4ef0bc2a0cc37471ffc518841651d15bd6
# created: 2023-09-25T22:18:27.595486267Z
1 change: 0 additions & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ branchProtectionRules:
requiredStatusCheckContexts:
- "ci/kokoro: Samples test"
- "ci/kokoro: System test"
- docs
- lint
- test (14)
- test (16)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/system-tests-against-emulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- 9020:9020

steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/setup-node@v3
with:
node-version: 14
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
"@google-cloud/promisify": "^4.0.0",
"@grpc/proto-loader": "^0.7.0",
"@types/big.js": "^6.0.0",
"@types/stack-trace": "0.0.29",
"@types/stack-trace": "0.0.31",
"arrify": "^2.0.0",
"big.js": "^6.0.0",
"checkpoint-stream": "^0.1.1",
"duplexify": "^4.1.1",
"events-intercept": "^2.0.0",
"extend": "^3.0.2",
"google-auth-library": "^9.0.0",
"google-gax": "^4.0.3",
"google-gax": "4.0.4",
"grpc-gcp": "^1.0.0",
"is": "^3.2.1",
"lodash.snakecase": "^4.1.1",
Expand All @@ -82,7 +82,7 @@
"devDependencies": {
"@types/concat-stream": "^2.0.0",
"@types/extend": "^3.0.0",
"@types/is": "0.0.22",
"@types/is": "0.0.23",
"@types/lodash.snakecase": "^4.1.4",
"@types/merge-stream": "^1.1.2",
"@types/mocha": "^9.0.0",
Expand All @@ -99,7 +99,7 @@
"concat-stream": "^2.0.0",
"dedent": "^0.7.0",
"execa": "^5.0.0",
"gapic-tools": "^0.1.8",
"gapic-tools": "^0.2.0",
"gts": "^5.0.0",
"jsdoc": "^4.0.0",
"jsdoc-fresh": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,66 @@ message InstanceConfig {
State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Autoscaling config for an instance.
message AutoscalingConfig {
// The autoscaling limits for the instance. Users can define the minimum and
// maximum compute capacity allocated to the instance, and the autoscaler will
// only scale within that range. Users can either use nodes or processing
// units to specify the limits, but should use the same unit to set both the
// min_limit and max_limit.
message AutoscalingLimits {
// The minimum compute capacity for the instance.
oneof min_limit {
// Minimum number of nodes allocated to the instance. If set, this number
// should be greater than or equal to 1.
int32 min_nodes = 1;

// Minimum number of processing units allocated to the instance. If set,
// this number should be multiples of 1000.
int32 min_processing_units = 2;
}

// The maximum compute capacity for the instance. The maximum compute
// capacity should be less than or equal to 10X the minimum compute
// capacity.
oneof max_limit {
// Maximum number of nodes allocated to the instance. If set, this number
// should be greater than or equal to min_nodes.
int32 max_nodes = 3;

// Maximum number of processing units allocated to the instance. If set,
// this number should be multiples of 1000 and be greater than or equal to
// min_processing_units.
int32 max_processing_units = 4;
}
}

// The autoscaling targets for an instance.
message AutoscalingTargets {
// Required. The target high priority cpu utilization percentage that the
// autoscaler should be trying to achieve for the instance. This number is
// on a scale from 0 (no utilization) to 100 (full utilization). The valid
// range is [10, 90] inclusive.
int32 high_priority_cpu_utilization_percent = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The target storage utilization percentage that the autoscaler
// should be trying to achieve for the instance. This number is on a scale
// from 0 (no utilization) to 100 (full utilization). The valid range is
// [10, 100] inclusive.
int32 storage_utilization_percent = 2
[(google.api.field_behavior) = REQUIRED];
}

// Required. Autoscaling limits for an instance.
AutoscalingLimits autoscaling_limits = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The autoscaling targets for an instance.
AutoscalingTargets autoscaling_targets = 2
[(google.api.field_behavior) = REQUIRED];
}

// An isolated set of Cloud Spanner resources on which databases can be hosted.
message Instance {
option (google.api.resource) = {
Expand Down Expand Up @@ -606,8 +666,12 @@ message Instance {
string display_name = 3 [(google.api.field_behavior) = REQUIRED];

// The number of nodes allocated to this instance. At most one of either
// node_count or processing_units should be present in the message. This
// may be zero in API responses for instances that are not yet in state
// node_count or processing_units should be present in the message.
//
// Users can set the node_count field to specify the target number of nodes
// allocated to the instance.
//
// This may be zero in API responses for instances that are not yet in state
// `READY`.
//
// See [the
Expand All @@ -616,14 +680,26 @@ message Instance {
int32 node_count = 5;

// The number of processing units allocated to this instance. At most one of
// processing_units or node_count should be present in the message. This may
// be zero in API responses for instances that are not yet in state `READY`.
// processing_units or node_count should be present in the message.
//
// Users can set the processing_units field to specify the target number of
// processing units allocated to the instance.
//
// This may be zero in API responses for instances that are not yet in state
// `READY`.
//
// See [the
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
// for more information about nodes and processing units.
int32 processing_units = 9;

// Optional. The autoscaling configuration. Autoscaling is enabled if this
// field is set. When autoscaling is enabled, node_count and processing_units
// are treated as OUTPUT_ONLY fields and reflect the current compute capacity
// allocated to the instance.
AutoscalingConfig autoscaling_config = 17
[(google.api.field_behavior) = OPTIONAL];

// Output only. The current instance state. For
// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance],
// the state must be either omitted or set to `CREATING`. For
Expand Down
61 changes: 61 additions & 0 deletions protos/google/spanner/v1/spanner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,29 @@ service Spanner {
body: "*"
};
}

// Batches the supplied mutation groups in a collection of efficient
// transactions. All mutations in a group are committed atomically. However,
// mutations across groups can be committed non-atomically in an unspecified
// order and thus, they must be independent of each other. Partial failure is
// possible, i.e., some groups may have been committed successfully, while
// some may have failed. The results of individual batches are streamed into
// the response as the batches are applied.
//
// BatchWrite requests are not replay protected, meaning that each mutation
// group may be applied more than once. Replays of non-idempotent mutations
// may have undesirable effects. For example, replays of an insert mutation
// may produce an already exists error or if you use generated or commit
// timestamp-based keys, it may result in additional rows being added to the
// mutation's table. We recommend structuring your mutation groups to be
// idempotent to avoid this issue.
rpc BatchWrite(BatchWriteRequest) returns (stream BatchWriteResponse) {
option (google.api.http) = {
post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite"
body: "*"
};
option (google.api.method_signature) = "session,mutation_groups";
}
}

// The request for [CreateSession][google.spanner.v1.Spanner.CreateSession].
Expand Down Expand Up @@ -1040,3 +1063,41 @@ message RollbackRequest {
// Required. The transaction to roll back.
bytes transaction_id = 2 [(google.api.field_behavior) = REQUIRED];
}

// The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite].
message BatchWriteRequest {
// A group of mutations to be committed together. Related mutations should be
// placed in a group. For example, two mutations inserting rows with the same
// primary key prefix in both parent and child tables are related.
message MutationGroup {
// Required. The mutations in this group.
repeated Mutation mutations = 1 [(google.api.field_behavior) = REQUIRED];
}

// Required. The session in which the batch request is to be run.
string session = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "spanner.googleapis.com/Session" }
];

// Common options for this request.
RequestOptions request_options = 3;

// Required. The groups of mutations to be applied.
repeated MutationGroup mutation_groups = 4
[(google.api.field_behavior) = REQUIRED];
}

// The result of applying a batch of mutations.
message BatchWriteResponse {
// The mutation groups applied in this batch. The values index into the
// `mutation_groups` field in the corresponding `BatchWriteRequest`.
repeated int32 indexes = 1;

// An `OK` status indicates success. Any other status indicates a failure.
google.rpc.Status status = 2;

// The commit timestamp of the transaction that applied this batch.
// Present if `status` is `OK`, absent otherwise.
google.protobuf.Timestamp commit_timestamp = 3;
}
Loading

0 comments on commit 92c6f40

Please sign in to comment.