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

feat: Take into account number of databases in an instance #287

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nielm
Copy link
Collaborator

@nielm nielm commented May 10, 2024

Instances configured with <1000 PUs only support 10 DBs per 100 PUs so clamp the minimum size to the relevant number of PUs

Fixes #286

Instances configured with <1000 PUs only support 10 DBs per 100 PUs
so clamp the minimum size to the relevant number of PUs

Fixes cloudspannerecosystem#286
@nielm nielm requested a review from henrybell May 10, 2024 18:16
Review comments
@nielm nielm requested a review from davidcueva May 15, 2024 10:17
@@ -25,6 +25,7 @@ const AutoscalerUnits = {
* currentSize: number,
* regional: boolean,
* currentNodes: number,
* numDatabases: number,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth considering currentDatabases, currentNumDatabases, or similar, to be consistent with the other metadata fields that may change over time?

@@ -304,6 +314,7 @@ async function getSpannerMetadata(projectId, spannerInstanceId, units) {
regional: !!metadata['config']?.split('/')?.pop()?.startsWith('regional'),
// DEPRECATED
currentNodes: assertDefined(metadata['nodeCount']),
numDatabases: numDatabases,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity perhaps reformat these few lines or move the comment to show that it is only the currentNodes field that is deprecated (despite the single-line comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Take Database Count Into Consideration
3 participants