rhq-project/rhq — pull request #18 by metlos (2014-03-27 14:50:02+00:00)
Title: [BZ 1076104] Plugins no longer require explicit purge to disappear from DB

The reason for an explicit merge was to prevent plugin re-appearance in an HA setup where when server A would delete a server from its filesystem and the DB, the server B would still have the plugin on its filesystem and it'd assume that it was a new plugin if it didn't see it in the DB.

To accomodate for it, we required the user to explicitely purge the plugin once they thought it was safe to do so. This was highly confusing for the users and this PR takes as away that requirement, handling the HA servers coordination automatically.

We already had a `PurgePluginsJob` class that did the actual purging for plugins that were marked as such. This PR takes advantage of this fact and reuses that job to do the purging. It basically only changes the conditions under which the plugin is deemed "purgeable".

Before, the plugin was purgeable if user marked it as such and all its resource types were removed from the system.

This PR introduces a new DB table in which each HA server acknowledges what plugins it has seen as deleted.

The plugin is then purgeable once all its resource types are deleted and all the servers in HA acknowledged its deletion.