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

base, licenseccl: Revise resolution strategy for LicenseTTL #129052

Merged

Conversation

angles-n-daemons
Copy link
Contributor

@angles-n-daemons angles-n-daemons commented Aug 15, 2024

Previously, for resolving the cluster's license expiry we relied on a metric
whose value was regularly ticked down by an async task. This change seeks to
only the resolve value at read time by reading directly from the cluster
settings when its requested.

Release note: None

Fixes: CRDB-40592
Epic: CRDB-8035

@angles-n-daemons angles-n-daemons requested review from a team as code owners August 15, 2024 14:30
@angles-n-daemons angles-n-daemons requested review from xinhaoz and removed request for a team August 15, 2024 14:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

log.Errorf(ctx, "unable to initialize periodic license metric update: %v", err)
}
appRegistry.AddMetric(metric.NewFunctionalGauge(base.LicenseTTLMetadata, func() int64 {
return base.GetLicenseTTL(ctx, cfg.Settings, timeutil.DefaultTimeSource{})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the cluster settings are closed here on server startup

Copy link
Collaborator

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @xinhaoz)

@angles-n-daemons angles-n-daemons force-pushed the license-tickdown-metric-revision branch 3 times, most recently from e118486 to 8849773 Compare August 26, 2024 14:17
Copy link
Member

@xinhaoz xinhaoz left a comment

Choose a reason for hiding this comment

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

LGTM! Just a question on the metadata help string based on reading the discussion in the ticket linked.

var LicenseTTL = metric.NewGauge(licenseTTLMetadata)
var AdditionalLicenseTTLMetadata = metric.Metadata{
Name: "seconds_until_license_expiry",
Help: "Seconds until license expiry (0 if no license present or running without enterprise features)",
Copy link
Member

Choose a reason for hiding this comment

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

Is it intentional that this help string is still referencing enterprise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm this is a good question, I'll check in to see what we want the help string to look like

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good check, changed the helptext copy

Previously, for resolving the cluster's license expiry we relied on a metric
whose value was regularly ticked down by an async task. This change seeks to
only the resolve value at read time by reading directly from the cluster
settings when its requested.

Release note: None

Fixes: CRDB-40592
Epic: CRDB-8035
@angles-n-daemons
Copy link
Contributor Author

bors r+

@craig craig bot merged commit eada67c into cockroachdb:master Aug 27, 2024
23 checks passed
@angles-n-daemons
Copy link
Contributor Author

blathers backport 24.2 24.1 23.2 23.1

Copy link

blathers-crl bot commented Aug 29, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error setting reviewers, but backport branch blathers/backport-release-24.2-129052 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/129871/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. []

Backport to branch 24.2 failed. See errors above.


error setting reviewers, but backport branch blathers/backport-release-24.1-129052 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/129873/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. []

Backport to branch 24.1 failed. See errors above.


error creating merge commit from d9c375b to blathers/backport-release-23.2-129052: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.2 failed. See errors above.


error creating merge commit from d9c375b to blathers/backport-release-23.1-129052: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

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.

4 participants