[
https://issues.apache.org/jira/browse/AMBARI-6602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alejandro Fernandez reassigned AMBARI-6602:
-------------------------------------------
Assignee: Alejandro Fernandez (was: Myroslav Papirkovskyy)
> Error upgrading from 1.6.0 to 1.6.1 using external Postgres DB
> --------------------------------------------------------------
>
> Key: AMBARI-6602
> URL: https://issues.apache.org/jira/browse/AMBARI-6602
> Project: Ambari
> Issue Type: Bug
> Affects Versions: 1.7.0
> Reporter: Mahadev konar
> Assignee: Alejandro Fernandez
> Fix For: 1.7.0
>
>
> Error upgrading from 1.6.0 to 1.6.1 using external Postgres DB
> If a user has an external postgres database either without a schema, or a
> schema whose name is different from the database name, then running
> "ambari-server upgrade" fails.
> The most common case is for an embedded postgres database, in which the
> database and schema name are the same, so this is not an issue.
> However, when using an external postgres database, it's likely that the
> schema is empty, so the upgrade fails due to a bug in which it expects the
> schema name to be the same as the database name.
> The fix is to prompt the user for the schema name whenever installing a
> postgres database (either embedded or external). The schema name is then
> saved in ambari.properties, so that AbstractUpgradeCatalog.java can check for
> postgres database type, nonempty username, and nonempty schema name before
> attempting the grant schema ownership to the account during an upgrade.
> {code}
> 14:16:57,584 INFO [main] SchemaUpgradeHelper:224 - Upgrading schema to target
> version = 1.6.1
> 14:16:57,620 INFO [main] SchemaUpgradeHelper:233 - Upgrading schema from
> source version = 1.6.0
> 14:16:57,623 INFO [main] SchemaUpgradeHelper:142 - Upgrade path: [{
> ugradeCatalog: sourceVersion = 1.6.0, targetVersion = 1.6.1 }]
> 14:16:57,623 INFO [main] SchemaUpgradeHelper:173 - Executing DDL upgrade...
> 14:16:57,630 INFO [main] DBAccessorImpl:472 - Executing query: ALTER SCHEMA
> postgres OWNER TO "******;
> 14:16:57,645 WARN [main] DBAccessorImpl:478 - Error executing query: ALTER
> SCHEMA postgres OWNER TO "*****";
> org.postgresql.util.PSQLException: ERROR: schema "******" does not exist
> 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.execute(AbstractJdbc2Statement.java:395)
>
> at
> org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:475)
>
> at
> org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:461)
>
> at
> org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.changePostgresSearchPath(AbstractUpgradeCatalog.java:169)
>
> at
> org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:252)
>
> at
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:178)
>
> at
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:238)
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)