Skip to content

Commit dd47718

Browse files
Google APIscopybara-github
authored andcommitted
feat: Define ReplicaComputeCapacity and AsymmetricAutoscalingOption
docs: A comment for field `node_count` in message `spanner.admin.instance.v1.Instance` is changed docs: A comment for field `processing_units` in message `spanner.admin.instance.v1.Instance` is changed PiperOrigin-RevId: 681615472
1 parent 917e347 commit dd47718

2 files changed

Lines changed: 116 additions & 16 deletions

File tree

google/spanner/admin/instance/v1/common.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.spanner.admin.instance.v1;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/protobuf/timestamp.proto";
2021

2122
option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1";
@@ -54,3 +55,9 @@ enum FulfillmentPeriod {
5455
// to complete.
5556
FULFILLMENT_PERIOD_EXTENDED = 2;
5657
}
58+
59+
// ReplicaSelection identifies replicas with common properties.
60+
message ReplicaSelection {
61+
// Required. Name of the location of the replicas (e.g., "us-central1").
62+
string location = 1 [(google.api.field_behavior) = REQUIRED];
63+
}

google/spanner/admin/instance/v1/spanner_instance_admin.proto

Lines changed: 109 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,34 @@ message InstanceConfig {
803803
State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
804804
}
805805

806+
// ReplicaComputeCapacity describes the amount of server resources that are
807+
// allocated to each replica identified by the replica selection.
808+
message ReplicaComputeCapacity {
809+
// Required. Identifies replicas by specified properties.
810+
// All replicas in the selection have the same amount of compute capacity.
811+
ReplicaSelection replica_selection = 1
812+
[(google.api.field_behavior) = REQUIRED];
813+
814+
// Compute capacity allocated to each replica identified by the specified
815+
// selection.
816+
// The unit is selected based on the unit used to specify the instance size
817+
// for non-autoscaling instances, or the unit used in autoscaling limit for
818+
// autoscaling instances.
819+
oneof compute_capacity {
820+
// The number of nodes allocated to each replica.
821+
//
822+
// This may be zero in API responses for instances that are not yet in
823+
// state `READY`.
824+
int32 node_count = 2;
825+
826+
// The number of processing units allocated to each replica.
827+
//
828+
// This may be zero in API responses for instances that are not yet in
829+
// state `READY`.
830+
int32 processing_units = 3;
831+
}
832+
}
833+
806834
// Autoscaling configuration for an instance.
807835
message AutoscalingConfig {
808836
// The autoscaling limits for the instance. Users can define the minimum and
@@ -854,13 +882,56 @@ message AutoscalingConfig {
854882
[(google.api.field_behavior) = REQUIRED];
855883
}
856884

885+
// AsymmetricAutoscalingOption specifies the scaling of replicas identified by
886+
// the given selection.
887+
message AsymmetricAutoscalingOption {
888+
// Overrides the top-level autoscaling configuration for the replicas
889+
// identified by `replica_selection`. All fields in this message are
890+
// optional. Any unspecified fields will use the corresponding values from
891+
// the top-level autoscaling configuration.
892+
message AutoscalingConfigOverrides {
893+
// Optional. If specified, overrides the min/max limit in the top-level
894+
// autoscaling configuration for the selected replicas.
895+
AutoscalingLimits autoscaling_limits = 1
896+
[(google.api.field_behavior) = OPTIONAL];
897+
898+
// Optional. If specified, overrides the autoscaling target
899+
// high_priority_cpu_utilization_percent in the top-level autoscaling
900+
// configuration for the selected replicas.
901+
int32 autoscaling_target_high_priority_cpu_utilization_percent = 2
902+
[(google.api.field_behavior) = OPTIONAL];
903+
}
904+
905+
// Required. Selects the replicas to which this AsymmetricAutoscalingOption
906+
// applies. Only read-only replicas are supported.
907+
ReplicaSelection replica_selection = 1
908+
[(google.api.field_behavior) = REQUIRED];
909+
910+
// Optional. Overrides applied to the top-level autoscaling configuration
911+
// for the selected replicas.
912+
AutoscalingConfigOverrides overrides = 2
913+
[(google.api.field_behavior) = OPTIONAL];
914+
}
915+
857916
// Required. Autoscaling limits for an instance.
858917
AutoscalingLimits autoscaling_limits = 1
859918
[(google.api.field_behavior) = REQUIRED];
860919

861920
// Required. The autoscaling targets for an instance.
862921
AutoscalingTargets autoscaling_targets = 2
863922
[(google.api.field_behavior) = REQUIRED];
923+
924+
// Optional. Optional asymmetric autoscaling options.
925+
// Replicas matching the replica selection criteria will be autoscaled
926+
// independently from other replicas. The autoscaler will scale the replicas
927+
// based on the utilization of replicas identified by the replica selection.
928+
// Replica selections should not overlap with each other.
929+
//
930+
// Other replicas (those do not match any replica selection) will be
931+
// autoscaled together and will have the same compute capacity allocated to
932+
// them.
933+
repeated AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3
934+
[(google.api.field_behavior) = OPTIONAL];
864935
}
865936

