Skip to content

Commit 6388d14

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add Reservation.max_slots field to Reservation proto, indicating the total max number of slots this reservation can use up to
feat: Add Reservation.scaling_mode field and its corresponding enum message ScalingMode. This field should be used together with Reservation.max_slots PiperOrigin-RevId: 795606766
1 parent 74853d7 commit 6388d14

2 files changed

Lines changed: 102 additions & 1 deletion

File tree

google/cloud/bigquery/reservation/v1/bigqueryreservation_v1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apis:
77
- name: google.cloud.bigquery.reservation.v1.ReservationService
88

99
documentation:
10-
summary: 'A service to modify your BigQuery flat-rate reservations.'
10+
summary: A service to modify your BigQuery reservations.
1111

1212
authentication:
1313
rules:

google/cloud/bigquery/reservation/v1/reservation.proto

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,62 @@ message Reservation {
423423
int64 max_slots = 2;
424424
}
425425

426+
// The scaling mode for the reservation. This enum determines how the
427+
// reservation scales up and down.
428+
enum ScalingMode {
429+
// Default value of ScalingMode.
430+
SCALING_MODE_UNSPECIFIED = 0;
431+
432+
// The reservation will scale up only using slots from autoscaling. It will
433+
// not use any idle slots even if there may be some available. The upper
434+
// limit that autoscaling can scale up to will be max_slots - baseline.
435+
// For example, if max_slots is 1000, baseline is 200 and customer sets
436+
// ScalingMode to AUTOSCALE_ONLY, then autoscalerg will scale up to 800
437+
// slots and no idle slots will be used.
438+
//
439+
// Please note, in this mode, the ignore_idle_slots field must be set to
440+
// true.
441+
AUTOSCALE_ONLY = 1;
442+
443+
// The reservation will scale up using only idle slots contributed by
444+
// other reservations or from unassigned commitments. If no idle slots are
445+
// available it will not scale up further. If the idle slots which it is
446+
// using are reclaimed by the contributing reservation(s) it may be forced
447+
// to scale down. The max idle slots the reservation can be max_slots -
448+
// baseline capacity. For example, if max_slots is 1000, baseline is 200 and
449+
// customer sets ScalingMode to IDLE_SLOTS_ONLY,
450+
// 1. if there are 1000 idle slots available in other reservations, the
451+
// reservation will scale up to 1000 slots with 200 baseline and 800 idle
452+
// slots.
453+
// 2. if there are 500 idle slots available in other reservations, the
454+
// reservation will scale up to 700 slots with 200 baseline and 300 idle
455+
// slots.
456+
// Please note, in this mode, the reservation might not be able to scale up
457+
// to max_slots.
458+
//
459+
// Please note, in this mode, the ignore_idle_slots field must be set to
460+
// false.
461+
IDLE_SLOTS_ONLY = 2;
462+
463+
// The reservation will scale up using all slots available to it. It will
464+
// use idle slots contributed by other reservations or from unassigned
465+
// commitments first. If no idle slots are available it will scale up using
466+
// autoscaling. For example, if max_slots is 1000, baseline is 200 and
467+
// customer sets ScalingMode to ALL_SLOTS,
468+
// 1. if there are 800 idle slots available in other reservations, the
469+
// reservation will scale up to 1000 slots with 200 baseline and 800 idle
470+
// slots.
471+
// 2. if there are 500 idle slots available in other reservations, the
472+
// reservation will scale up to 1000 slots with 200 baseline, 500 idle
473+
// slots and 300 autoscaling slots.
474+
// 3. if there are no idle slots available in other reservations, it will
475+
// scale up to 1000 slots with 200 baseline and 800 autoscaling slots.
476+
//
477+
// Please note, in this mode, the ignore_idle_slots field must be set to
478+
// false.
479+
ALL_SLOTS = 3;
480+
}
481+
426482
// Disaster Recovery(DR) replication status of the reservation.
427483
message ReplicationStatus {
428484
// Output only. The last error encountered while trying to replicate changes
@@ -538,6 +594,51 @@ message Reservation {
538594
}
539595
];
540596

597+
// Optional. The overall max slots for the reservation, covering slot_capacity
598+
// (baseline), idle slots (if ignore_idle_slots is false) and scaled slots.
599+
// If present, the reservation won't use more than the specified number of
600+
// slots, even if there is demand and supply (from idle slots).
601+
// NOTE: capping a reservation's idle slot usage is best effort and its
602+
// usage may exceed the max_slots value. However, in terms of
603+
// autoscale.current_slots (which accounts for the additional added slots), it
604+
// will never exceed the max_slots - baseline.
605+
//
606+
//
607+
// This field must be set together with the scaling_mode enum value.
608+
//
609+
// If the max_slots and scaling_mode are set, the autoscale or
610+
// autoscale.max_slots field must be unset. However, the
611+
// autoscale field may still be in the output. The autopscale.max_slots will
612+
// always show as 0 and the autoscaler.current_slots will represent the
613+
// current slots from autoscaler excluding idle slots.
614+
// For example, if the max_slots is 1000 and scaling_mode is AUTOSCALE_ONLY,
615+
// then in the output, the autoscaler.max_slots will be 0 and the
616+
// autoscaler.current_slots may be any value between 0 and 1000.
617+
//
618+
// If the max_slots is 1000, scaling_mode is ALL_SLOTS, the baseline is 100
619+
// and idle slots usage is 200, then in the output, the autoscaler.max_slots
620+
// will be 0 and the autoscaler.current_slots will not be higher than 700.
621+
//
622+
// If the max_slots is 1000, scaling_mode is IDLE_SLOTS_ONLY, then in the
623+
// output, the autoscaler field will be null.
624+
//
625+
// If the max_slots and scaling_mode are set, then the ignore_idle_slots field
626+
// must be aligned with the scaling_mode enum value.(See details in
627+
// ScalingMode comments).
628+
//
629+
// Please note, the max_slots is for user to manage the part of slots greater
630+
// than the baseline. Therefore, we don't allow users to set max_slots smaller
631+
// or equal to the baseline as it will not be meaningful. If the field is
632+
// present and slot_capacity>=max_slots.
633+
//
634+
// Please note that if max_slots is set to 0, we will treat it as unset.
635+
// Customers can set max_slots to 0 and set scaling_mode to
636+
// SCALING_MODE_UNSPECIFIED to disable the max_slots feature.
637+
optional int64 max_slots = 21 [(google.api.field_behavior) = OPTIONAL];
638+
639+
// Optional. The scaling mode for the reservation.
640+
// If the field is present but max_slots is not present.
641+
ScalingMode scaling_mode = 22 [(google.api.field_behavior) = OPTIONAL];
541642
// Output only. The Disaster Recovery(DR) replication status of the
542643
// reservation. This is only available for the primary replicas of DR/failover
543644
// reservations and provides information about the both the staleness of the

0 commit comments

Comments
 (0)