-
Notifications
You must be signed in to change notification settings - Fork 107
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
CUMULUS-3806 update Orca Recon Report to use postgres as source of truth #3794
Conversation
packages/api/tests/lambdas/test-orca-backup-reconciliation-report.js
Outdated
Show resolved
Hide resolved
@@ -612,114 +623,6 @@ describe('When there are granule differences and granule reconciliation is run', | |||
}); | |||
}); | |||
|
|||
// TODO: the internal report functionality will be removed after collections/granules is changed to no longer use ES | |||
xdescribe('Create an Internal Reconciliation Report to monitor internal discrepancies', () => { |
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.
This test is removed as internal reports are going away.
|
||
const pgGranulesIterator = new QuerySearchClient( | ||
granulesSearchQuery, | ||
100 // arbitrary limit on how items are fetched at once |
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.
Reviewers: looking for opinions on value/approach here. Given we're explicitly bounding this on performance testing per team decision/given existing limitations in the tool, I'm not sure if that veers into YAGNI given this might need refactored. We're using this value for the other recon reports, however....
const { | ||
granules: granulesTable, | ||
collections: collectionsTable, | ||
providers: providersTable, | ||
} = TableNames; | ||
const temporalColumn = temporalBoundByCreatedAt ? 'created_at' : 'updated_at'; |
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.
We don't have index on granules.created_at. Do we need to create one?
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.
@jennyhliu that's a complicated question. We should discuss with the PO re: perf requirements.
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.
Why do we update this if 'internal' reconciliation report is no longer needed?
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.
Great question - this should just be removed along with it's units/etc. I'd been originally planning on doing that in a separate PR, but at this point it can just be included here.
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.
@jennyhliu - after doing work on downstream parts of this ticket, I'm going to punt that to PR#3 in this ticket.
const nextOrcaId = `${nextOrcaItem.id}:${nextOrcaItem.collectionId}`; | ||
if (nextCumulusId < nextOrcaId) { | ||
// Found an item that is only in Cumulus and not in ORCA. | ||
addGranuleToReport({ | ||
// eslint-disable-next-line no-await-in-loop | ||
await addGranuleToReport({ |
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.
so addGranuleToReport is likely called for every granule to retrieve files?
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.
@jennyhliu correct - this will increase the number of database calls, but by making them per-granule given how the rec reports are currently setup this should effectively disperse that load.
We absolutely need to improve the overall setup for these tests, that work should neatly fall under the 'improve rec reports' epic.
@jennyhliu I believe I've addressed your comments, thanks for the review! 🙇🏻 feature has also been merged in. |
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.
Good work🌟
Summary: Summary of changes
Addresses Internal/Orca reconciliation report components from CUMULUS-3806
Changes
@cumulus/db/lib/granule.getGranulesByApiPropertiesQuery
tobe parameterized and include a modifier on
temporalBoundByCreatedAt
and updated API to throw an error if report is requested
postgres via
getGranulesByApiPropertiesQuery
PR Checklist