866937
// An isolated set of Cloud Spanner resources on which databases can be hosted.
@@ -922,34 +993,56 @@ message Instance {
922993
// Must be unique per project and between 4 and 30 characters in length.
923994
string display_name = 3 [(google.api.field_behavior) = REQUIRED];
924995

925-
// The number of nodes allocated to this instance. At most one of either
926-
// node_count or processing_units should be present in the message.
996+
// The number of nodes allocated to this instance. At most, one of either
997+
// `node_count` or `processing_units` should be present in the message.
927998
//
928-
// Users can set the node_count field to specify the target number of nodes
999+
// Users can set the `node_count` field to specify the target number of nodes
9291000
// allocated to the instance.
9301001
//
931-
// This may be zero in API responses for instances that are not yet in state
932-
// `READY`.
1002+
// If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY`
1003+
// field and reflects the current number of nodes allocated to the instance.
9331004
//
934-
// See [the
935-
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
936-
// for more information about nodes and processing units.
1005+
// This might be zero in API responses for instances that are not yet in the
1006+
// `READY` state.
1007+
//
1008+
// If the instance has varying node count across replicas (achieved by
1009+
// setting asymmetric_autoscaling_options in autoscaling config), the
1010+
// node_count here is the maximum node count across all replicas.
1011+
//
1012+
// For more information, see
1013+
// [Compute capacity, nodes, and processing
1014+
// units](https://cloud.google.com/spanner/docs/compute-capacity).
9371015
int32 node_count = 5;
9381016

939-
// The number of processing units allocated to this instance. At most one of
940-
// processing_units or node_count should be present in the message.
1017+
// The number of processing units allocated to this instance. At most, one of
1018+
// either `processing_units` or `node_count` should be present in the message.
9411019
//
942-
// Users can set the processing_units field to specify the target number of
1020+
// Users can set the `processing_units` field to specify the target number of
9431021
// processing units allocated to the instance.
9441022
//
945-
// This may be zero in API responses for instances that are not yet in state
946-
// `READY`.
1023+
// If autoscaling is enabled, `processing_units` is treated as an
1024+
// `OUTPUT_ONLY` field and reflects the current number of processing units
1025+
// allocated to the instance.
9471026
//
948-
// See [the
949-
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
950-
// for more information about nodes and processing units.
1027+
// This might be zero in API responses for instances that are not yet in the
1028+
// `READY` state.
1029+
//
1030+
// If the instance has varying processing units per replica
1031+
// (achieved by setting asymmetric_autoscaling_options in autoscaling config),
1032+
// the processing_units here is the maximum processing units across all
1033+
// replicas.
1034+
//
1035+
// For more information, see
1036+
// [Compute capacity, nodes and processing
1037+
// units](https://cloud.google.com/spanner/docs/compute-capacity).
9511038
int32 processing_units = 9;
9521039

1040+
// Output only. Lists the compute capacity per ReplicaSelection. A replica
1041+
// selection identifies a set of replicas with common properties. Replicas
1042+
// identified by a ReplicaSelection are scaled with the same compute capacity.
1043+
repeated ReplicaComputeCapacity replica_compute_capacity = 19
1044+
[(google.api.field_behavior) = OUTPUT_ONLY];
1045+
9531046
// Optional. The autoscaling configuration. Autoscaling is enabled if this
9541047
// field is set. When autoscaling is enabled, node_count and processing_units
9551048
// are treated as OUTPUT_ONLY fields and reflect the current compute capacity

0 commit comments

Comments
 (0)