-
Notifications
You must be signed in to change notification settings - Fork 526
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
HDDS-12486. Warmup KMS encrypted keys when OM starts #8081
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for the PR! Add a few comments.
We need a unit test too.
@@ -622,4 +622,16 @@ private OMConfigKeys() { | |||
public static final String OZONE_OM_MAX_BUCKET = | |||
"ozone.om.max.buckets"; | |||
public static final int OZONE_OM_MAX_BUCKET_DEFAULT = 100000; | |||
|
|||
public static final String OZONE_OM_EDEKCACHELOADER_INITIAL_DELAY_MS_KEY = "ozone.om.edekcacheloader.initial.delay.ms"; |
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.
Let's add these configuration properties into ozone-default.xml?
@@ -644,6 +655,7 @@ private OzoneManager(OzoneConfiguration conf, StartupOption startupOption) | |||
kmsProvider = null; | |||
LOG.error("Fail to create Key Provider"); | |||
} | |||
initializeEdekCache(conf); |
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.
it should only run if it's a leader node.
} | ||
|
||
public void warmUpEdekCache(final ExecutorService executor, final int delay, final int interval, int maxRetries) { | ||
List<String> keys = new ArrayList<>(); |
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.
Multiple buckets could use the same encryption key. Doing so could warm up the same encryption key multiple times, causing unnecessary delays. Let's use HashSet to eliminate duplicates.
What changes were proposed in this pull request?
Creating an Ozone file in encrypted buckets requires requesting an encrypted key from KMS, which delays file creation and could cause unwanted failures. This PR helps load the EDEKs in a cache when OM starts up so that we don't have to reach out to KMS to get the EDEK while creating an encrypted file.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-12486
How was this patch tested?
Tested Manually.