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

HDDS-12486. Warmup KMS encrypted keys when OM starts #8081

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aryangupta1998
Copy link
Contributor

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.

@aryangupta1998 aryangupta1998 marked this pull request as draft March 14, 2025 10:02
@jojochuang jojochuang self-requested a review March 17, 2025 17:28
Copy link
Contributor

@jojochuang jojochuang left a 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";
Copy link
Contributor

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);
Copy link
Contributor

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<>();
Copy link
Contributor

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.

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.

2 participants