Set datastream status to deleting for delete call#918
Merged
hshukla merged 1 commit intolinkedin:masterfrom Nov 30, 2022
Merged
Set datastream status to deleting for delete call#918hshukla merged 1 commit intolinkedin:masterfrom
hshukla merged 1 commit intolinkedin:masterfrom
Conversation
jogrogan
approved these changes
Nov 30, 2022
Collaborator
jogrogan
left a comment
There was a problem hiding this comment.
LGTM but maybe we should open an issue to investigate/document why we make additional getDatastream calls for update/delete?
shrinandthakkar
approved these changes
Nov 30, 2022
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 datastreamTesting: 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
invokePostDSStateChangeActionit passes the instance of Datastream that has status set before delete call. See below, for datastreammp-test-finalwas inREADYstate when delete API call happened and it passes theStatus=READYtoinvokePostDSStateChangeActionwhich suppose to be DELETING. This PR fixes that.