ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myroslav Papirkovskyy" <mpapyrkovs...@hortonworks.com>
Subject Re: Review Request 41465: RU: Finalize Downgrade failed
Date Wed, 16 Dec 2015 21:40:08 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41465/#review110759
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java (line
3162)
<https://reviews.apache.org/r/41465/#comment170766>

    Can you remove refresh calls and use getClusterEntity() instead of direct clusterEntity
field in affected methods?
    It will be more clear and you will avoid at least one direct db fetch.
    
    Also it looks like original root cause of esception is cascade merging detached entity
tree. We should consider removing cascades. They cause too much issues.


- Myroslav Papirkovskyy


On Гру. 16, 2015, 10:58 після полудня, Nate Cole wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41465/
> -----------------------------------------------------------
> 
> (Updated Гру. 16, 2015, 10:58 після полудня)
> 
> 
> Review request for Ambari, Alejandro Fernandez and Jonathan Hurley.
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Following exception occurs on occasion when downgrading.
> 
> Not 100% sure of the fix, but it appears as though using a clusterEntity outside the
UnitOfWork for which it was originally loaded may confuse JPA when trying to merge.  It's
not certain if the change will actually fix the issue.
> 
> Exception [EclipseLink-6004] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):
org.eclipse.persistence.exceptions.QueryException
> Exception Description: The object [org.apache.ambari.server.orm.entities.ClusterConfigEntity@3646b3a8],
of class [class org.apache.ambari.server.orm.entities.ClusterConfigEntity], with identity
hashcode (System.identityHashCode()) [364,075,546], 
> is not from this UnitOfWork object space, but the parent session's.  The object was never
registered in this UnitOfWork, 
> but read from the parent session and related to an object registered in the UnitOfWork.
 Ensure that you are correctly
> registering your objects.  If you are still having problems, you can use the UnitOfWork.validateObjectSpace()
method to 
> help debug where the error occurred.  For more information, see the manual or FAQ.
> 	at org.eclipse.persistence.exceptions.QueryException.backupCloneIsOriginalFromParent(QueryException.java:298)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.getBackupClone(UnitOfWorkImpl.java:1995)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3976)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3894)
> 	at org.eclipse.persistence.mappings.CollectionMapping.buildElementUnitOfWorkClone(CollectionMapping.java:308)
> 	at org.eclipse.persistence.mappings.CollectionMapping.buildElementClone(CollectionMapping.java:321)
> 	at org.eclipse.persistence.internal.queries.ContainerPolicy.addNextValueFromIteratorInto(ContainerPolicy.java:217)
> 	at org.eclipse.persistence.mappings.CollectionMapping.buildCloneForPartObject(CollectionMapping.java:223)
> 	at org.eclipse.persistence.internal.indirection.UnitOfWorkQueryValueHolder.buildCloneFor(UnitOfWorkQueryValueHolder.java:60)
> 	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)
> 	at org.eclipse.persistence.indirection.IndirectList.size(IndirectList.java:761)
> 	at org.eclipse.persistence.internal.queries.CollectionContainerPolicy.sizeFor(CollectionContainerPolicy.java:177)
> 	at org.eclipse.persistence.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:1566)
> 	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:4132)
> 	at org.eclipse.persistence.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:594)
> 	at org.eclipse.persistence.internal.sessions.MergeManager.mergeChanges(MergeManager.java:313)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:3521)
> 	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.mergeCloneWithReferences(RepeatableWriteUnitOfWork.java:384)
> 	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:3481)
> 	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.mergeInternal(EntityManagerImpl.java:542)
> 	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.merge(EntityManagerImpl.java:519)
> 	at org.apache.ambari.server.orm.dao.ClusterDAO.merge(ClusterDAO.java:338)
> 	at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:60)
> 	at org.apache.ambari.server.orm.dao.ClusterDAO.merge(ClusterDAO.java:320)
> 	at org.apache.ambari.server.state.cluster.ClusterImpl.removeAllConfigsForStack(ClusterImpl.java:3088)
> 	at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:68)
> 	at org.apache.ambari.server.state.cluster.ClusterImpl.removeConfigurations(ClusterImpl.java:3121)
> 	at org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction.finalizeDowngrade(FinalizeUpgradeAction.java:314)
> 	at org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction.execute(FinalizeUpgradeAction.java:116)
> 	at org.apache.ambari.server.serveraction.ServerActionExecutor$Worker.execute(ServerActionExecutor.java:537)
> 	at org.apache.ambari.server.serveraction.ServerActionExecutor$Worker.run(ServerActionExecutor.java:474)
> 	at java.lang.Thread.run(Thread.java:745)
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
ceefa60 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
b2a8485 
> 
> Diff: https://reviews.apache.org/r/41465/diff/
> 
> 
> Testing
> -------
> 
> Pending
> 
> 
> Thanks,
> 
> Nate Cole
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message