Bug 795559 - cannot change subcategory metadata if resource type has been extended
cannot change subcategory metadata if resource type has been extended
Status: CLOSED WORKSFORME
Product: RHQ Project
Classification: Other
Component: Core Server (Show other bugs)
4.2
Unspecified Unspecified
medium Severity medium (vote)
: ---
: RHQ 4.9
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-20 16:59 EST by John Mazzitelli
Modified: 2013-09-10 03:41 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-30 16:33:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Mazzitelli 2012-02-20 16:59:03 EST
If you extend one resource type via the "embedded style" of plugin extension, and that "parent" resource type has <subcategories>, you cannot change those subcategories, otherwise database deadlocks occurs.

Example - you have two plugins. The "parent" plugin with a "parent" resource type and a "child" plugin with a "child" resource type that simply extends the parent type:

   -------------------------
   parent plugin descriptor:
   -------------------------
   <plugin name="ParentPlugin" version="1.0">
       <server name="ParentServerA">
           <subcategories>
               <subcategory name="A-subcat"/>
           </subcategories>
   ...

   -------------------------
   child plugin descriptor:
   -------------------------

   <plugin name="ChildPlugin">
       <server name="ChildServerA"
               sourcePlugin="ParentPlugin"
               sourceType="ParentServerA">
       </server>
   ...

Now, suppose you upgrade the parent plugin. As part of the changes to the new parent plugin, you want to add a new subcategory:

   <plugin name="ParentPlugin" version="2.0">
       <server name="ParentServerA">
           <subcategories>
               <subcategory name="A-subcat"/>
               <subcategory name="A-subcat-NEW"/> <!-- a new subcategory -->
           </subcategories>
   ...

Once you deploy this new parent plugin and the system attempts to upgrade the metadata, their appears to be some kind of database deadlock. Removing the new subcategory from the new descriptor (that is, leave the subcategories the same from the original plugin) and things work and the upgrade completes.

(note: I saw this while writing a unit test for bug #747925)
Comment 1 Mike Foley 2012-02-27 12:13:04 EST
triage 2/27/2012 mfoley, asantos, crouch, loleary
Comment 2 Heiko W. Rupp 2013-07-23 05:19:21 EDT
I tried to reproduce this by first adding 
    <subcategories>
       <subcategory name="foo"/>
     </subcategories>
To 
   <server name="JMX Server" discovery="JMXDiscoveryComponent"

which is e.g. used in 


    <server name="JBoss AS JVM" description="JVM of the JBoss AS" sourcePlugin="JMX" sourceType="JMX Server"

and similar for storage-plugin and agent-plugin.

Deployed the updated plugin into the running server without issues.
Then added another <subcategory> and deployed again without issues.

Can you please give more information on how to reproduce?
Comment 3 John Mazzitelli 2013-07-23 09:22:07 EDT
(In reply to Heiko W. Rupp from comment #2)
> I tried to reproduce this by first adding 
>     <subcategories>
>        <subcategory name="foo"/>
>      </subcategories>
> To 
>    <server name="JMX Server" discovery="JMXDiscoveryComponent"
> 
> which is e.g. used in 
> 
> 
>     <server name="JBoss AS JVM" description="JVM of the JBoss AS"
> sourcePlugin="JMX" sourceType="JMX Server"
> 
> and similar for storage-plugin and agent-plugin.
> 
> Deployed the updated plugin into the running server without issues.
> Then added another <subcategory> and deployed again without issues.
> 
> Can you please give more information on how to reproduce?

This issue's description is all that I have for reproduction steps (I thought those steps were actually pretty detailed :)

It's possible this has been fixed by other changes in the past year and a half.
Comment 4 Heiko W. Rupp 2013-08-30 16:33:06 EDT
The original issue can not be reproduced any more.

If this shows up agin, we need to re-open.

Note You need to log in before you can comment on or make changes to this bug.