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

Add persistent licensed feature tracking #76537

Merged
merged 2 commits into from
Aug 16, 2021
Merged

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Aug 14, 2021

backport of #76476

Licensed feature tracking utilizes the existing license level checks to
track when a feature is used. However, some features check the license
level at the start of an operation or when enabling a feature, but then
the tracking only captures the beginning time.

This commit reworks the licensed feature framework to use a new
LicensedFeature class which will eventually replace
XPackLicenseState.Feature values. There are two LicensedFeature
implementations, one for "momentary" features that are tracked just at
the moment they are used, and "persistent" features that are considered
"on" until the feature is untracked. The usage map of tracked features
is cleaned up every hour, and those features that have not been used in
the last 24 hours are removed from tracking.

Not all features are converted to LicensedFeature yet. Instead, a few
features have been converted to demonstrate how it can be done, so that
the rest can be done in parallel at a future time.

Co-authored-by: Tim Vernum tim@adjective.org

backport of elastic#76476

Licensed feature tracking utilizes the existing license level checks to
track when a feature is used. However, some features check the license
level at the start of an operation or when enabling a feature, but then
the tracking only captures the beginning time.

This commit reworks the licensed feature framework to use a new
LicensedFeature class which will eventually replace
XPackLicenseState.Feature values. There are two LicensedFeature
implementations, one for "momentary" features that are tracked just at
the moment they are used, and "persistent" features that are considered
"on" until the feature is untracked. The usage map of tracked features
is cleaned up every hour, and those features that have not been used in
the last 24 hours are removed from tracking.

Not all features are converted to LicensedFeature yet. Instead, a few
features have been converted to demonstrate how it can be done, so that
the rest can be done in parallel at a future time.

Co-authored-by: Tim Vernum <tim@adjective.org>
In 7.x, Elasticsearch automatically enables the file + native realms
if no other (non-reserved) realms are available.

In 8.0 the behaviour is different and they are enabled automatically
on startup unless explicitly disabled.

For this backport the behaviour of asList needs to change to retain
this existing behaviour.
@rjernst
Copy link
Member Author

rjernst commented Aug 16, 2021

@elasticmachine run
elasticsearch-ci/packaging-tests-unix-sample

@rjernst
Copy link
Member Author

rjernst commented Aug 16, 2021

@elasticmachine run elasticsearch-ci/packaging-tests-windows-sample

@rjernst rjernst merged commit 674b834 into elastic:7.x Aug 16, 2021
@rjernst rjernst deleted the license44_7.x branch August 16, 2021 15:25
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Aug 16, 2021
This commit re-enables the bwc tests after the backport of elastic#76476.

relates elastic#76537
@rjernst rjernst mentioned this pull request Aug 16, 2021
rjernst added a commit that referenced this pull request Aug 16, 2021
This commit re-enables the bwc tests after the backport of #76476.

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

Successfully merging this pull request may close these issues.

3 participants