Red Hat Bugzilla – Bug 877073
Failed plugin installation should not install plugin JAR in database
Last modified: 2012-11-15 11:20:45 EST
Description of problem:
During plugin installation, persisting the plugin jar file and persisting the plugin meta data are done in two, separate transactions. The jar file is persisted followed by the meta data. If an error occurs while installing the meta data that transaction is rolled back, but the newer jar file is still in the database.
A common example of how this might happen is deploying a plugin where a field in the descriptor excedes its max length. This is somewhat related to bug 857189 in that it is another case where we need support for application level rollback.
If it a completely new plugin, then we could delete the row from the rhq_plugin table and log an appropriate message. If it is an upgrade situation, then we should copy the original plugin from the database, and if an error occurs while persisting meta data, then we can re-insert the original plugin and log an appropriate message.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Modify the name of a resource type in a plugin descriptor so that the length exceeds 100 characters.
2. Install the plugin.
3. You should see error messages in the server log about a database constraint violoation.
4. Query the rhq_plugin table and you will find the plugin there, but it should not be.