Skip to content

Commit 6821eac

Browse files
tkuchikiclaude
andauthored
chore: regenerate deepcopy and CRD manifests (#239)
* Log per-metric PU candidates on scale events In dual CPU scaling mode, the "updated processing units via google cloud api" log only reported before/after PU values, so operators could not tell which metric (highPriority or total) drove a scale event after the fact. The Kubernetes "Updated" Event had the same gap. Refactor calcDesiredProcessingUnits to return a scaleDecision struct that bundles the chosen PU with the per-metric candidates (DesiredByHighPriority, DesiredByTotal). The Reconcile loop now logs both candidates alongside the configured metric type and current CPU utilizations on the three scale-related sites: - V(1) "processing units need to be changed" - Info "updated processing units via google cloud api" - Kubernetes "Updated" Event Readers can identify the driving metric by comparing the after value against DesiredByHighPriority and DesiredByTotal — no separate "driver" field is materialized. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Regenerate deepcopy and CRD manifests Two prior PRs added api/v1beta1 changes without running the controller-gen targets, leaving local drift that surfaces every time a contributor runs `make manifests generate`: - #227 (scale down time restriction) added ScaleConfig.ScaledownNotAllowedTimes but did not regenerate DeepCopyInto. Without the generated copy, a deep-copied ScaleConfig shares the underlying slice with the original; any future code that mutates the field on a copy would corrupt the informer cache. - #237 (CPU metric observability) expanded the godoc for currentHighPriorityCPUUtilization and currentTotalCPUUtilization but did not regenerate the CRD YAML, so `kubectl explain` still shows the older descriptions. This commit is purely the output of `make manifests generate` — no hand edits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e75a108 commit 6821eac

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/spanner.mercari.com_spannerautoscalers.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,16 @@ spec:
477477
- Both
478478
type: string
479479
currentHighPriorityCPUUtilization:
480-
description: Current average CPU utilization for high priority task,
481-
represented as a percentage
480+
description: |-
481+
Current average CPU utilization for high priority task, represented as a percentage.
482+
In dual CPU scaling mode (both highPriority and total configured), this value is
483+
fetched concurrently with currentTotalCPUUtilization. Because Cloud Monitoring
484+
ingests the underlying metrics (utilization_by_priority and utilization) independently,
485+
the two fields may briefly reflect different alignment windows and the relation
486+
currentTotalCPUUtilization >= currentHighPriorityCPUUtilization is not guaranteed
487+
on every sync. The autoscaling decision uses both values independently and takes
488+
the larger required processing units, so the transient inconsistency does not cause
489+
over-scaling down.
482490
type: integer
483491
currentProcessingUnits:
484492
description: Current number of processing-units in the Spanner instance
@@ -487,6 +495,7 @@ spec:
487495
description: |-
488496
Current total CPU utilization (all priorities), represented as a percentage.
489497
This field is populated only when spec.scaleConfig.targetCPUUtilization.total is specified.
498+
See the note on currentHighPriorityCPUUtilization for the consistency caveat in dual mode.
490499
type: integer
491500
currentlyActiveSchedules:
492501
description: List of all the schedules which are currently active

0 commit comments

Comments
 (0)