ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sid Wagle" <swa...@hortonworks.com>
Subject Re: Review Request 41465: RU: Finalize Downgrade failed
Date Wed, 16 Dec 2015 21:39:36 GMT


> On Dec. 16, 2015, 9:22 p.m., Sid Wagle wrote:
> > Why not refresh clusterEntity vs using a possible stale reference?
> > 
> > ClusterEntity clusterEntity = getClusterEntity();
> > 
> > long clusterId = clusterEntity.getClusterId();
> > .....
> > 
> > I think this will make the refresh unnecessary.
> 
> Nate Cole wrote:
>     Because that would then make the "business object" clusterEntity the stale one. 
Truthfully we should NEVER hold on to any entity, but that's a bigger change then what should
be happening at this late date.

I think we should do that, since clusterEntity is stale, we did make these changes at ServiceImpl,
ServiceComponentImpl and ServiceComponentHostImpl.
I missed this change in ClusterImpl, I should have done it but the ClusterImpl setters are
called to infrequently so reads are ok from cache.


- Sid


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


On Dec. 16, 2015, 8:58 p.m., Nate Cole wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41465/
> -----------------------------------------------------------
> 
> (Updated Dec. 16, 2015, 8:58 p.m.)
> 
> 
> 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