Re: Review Request 63961: Ambari upgrade failed

2017-11-22 Thread Jonathan Hurley

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


Ship it!




Ship It!

- Jonathan Hurley


On Nov. 21, 2017, 12:56 p.m., Dmitro Lisnichenko wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63961/
> ---
> 
> (Updated Nov. 21, 2017, 12:56 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley and Nate Cole.
> 
> 
> Bugs: AMBARI-22469
> https://issues.apache.org/jira/browse/AMBARI-22469
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Ambari upgrade would fail for all Ambari view servers.
> Steps to reproduce:
> 1. Install Ambari 2.5.2 and setup it as view server. (it you don't set up it 
> up as view server also it fails)
> 2. now install 2.6.0
> 3. run ambari-server upgrade
> it fails out with below exception.
> 
> {noformat}
> ERROR: Error executing schema upgrade, please check the server logs.
> ERROR: Error output from schema upgrade command:
> ERROR: Exception in thread "main" org.apache.ambari.server.AmbariException: 
> Unable to find any CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:203)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
> Caused by: org.apache.ambari.server.AmbariException: Unable to find any 
> CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.getCurrentVersionID(UpgradeCatalog260.java:510)
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:194)
>   at 
> org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
>   ... 1 more
> 
> 
> ERROR: Ambari server upgrade failed. Please look at 
> /var/log/ambari-server/ambari-server.log, for more details.
> ERROR: Exiting with exit code 11.
> REASON: Schema upgrade failed.
> {noformat}
> 
> For some reason we are checking cluster_version table entries and throwing up 
> above exception.
> 
> 
> {noformat}
> In UpgradeCatalog260.java
> public int getCurrentVersionID() throws AmbariException, SQLException {
> List currentVersionList = 
> dbAccessor.getIntColumnValues(CLUSTER_VERSION_TABLE, REPO_VERSION_ID_COLUMN,
> new String[]{STATE_COLUMN}, new String[]{CURRENT}, false);
> if (currentVersionList.isEmpty()) {
>   throw new AmbariException("Unable to find any CURRENT repositories.");
> } else if (currentVersionList.size() != 1) {
>   throw new AmbariException("The following repositories were found to be 
> CURRENT: ".concat(StringUtils.join(currentVersionList, ",")));
> }
> return currentVersionList.get(0);
>   }
> {noformat}
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
>  96ce807d5f 
> 
> 
> Diff: https://reviews.apache.org/r/63961/diff/2/
> 
> 
> Testing
> ---
> 
> check on live cluster
> tests passed
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>



Re: Review Request 63961: Ambari upgrade failed

2017-11-21 Thread Nate Cole

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


Ship it!





ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
Line 365 (original), 368 (patched)


If things are working, then I'm ok with this.


- Nate Cole


On Nov. 21, 2017, 12:56 p.m., Dmitro Lisnichenko wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63961/
> ---
> 
> (Updated Nov. 21, 2017, 12:56 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley and Nate Cole.
> 
> 
> Bugs: AMBARI-22469
> https://issues.apache.org/jira/browse/AMBARI-22469
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Ambari upgrade would fail for all Ambari view servers.
> Steps to reproduce:
> 1. Install Ambari 2.5.2 and setup it as view server. (it you don't set up it 
> up as view server also it fails)
> 2. now install 2.6.0
> 3. run ambari-server upgrade
> it fails out with below exception.
> 
> {noformat}
> ERROR: Error executing schema upgrade, please check the server logs.
> ERROR: Error output from schema upgrade command:
> ERROR: Exception in thread "main" org.apache.ambari.server.AmbariException: 
> Unable to find any CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:203)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
> Caused by: org.apache.ambari.server.AmbariException: Unable to find any 
> CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.getCurrentVersionID(UpgradeCatalog260.java:510)
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:194)
>   at 
> org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
>   ... 1 more
> 
> 
> ERROR: Ambari server upgrade failed. Please look at 
> /var/log/ambari-server/ambari-server.log, for more details.
> ERROR: Exiting with exit code 11.
> REASON: Schema upgrade failed.
> {noformat}
> 
> For some reason we are checking cluster_version table entries and throwing up 
> above exception.
> 
> 
> {noformat}
> In UpgradeCatalog260.java
> public int getCurrentVersionID() throws AmbariException, SQLException {
> List currentVersionList = 
> dbAccessor.getIntColumnValues(CLUSTER_VERSION_TABLE, REPO_VERSION_ID_COLUMN,
> new String[]{STATE_COLUMN}, new String[]{CURRENT}, false);
> if (currentVersionList.isEmpty()) {
>   throw new AmbariException("Unable to find any CURRENT repositories.");
> } else if (currentVersionList.size() != 1) {
>   throw new AmbariException("The following repositories were found to be 
> CURRENT: ".concat(StringUtils.join(currentVersionList, ",")));
> }
> return currentVersionList.get(0);
>   }
> {noformat}
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
>  96ce807d5f 
> 
> 
> Diff: https://reviews.apache.org/r/63961/diff/2/
> 
> 
> Testing
> ---
> 
> check on live cluster
> tests passed
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>



Re: Review Request 63961: Ambari upgrade failed

2017-11-21 Thread Dmitro Lisnichenko

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




ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
Line 365 (original), 368 (patched)


currentRepoID null value as default column value for non-nullable column 
works as a safeguard here. If table is not empty, the statement would fail.
Nate proposed to use -1 if not current cluster version exists. But if we 
happen to have entries at SERVICE_DESIRED_STATE_TABLE or  
SERVICE_COMPONENT_DESIRED_STATE_TABLE, that would populate their current 
cluster version id with -1

Open for discussion


- Dmitro Lisnichenko


On Nov. 21, 2017, 7:56 p.m., Dmitro Lisnichenko wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63961/
> ---
> 
> (Updated Nov. 21, 2017, 7:56 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley and Nate Cole.
> 
> 
> Bugs: AMBARI-22469
> https://issues.apache.org/jira/browse/AMBARI-22469
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Ambari upgrade would fail for all Ambari view servers.
> Steps to reproduce:
> 1. Install Ambari 2.5.2 and setup it as view server. (it you don't set up it 
> up as view server also it fails)
> 2. now install 2.6.0
> 3. run ambari-server upgrade
> it fails out with below exception.
> 
> {noformat}
> ERROR: Error executing schema upgrade, please check the server logs.
> ERROR: Error output from schema upgrade command:
> ERROR: Exception in thread "main" org.apache.ambari.server.AmbariException: 
> Unable to find any CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:203)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
> Caused by: org.apache.ambari.server.AmbariException: Unable to find any 
> CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.getCurrentVersionID(UpgradeCatalog260.java:510)
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:194)
>   at 
> org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
>   ... 1 more
> 
> 
> ERROR: Ambari server upgrade failed. Please look at 
> /var/log/ambari-server/ambari-server.log, for more details.
> ERROR: Exiting with exit code 11.
> REASON: Schema upgrade failed.
> {noformat}
> 
> For some reason we are checking cluster_version table entries and throwing up 
> above exception.
> 
> 
> {noformat}
> In UpgradeCatalog260.java
> public int getCurrentVersionID() throws AmbariException, SQLException {
> List currentVersionList = 
> dbAccessor.getIntColumnValues(CLUSTER_VERSION_TABLE, REPO_VERSION_ID_COLUMN,
> new String[]{STATE_COLUMN}, new String[]{CURRENT}, false);
> if (currentVersionList.isEmpty()) {
>   throw new AmbariException("Unable to find any CURRENT repositories.");
> } else if (currentVersionList.size() != 1) {
>   throw new AmbariException("The following repositories were found to be 
> CURRENT: ".concat(StringUtils.join(currentVersionList, ",")));
> }
> return currentVersionList.get(0);
>   }
> {noformat}
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
>  96ce807d5f 
> 
> 
> Diff: https://reviews.apache.org/r/63961/diff/2/
> 
> 
> Testing
> ---
> 
> check on live cluster
> tests passed
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>



Re: Review Request 63961: Ambari upgrade failed

2017-11-21 Thread Dmitro Lisnichenko

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

(Updated Nov. 21, 2017, 7:56 p.m.)


Review request for Ambari, Jonathan Hurley and Nate Cole.


Bugs: AMBARI-22469
https://issues.apache.org/jira/browse/AMBARI-22469


Repository: ambari


Description
---

Ambari upgrade would fail for all Ambari view servers.
Steps to reproduce:
1. Install Ambari 2.5.2 and setup it as view server. (it you don't set up it up 
as view server also it fails)
2. now install 2.6.0
3. run ambari-server upgrade
it fails out with below exception.

{noformat}
ERROR: Error executing schema upgrade, please check the server logs.
ERROR: Error output from schema upgrade command:
ERROR: Exception in thread "main" org.apache.ambari.server.AmbariException: 
Unable to find any CURRENT repositories.
at 
org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:203)
at 
org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
Caused by: org.apache.ambari.server.AmbariException: Unable to find any CURRENT 
repositories.
at 
org.apache.ambari.server.upgrade.UpgradeCatalog260.getCurrentVersionID(UpgradeCatalog260.java:510)
at 
org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:194)
at 
org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
at 
org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
... 1 more


