Add license checking during recover from snapshot#78928
Add license checking during recover from snapshot#78928fcofdez wants to merge 7 commits intoelastic:masterfrom
Conversation
This commit introduces a new plug-in LicenseCheckerPlugin that allows checking if a particular feature is allowed or not depending on the current license in server code. The node won't start unless there's a single LicenseCheckerPlugin.
7fea984 to
0c0532d
Compare
|
Pinging @elastic/es-distributed (Team:Distributed) |
|
Maybe it makes sense to add someone from delivery or core as reviewers too? |
henningandersen
left a comment
There was a problem hiding this comment.
I left a few minor comments but otherwise this looks good.
I should be interested in whether @rjernst has input to how we plug this in?
...src/test/java/org/elasticsearch/recovery/LicenseIsEnforcedDuringSnapshotBasedRecoveryIT.java
Show resolved
Hide resolved
...nternalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java
Outdated
Show resolved
Hide resolved
...nternalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java
Outdated
Show resolved
Hide resolved
...nternalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java
Outdated
Show resolved
Hide resolved
test/framework/src/main/java/org/elasticsearch/test/MockLicenseCheckerPlugin.java
Outdated
Show resolved
Hide resolved
...nternalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java
Show resolved
Hide resolved
|
Pinging @elastic/es-security (Team:Security) |
rjernst
left a comment
There was a problem hiding this comment.
I don't think we should add license checking to server. It would blur the lines of what is licensed vs unlicensed code. Instead, I wonder about the SnapshotsRecoveryPlannerService in general:
final RecoveryPlannerService recoveryPlannerService = new SnapshotsRecoveryPlannerService(shardSnapshotsService);
This is an excerpt from Node construction. It seems to me the RecoveryPlannerService should be what is pluggable, then the implementation could be in xpack and have normal license checks, when necessary.
|
Closing this in favor of #79637 |
This commit introduces a new plug-in, LicenseCheckerPlugin, that allows
checking if a particular feature is allowed or not depending on the
current license in server code. The node won't start unless there's
a single LicenseCheckerPlugin.
Additionally, snapshot based recoveries fallback to regular source
based recoveries if the current license doesn't allow to run that
feature.