You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2016/01/12 01:20:40 UTC

[jira] [Commented] (AMBARI-14615) Blueprints HostGroupComponentEntity primary key is incorrectly specified

    [ https://issues.apache.org/jira/browse/AMBARI-14615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15092979#comment-15092979 ] 

Hudson commented on AMBARI-14615:
---------------------------------

SUCCESS: Integrated in Ambari-trunk-Commit #4148 (See [https://builds.apache.org/job/Ambari-trunk-Commit/4148/])
AMBARI-14615. Blueprints HostGroupComponentEntity primary key is (rnettleton: [http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=3a9ecc09249320b08c7ff69a1384ece5a90c6b63])
* ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostGroupComponentEntityPK.java
* ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostGroupComponentEntity.java


> Blueprints HostGroupComponentEntity primary key is incorrectly specified
> ------------------------------------------------------------------------
>
>                 Key: AMBARI-14615
>                 URL: https://issues.apache.org/jira/browse/AMBARI-14615
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.2.1
>            Reporter: Robert Nettleton
>            Assignee: Robert Nettleton
>            Priority: Critical
>             Fix For: 2.2.1
>
>         Attachments: AMBARI-14615.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The patch for AMBARI-14555 introduced an error into the entity defintion for the "hostgroup_component" table.  That patch added a new column, "provision_action", that was not mean to be added to the entity's primary key, but was added incorrectly.  
> The "provision_action" column should not be marked with the "@Id" annotation, as it is not meant to be included in the entity's primary key. 
> This accidental inclusion of the @Id anntation, combined with the fact that this column is null-able, can cause the following exception when attempting a Blueprint operation:
> {code}
> Local Exception Stack: 
> Exception [EclipseLink-6044] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
> Exception Description: The primary key read from the row [ArrayRecord(
> hostgroup_component.name => AMBARI_SERVER
> hostgroup_component.provision_action => null
> hostgroup_component.blueprint_name => hadoop_ha
> hostgroup_component.hostgroup_name => headnode0)] during the execution of the query was detected to be null. Primary keys must not contain null.
> Query: ReadAllQuery(name="components" referenceClass=HostGroupComponentEntity sql="SELECT name, provision_action, blueprint_name, hostgroup_name FROM hostgroup_component WHERE ((blueprint_name = ?) AND (hostgroup_name = ?))")
> at org.eclipse.persistence.exceptions.QueryException.nullPrimaryKeyInBuildingObject(QueryException.java:922)
> at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:715)
> at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:1340)
> at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:516)
> at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1168)
> at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
> at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127)
> at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403)
> at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:3214)
> at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
> at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
> at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:129)
> at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:116)
> at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:89)
> at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:173)
> at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:234)
> at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:89)
> at org.eclipse.persistence.indirection.IndirectList.buildDelegate(IndirectList.java:252)
> at org.eclipse.persistence.indirection.IndirectList.getDelegate(IndirectList.java:423)
> {code}
> The fix is to remove the annotations that include this column in the primary key definition.  
> I'm working on a fix for this, and will be submitting a patch shortly. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)