ERROR: Ambari server upgrade failed. Please look at 
/var/log/ambari-server/ambari-server.log, for more details.
ERROR: Exiting with exit code 11.
REASON: Schema upgrade failed.
{noformat}

For some reason we are checking cluster_version table entries and throwing up 
above exception.


{noformat}
In UpgradeCatalog260.java
public int getCurrentVersionID() throws AmbariException, SQLException {
List currentVersionList = 
dbAccessor.getIntColumnValues(CLUSTER_VERSION_TABLE, REPO_VERSION_ID_COLUMN,
new String[]{STATE_COLUMN}, new String[]{CURRENT}, false);
if (currentVersionList.isEmpty()) {
  throw new AmbariException("Unable to find any CURRENT repositories.");
} else if (currentVersionList.size() != 1) {
  throw new AmbariException("The following repositories were found to be 
CURRENT: ".concat(StringUtils.join(currentVersionList, ",")));
}
return currentVersionList.get(0);
  }
{noformat}


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
 96ce807d5f 


Diff: https://reviews.apache.org/r/63961/diff/2/

Changes: https://reviews.apache.org/r/63961/diff/1-2/


Testing (updated)
---

check on live cluster
tests passed


Thanks,

Dmitro Lisnichenko



Re: Review Request 63961: Ambari upgrade failed

2017-11-20 Thread Dmitro Lisnichenko

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




ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
Line 510 (original), 510 (patched)


I'm also considering changing this to

if (allVersionsList.isEmpty()) {
  return null;
} else if (currentVersionList.isEmpty()) {
  throw new AmbariException("Unable to find any CURRENT repositories.");
} else if (currentVersionList.size() != 1) {
  throw new AmbariException("The following repositories were found to be 
CURRENT: ".concat(StringUtils.join(currentVersionList, ",")));
}


- Dmitro Lisnichenko


On Nov. 20, 2017, 9:52 p.m., Dmitro Lisnichenko wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63961/
> ---
> 
> (Updated Nov. 20, 2017, 9:52 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley and Nate Cole.
> 
> 
> Bugs: AMBARI-22469
> https://issues.apache.org/jira/browse/AMBARI-22469
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Ambari upgrade would fail for all Ambari view servers.
> Steps to reproduce:
> 1. Install Ambari 2.5.2 and setup it as view server. (it you don't set up it 
> up as view server also it fails)
> 2. now install 2.6.0
> 3. run ambari-server upgrade
> it fails out with below exception.
> 
> {noformat}
> ERROR: Error executing schema upgrade, please check the server logs.
> ERROR: Error output from schema upgrade command:
> ERROR: Exception in thread "main" org.apache.ambari.server.AmbariException: 
> Unable to find any CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:203)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
> Caused by: org.apache.ambari.server.AmbariException: Unable to find any 
> CURRENT repositories.
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.getCurrentVersionID(UpgradeCatalog260.java:510)
>   at 
> org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:194)
>   at 
> org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
>   at 
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
>   ... 1 more
> 
> 
> ERROR: Ambari server upgrade failed. Please look at 
> /var/log/ambari-server/ambari-server.log, for more details.
> ERROR: Exiting with exit code 11.
> REASON: Schema upgrade failed.
> {noformat}
> 
> For some reason we are checking cluster_version table entries and throwing up 
> above exception.
> 
> 
> {noformat}
> In UpgradeCatalog260.java
> public int getCurrentVersionID() throws AmbariException, SQLException {
> List currentVersionList = 
> dbAccessor.getIntColumnValues(CLUSTER_VERSION_TABLE, REPO_VERSION_ID_COLUMN,
> new String[]{STATE_COLUMN}, new String[]{CURRENT}, false);
> if (currentVersionList.isEmpty()) {
>   throw new AmbariException("Unable to find any CURRENT repositories.");
> } else if (currentVersionList.size() != 1) {
>   throw new AmbariException("The following repositories were found to be 
> CURRENT: ".concat(StringUtils.join(currentVersionList, ",")));
> }
> return currentVersionList.get(0);
>   }
> {noformat}
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
>  96ce807d5f 
> 
> 
> Diff: https://reviews.apache.org/r/63961/diff/1/
> 
> 
> Testing
> ---
> 
> pending check on live cluster
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>