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

DT-966: Partition TDR Snapshot Query #2712

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

rushtong
Copy link
Contributor

@rushtong rushtong commented Nov 5, 2024

Addresses

https://broadworkbench.atlassian.net/browse/DT-966

Summary

This PR breaks up the TDR snapshot query and re-combines the results to keep the url length manageable.


Have you read Terra's Contributing Guide lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@rushtong rushtong marked this pull request as ready for review November 5, 2024 19:47
@rushtong rushtong requested a review from a team as a code owner November 5, 2024 19:47
@rushtong rushtong requested review from s-rubenstein and fboulnois and removed request for a team November 5, 2024 19:47
Copy link
Contributor

@s-rubenstein s-rubenstein left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

…uery

# Conflicts:
#	src/libs/ajax/TerraDataRepo.js
Copy link
Member

@pshapiro4broad pshapiro4broad left a comment

Choose a reason for hiding this comment

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

Looks ok, but it'd be better to perform the API calls in parallel.

Also, I've mentioned this before, but this fix changes one API call to multiple calls, and could run into scale issues as the number of datasets grows. A solution that wouldn't have this issue is to add a POST version of this API to TDR.

roleMap: {},
errors: []
};
for await (const sublist of partitionedIdentifiers) {
Copy link
Member

Choose a reason for hiding this comment

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

This makes each async call synchronously. Since each call is independent, they could all be made in parallel which should make this code faster. Would it be hard to change this to use a Promise.all() construct instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes each async call synchronously. Since each call is independent, they could all be made in parallel which should make this code faster. Would it be hard to change this to use a Promise.all() construct instead?

Yes, I think that shouldn't be too much of a lift

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pshapiro4broad - PTAL, the requests are now all executed in parallel.

@rushtong
Copy link
Contributor Author

rushtong commented Nov 6, 2024

Also, I've mentioned this before, but this fix changes one API call to multiple calls, and could run into scale issues as the number of datasets grows. A solution that wouldn't have this issue is to add a POST version of this API to TDR.

I created https://broadworkbench.atlassian.net/browse/DT-974 to cover this suggestion.

@rushtong rushtong merged commit 948eea1 into develop Nov 6, 2024
9 checks passed
@rushtong rushtong deleted the gr-DT-966-partition-snapshot-query branch November 6, 2024 21:03
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