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(gms): Fixes delete references for single relationship aspects #7211

Merged

Conversation

pedro93
Copy link
Collaborator

@pedro93 pedro93 commented Feb 1, 2023

Deleting Container references were broken. This PR fixes that.

Root cause is #5248 which changed the MCP change type to DELETE for cases where an aspect after getting the reference removed was no longer valid. We do not support DELETE operations for MCPs.

The solution is then to execute EntityService#deleteAspect rather than emit a sync MCP.

A regression test was made to prevent this from happening again.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Feb 1, 2023
@mayurinehate
Copy link
Collaborator

Closes #5992

if (!ingestProposalResult.isDidUpdate()) {
log.error("Failed to ingest aspect with references removed. Before {}, after: null, please check MCP processor"
RollbackResult rollbackResult = _entityService.deleteAspect(urn.toString(), aspectName, new HashMap<>(), true);
assert rollbackResult != null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Assert statement should get wrapped into below conditional and proposal is no longer used except for the error message which is invalid as it's not being used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, please take another look.

@@ -403,6 +396,7 @@ private enum DeleteEntityServiceErrorReason {
ENTITY_SERVICE_ASPECT_NOT_FOUND,
ENTITY_REGISTRY_SPEC_NOT_FOUND,
MCP_PROCESSOR_FAILED,
ASPECT_DELETE_FAILED,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Amazing!

import static org.testng.AssertJUnit.*;


public class DeleteEntityServiceTest {
Copy link
Collaborator

Choose a reason for hiding this comment

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

scary if we did not have a class test for this previously :o

@pedro93 pedro93 merged commit 050f0c4 into datahub-project:master Feb 2, 2023
@pedro93 pedro93 deleted the ps-fix-container-reference-delete branch February 2, 2023 19:05
ericyomi pushed a commit to ericyomi/datahub that referenced this pull request Feb 8, 2023
…tahub-project#7211)

Deleting Container references were broken. This PR fixes that.

Root cause is datahub-project#5248 which changed the MCP change type to DELETE for cases where an aspect after getting the reference removed was no longer valid. We do not support DELETE operations for MCPs.

The solution is then to execute EntityService#deleteAspect rather than emit a sync MCP.

A regression test was made to prevent this from happening again.

Co-authored-by: John Joyce <[email protected]>
oleg-ruban pushed a commit to RChygir/datahub that referenced this pull request Feb 28, 2023
…tahub-project#7211)

Deleting Container references were broken. This PR fixes that.

Root cause is datahub-project#5248 which changed the MCP change type to DELETE for cases where an aspect after getting the reference removed was no longer valid. We do not support DELETE operations for MCPs.

The solution is then to execute EntityService#deleteAspect rather than emit a sync MCP.

A regression test was made to prevent this from happening again.

Co-authored-by: John Joyce <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants