Skip to content

Only use the host if its Resource State is Enabled.#2512

Merged
DaanHoogland merged 1 commit intoapache:4.11from
mike-tutkowski:check-maint-mode
Mar 29, 2018
Merged

Only use the host if its Resource State is Enabled.#2512
DaanHoogland merged 1 commit intoapache:4.11from
mike-tutkowski:check-maint-mode

Conversation

@mike-tutkowski
Copy link
Member

Description

Update the StorageSystemSnapshotStrategy and StorageSystemDataMotionStrategy classes to only leverage a host when its Resource State is Enabled.

https://issues.apache.org/jira/browse/CLOUDSTACK-10345

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

How Has This Been Tested?

Checked to see if a host in maintenance mode is avoided

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@blueorangutan package

@blueorangutan
Copy link

@mike-tutkowski a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

vmSnapshot = takeHypervisorSnapshot(volumeInfo);
}
catch (ResourceAllocationException ex) {
catch (Exception ex) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mike-tutkowski, Thanks for the fix. I think it would be better to capture the required exceptions with multiple catches instead of the parent Exception class. We can always put this at the end.


SnapshotResult result = null;
SnapshotInfo snapshotOnPrimary = null;
SnapshotInfo snapshotOnPrimary;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the removal of this may create NPE.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this, @nitin-maharana?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an IntelliJ-recommended change. The IDE pointed out (correctly) that we did not need to assign null on this line because snapshotOnPrimary is later assigned a value regardless of the path the code takes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaanHoogland, My bad, wrong interpretation!! As @mike-tutkowski explained, that's redundant. Thanks!!

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1834

Copy link
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yadvr
Copy link
Member

yadvr commented Mar 27, 2018

@mike-tutkowski bugfixes can be considered for 4.11 branch, if you think this is useful for 4.11/tls please change the base-branch to 4.11 (and rebase your branch against 4.11). Please also put this PR against a milestone, 4.11.1.0, or 4.12.0.0 as applicable.

@mike-tutkowski
Copy link
Member Author

@rhtyd Sounds good, Rohit. I can change the base branch to 4.11 and rebase. I'll do that after I implement @nitin-maharana's suggestion around exception handling.

@mike-tutkowski mike-tutkowski changed the base branch from master to 4.11 March 27, 2018 17:46
@mike-tutkowski
Copy link
Member Author

@rhtyd @nitin-maharana @DaanHoogland I have rebased the code on top of 4.11 and changed the base branch of the PR. Also, @nitin-maharana: I was able to entirely remove that try/catch block.

@yadvr yadvr added this to the 4.11.1.0 milestone Mar 28, 2018
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1847

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-2435)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 92219 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2512-t2435-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_routers.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Smoke tests completed. 64 look OK, 3 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_vpc_privategw_static_routes Failure 150.61 test_privategw_acl.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 150.58 test_privategw_acl.py
test_04_rvpc_privategw_static_routes Failure 272.80 test_privategw_acl.py
test_04_restart_network_wo_cleanup Failure 2.79 test_routers.py
test_01_vpc_site2site_vpn Failure 220.59 test_vpc_vpn.py

@mike-tutkowski
Copy link
Member Author

Just a quick comment on the five test failures: It seems unlikely that this PR caused them. Those are all networking related and this PR is mainly concerned with managed storage.

@DaanHoogland DaanHoogland merged commit e68f5ce into apache:4.11 Mar 29, 2018
@blueorangutan
Copy link

@mike-tutkowski a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@mike-tutkowski
Copy link
Member Author

@DaanHoogland Quick question: Is it part of our process to forward merge these PRs to master or do I need to open a new PR for that? Thanks!

@rafaelweingartner
Copy link
Member

I was going to mention that just now. No new PR should be required. We should merge forward.
There is also another PR that @DaanHoogland merged yesterday that has not been merged forward.

@DaanHoogland
Copy link
Contributor

I think we are at more than ten now :s , gents

@DaanHoogland
Copy link
Contributor

but I think it doesn't hurt to gather a few before we merge forward.

@rafaelweingartner
Copy link
Member

rafaelweingartner commented Mar 29, 2018

Really?! I normally follow PRs merge, but I only noticed the one yesterday and this one.
Well, I guest that as long as we merge them forward, it is ok to do the merges in batch.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1854

rafaelweingartner added a commit that referenced this pull request Mar 29, 2018
@mike-tutkowski mike-tutkowski deleted the check-maint-mode branch April 12, 2018 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants