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

fix(backfill): ingest relationships + use createdon desc during entit… #487

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

jsdonn
Copy link
Contributor

@jsdonn jsdonn commented Dec 11, 2024

Summary

job-gms uses (urn, aspect, version, createdon) as its primary key. The current backfillEntityTables logic reads a single row from metadata_aspect and inserts it into the entity table. This normally works since the primary key of all other metadata_aspect tables is (urn, aspect, version) so it will always only have 1 result. But with job-gms, there could be multiple version 0 rows so the current logic is indeterministic on which of the possible rows it returns.

In this PR, update the query from the aspect table to order by createdon desc so that the most recently updated row is always returned in the case when there are multiple (urn, aspect, version) matches.

Also handle relationship ingestion (which was previously handled by _localAccess.add() but refactored into a separate method) during the entity table backfill.

Testing Done

update unit test for local relationships, local deployment of job-gms to confirm createdon desc query works.

Checklist

@jsdonn jsdonn marked this pull request as ready for review December 11, 2024 06:44
Copy link
Contributor

@rakhiagr rakhiagr left a comment

Choose a reason for hiding this comment

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

LGTM

@rakhiagr rakhiagr merged commit b710127 into linkedin:master Dec 11, 2024
2 checks passed
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