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

Set datastream status to deleting for delete call #918

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

hshukla
Copy link
Collaborator

@hshukla hshukla commented Nov 30, 2022

EXPLICITLY set the status to DatastreamStatus.DELETING as _store.deleteDatastream(datastreamName); creates new Datastream instance and sets the status on that, which will not be reflected here into original Datastream instance then invoke post datastream state change action for recently deleted datastream

Testing: when delete API gets called, it fetches the datastream from ZK and uses that object to set the status as delete, this is being done in ZookeeperBackedDatastreamStore::deleteDatastream and DatastreamResources::delete() does not have visibility into this object. So when it calls invokePostDSStateChangeAction it passes the instance of Datastream that has status set before delete call. See below, for datastream mp-test-final was in READY state when delete API call happened and it passes the Status=READY to invokePostDSStateChangeAction which suppose to be DELETING. This PR fixes that.

2022/11/30 21:36:19.847 INFO [DatastreamResources] [qtp307605969-70] [brooklin-service] [AAXutuUrhM+kEcZT/gwPUA==] Delete datastream called for datastream mp-test-final
2022/11/30 21:36:19.850 INFO [DatastreamMetadataProducer] [qtp307605969-70] [brooklin-service] [AAXutuUrhM+kEcZT/gwPUA==] Perform postDatastreamStateChangeAction datastreamName=mp-test-final
2022/11/30 21:36:19.850 INFO [DatastreamResources] [qtp307605969-70] [brooklin-service] [AAXutuUrhM+kEcZT/gwPUA==] Invoked post datastream state change action datastream={**Status=READY**, metadata={------}}
2022/11/30 21:36:19.850 INFO [DatastreamMetadataProducer] [pool-30-thread-1] [brooklin-service] [] publish metadata for datastreamName=mp-test-final status=READY

Copy link
Collaborator

@jogrogan jogrogan left a comment

Choose a reason for hiding this comment

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

LGTM but maybe we should open an issue to investigate/document why we make additional getDatastream calls for update/delete?

@hshukla hshukla merged commit fdd16b9 into linkedin:master Nov 30, 2022
@hshukla hshukla deleted the setDelete branch November 30, 2022 22:28
@ehoner ehoner mentioned this pull request Jan 19, 2023
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