-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 #76476
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]>
rjernst
added
>enhancement
:Security/License
License functionality for commercial features
v7.15.0
labels
Aug 13, 2021
Pinging @elastic/es-security (Team:Security) |
tvernum
approved these changes
Aug 13, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I'd like to fix the TODO in Realms (recalculate on license change rather than on each call) in time for 7.15
I can work on that on Monday.
rjernst
added a commit
to rjernst/elasticsearch
that referenced
this pull request
Aug 14, 2021
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 <[email protected]>
This was referenced Aug 16, 2021
rjernst
added a commit
that referenced
this pull request
Aug 16, 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 <[email protected]>
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
Merged
rjernst
added a commit
that referenced
this pull request
Aug 16, 2021
tvernum
added a commit
to tvernum/elasticsearch
that referenced
this pull request
Aug 17, 2021
This commit changes the implementation of the Realms class to listen for license changes, and recompute the set of actively licensed realms only when the license changes rather than each time the "asList" method is called. This is primarily a performance optimisation, but it also allows us to turn off the "in use" license tracking for realms when they are disabled by a change in license. Relates: elastic#76476
wjp719
added a commit
to wjp719/elasticsearch
that referenced
this pull request
Aug 17, 2021
* master: (868 commits) Query API key - Rest spec and yaml tests (elastic#76238) Delay shard reassignment from nodes which are known to be restarting (elastic#75606) Reenable bwc tests for elastic#76475 (elastic#76576) Set version to 7.15 in BWC code (elastic#76577) Don't remove warning headers on all failure (elastic#76434) Disable bwc tests for elastic#76475 (elastic#76541) Re-enable bwc tests (elastic#76567) Keep track of data recovered from snapshots in RecoveryState (elastic#76499) [Transform] Align transform checkpoint range with date_histogram interval for better performance (elastic#74004) EQL: Remove "wildcard" function (elastic#76099) Fix 'accept' and 'content_type' fields for search_mvt API Add persistent licensed feature tracking (elastic#76476) Add system data streams to feature state snapshots (elastic#75902) fix the error message for instance methods that don't exist (elastic#76512) ILM: Add validation of the number_of_shards parameter in Shrink Action of ILM (elastic#74219) remove dashboard only reserved role (elastic#76507) Fix Stack Overflow in UnassignedInfo in Corner Case (elastic#76480) Add (Extended)KeyUsage KeyUsage, CipherSuite & Protocol to SSL diagnostics (elastic#65634) Add recovery from snapshot to tests (elastic#76535) Reenable BwC Tests after elastic#76532 (elastic#76534) ...
tvernum
added a commit
that referenced
this pull request
Aug 17, 2021
This commit changes the implementation of the Realms class to listen for license changes, and recompute the set of actively licensed realms only when the license changes rather than each time the "asList" method is called. This is primarily a performance optimisation, but it also allows us to turn off the "in use" license tracking for realms when they are disabled by a change in license. Relates: #76476
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>enhancement
:Security/License
License functionality for commercial features
Team:Security
Meta label for security team
v7.15.0
v8.0.0-alpha2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 [email protected]