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

HARMONY-2008: Fix query-cmr granule size parsing logic #699

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

chris-durbin
Copy link
Contributor

Jira Issue ID

HARMONY-2008

Description

Some providers use Size and SizeUnits in their CMR UMM-G metadata and others user SizeInBytes to specify the size of the granule files. This changes it to be able to correctly pull the size from either field. The UMM schema provides guidance that all providers should use SizeInBytes going forward, so if both are provided we use the SizeInBytes field.

Local Test Steps

  1. npm run build in services/query-cmr
  2. bin/restart-services
  3. Submit a request and verify it works as expected

I performed performance testing in my sandbox - a 110K granule request took 10 minutes to complete all of the query-cmr tasks and populate all of the work items.

I then redeployed my sandbox pointing to production metadata and issued the original request for this ticket. Each query-cmr work item took between 11 and 28 seconds to populate 2000 work items. Previously each query-cmr work item was taking at least 3 minutes and as long as 30 minutes.

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • Harmony in a Box tested? (if changes made to microservices or new dependencies added)

Copy link
Contributor

@indiejames indiejames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the one question about missing units

granuleSizeInBytes += info.Size * 1024 * 1024 * 1024 * 1024 * 1024;
break;
default:
logger.warn(`Unknown SizeUnit: ${info.SizeUnit}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We treat 0 as being unable to retrieve the size and handle it elsewhere in the work item updater code. I was just going to leave the behavior the same since we don't want to fail things when we cannot figure out the size.

@indiejames indiejames self-requested a review February 14, 2025 16:33
Copy link
Contributor

@indiejames indiejames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally

@chris-durbin chris-durbin merged commit 18f5fa5 into main Feb 14, 2025
5 checks passed
@chris-durbin chris-durbin deleted the harmony-2008 branch February 14, 2025 18:57
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.

3 participants