Cleanup shovels deleted from another node #11101
Merged
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.
There are two ways to delete a shovel -
rabbitmqctl delete_shovel
andrabbitmqctl clear_parameter
. The former works correctly (to the extent I tried), the latter doesn't clean up the shovel status correctly when the shovel is deleted from a another node. The shovel process is actually stopped, but it's not removed from the ETS table and is therefore returned inrabbitmqctl shovel_status
, Management UI, etc.The problems was that
rabbit_shovel_status:remove(Name)
was called on the node where the command was executed, rather than on the node running the shovel. This PR addresses this by calling this function from the shovel (worker) process itself, upon termination.To reproduce the problem:
perf-test -qq -u src -C 1; perf-test -qq -u dst -C 1
rabbitmqctl -n rabbit-1 shovel_status
still reporting this shovel as running, even though it doesn't exist at all (Management UI also shows this shovel)With this PR, the last command should return an empty result.