Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-21362

Ambari upgrade not idempotent due to moveClusterHostColumnFromStageToRequest

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.5.1
    • 2.5.2
    • ambari-server
    • None

    Description

      Ambari upgrade to 2.5.1 or later from 2.5.0 or earlier fails ony retry at moveClusterHostColumnFromStageToRequest.

      Steps to simulate retry:

      1. Install Ambari 2.5.1
      2. UPDATE metainfo SET metainfo_value = '2.5.0';
      3. ambari-server upgrade

      Expected result: "upgrade" succeeds.
      Actual result: schema upgrade fails due to exception below.

      ERROR: Exception in thread "main" org.apache.ambari.server.AmbariException: ERROR: column b.cluster_host_info does not exist
        Position: 45
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:210)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:425)
      Caused by: org.postgresql.util.PSQLException: ERROR: column b.cluster_host_info does not exist
        Position: 45
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)
      	at org.apache.ambari.server.orm.DBAccessorImpl.executeUpdate(DBAccessorImpl.java:812)
      	at org.apache.ambari.server.orm.DBAccessorImpl.moveColumnToAnotherTable(DBAccessorImpl.java:1335)
      	at org.apache.ambari.server.upgrade.UpgradeCatalog251.moveClusterHostColumnFromStageToRequest(UpgradeCatalog251.java:131)
      	at org.apache.ambari.server.upgrade.UpgradeCatalog251.executeDDLUpdates(UpgradeCatalog251.java:90)
      	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:925)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:207)
      	... 1 more
      

      Attachments

        1. AMBARI-21362.patch
          3 kB
          Attila Doroszlai

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: