[AMBARI-23129] Multiple issues while executing Ambari server upgrade to Ambari 2.7.0#608
[AMBARI-23129] Multiple issues while executing Ambari server upgrade to Ambari 2.7.0#608rlevas merged 2 commits intoapache:trunkfrom
Conversation
| @Inject | ||
| @Transactional | ||
| void loadClustersAndHosts() { | ||
| private void loadClustersAndHosts() { |
There was a problem hiding this comment.
Guice AOP interceptors don't work on private methods.
This means that Transactional annotation will be ignored.
Please check what is correct behavior here.
There was a problem hiding this comment.
Is a transaction even relevant here? The method does a bunch of DAO reads. @jonathan-hurley?
There was a problem hiding this comment.
Theres RequiresSession annotation to mimic read-only transaction behavior.
Basically if session is not already opened on method call, each DAO read will create own session.
Not really relevant here since this method is not called frequently.
There was a problem hiding this comment.
Oh.. true. I can add the RequiresSession annotation if we think it is needed. I removed @Transactional
There was a problem hiding this comment.
That @Transactional was added a long, long time ago by Myroslav - I agree it's not needed.
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
What changes were proposed in this pull request?
1. An NPE is thrown will initializing the Ambari server upgrade catalog
com.google.inject.persist.jpa.JpaPersistService#beginthis.emFactoryisnull.Cause
com.google.inject.persist.jpa.JpaPersistService#start()was not called beforecom.google.inject.persist.jpa.JpaPersistService#beginto do order of operations inorg.apache.ambari.server.upgrade.SchemaUpgradeHelper#main.Solution
Ensure
com.google.inject.persist.jpa.JpaPersistService#start()is being called beforecom.google.inject.persist.jpa.JpaPersistService#begininorg.apache.ambari.server.upgrade.SchemaUpgradeHelper#main.2. Missing repo_os, repo_definition, and repo_tags tables
The
repo_os,repo_definition, andrepo_tagstables were never added to the UpgradeCatalog implementation. The migration logic is also needed.Solution
Add the missing tables and logic while executing
org.apache.ambari.server.upgrade.UpgradeCatalog270#executeDDLUpdates.3. Entity classes are initialized before the schema of the underlying database is updated
Solution
Notify relevant classes that the persistence infrastructure is ready after DDL updates have been applied.
The
org.apache.ambari.server.events.publishers.AmbariEventPublisheris to be used for issuing aorg.apache.ambari.server.events.JpaInitializedEvent.4. JVM does not exit after performing upgrade
After executing
ambari-server upgrade, the JVM process hangs and does not exit. According to the logs, no errors have occurred.Cause
The cause of this is several non-daemon threads not being shutdown by Ambari code.
Solution
Change relevant non-daemon threads to daemon threads and ensure any thread polls are not forcing one thread to be alive at all times.
How was this patch tested?
Ran unit tests.
Executed Ambari upgrade
Executed Ambari, started and stop services
Please review Ambari Contributing Guide before opening a pull request.