Set datastream status to deleting for delete call #918
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
invokePostDSStateChangeAction
it passes the instance of Datastream that has status set before delete call. See below, for datastreammp-test-final
was inREADY
state when delete API call happened and it passes theStatus=READY
toinvokePostDSStateChangeAction
which suppose to be DELETING. This PR fixes that.