Bug 1004449

Summary: Storage node not properly created during upgrade
Product: [Other] RHQ Project Reporter: John Sanda <jsanda>
Component: Core ServerAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Armine Hovsepyan <ahovsepy>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 4.9CC: hrupp, mfoley
Target Milestone: ---   
Target Release: RHQ 4.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-24 19:09:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 951619, 1004431    

Description John Sanda 2013-09-04 16:21:15 UTC
Description of problem:
During 4.9 development the maintenance_pending column was added to the rhq_storage_nodes table, and the maintenancePending field added to StorageNode.java. The field is a primitive boolean. During an upgrade from versions prior to 4.8, a storage node is created with a null value in the maintenance_pending column. This causing the following exception at server start up,

12:06:52,917 INFO  [org.rhq.enterprise.server.storage.StorageClientManagerBean] (pool-9-thread-1) Initializing storage client subsystem
12:06:52,934 ERROR [org.jboss.as.ejb3] (pool-9-thread-1) javax.ejb.EJBTransactionRolledbackException: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of org.rhq.core.domain.cloud.StorageNode.maintenancePending
12:06:52,935 ERROR [org.jboss.as.ejb3.invocation] (pool-9-thread-1) JBAS014134: EJB Invocation failed on component StorageNodeManagerBean for method public abstract java.util.List org.rhq.enterprise.server.cloud.StorageNodeManagerLocal.getStorageNodes(): javax.ejb.EJBTransactionRolledbackException: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of org.rhq.core.domain.cloud.StorageNode.maintenancePending


Two things need to be done. First, a not-null constraint needs to be added to the dbupgrade script. Secondly, the server installer code that creates the storage node entity needs to set the maintenance_pending column.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 John Sanda 2013-09-04 19:33:07 UTC
The changes to dbupgrade and to the server installer have been made. I tested this on a 4.7 upgrade.

master commit hash: 8f4561e803

Comment 2 Armine Hovsepyan 2013-09-05 11:29:42 UTC
verified -no PropertyAccessException visible anmore - leading to server upgrade (even though not started correctly --  see #1004731)

Comment 3 Heiko W. Rupp 2013-09-24 19:09:19 UTC
Bulk closing of RHQ 4.9 verified items