cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

[WIP] framework/db: introduce a new MySQL table based distributed lock

Open rohityadavcloud opened this issue 1 year ago • 44 comments

This introduces a MySQL innodb table based distributed lock which can be used by one or more management server and its threads. This removes usage of MySQL server provided locking functions (GET_LOCK, RELEASE_LOCK) which are not replicated or not supported currently by any MySQL clustering solutions. This would be the first main step in having CloudStack to work with a MySQL clustering solution such as InnoDB cluster, Percona Xtradb cluster, MariaDB galera cluster. There may be other changes required which can be found in due course if this feature works at scale.

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)
  • [x] Enhancement (improves an existing feature and functionality)
  • [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
  • [ ] build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [x] Major
  • [ ] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [x] Major
  • [ ] Minor
  • [ ] Trivial

How Has This Been Tested?

In a local setup against simulator & mvn, in a single management server no exception were seen. Most tests need to be done such as:

  • simulator based smoketests which is one mvn-run of mgmt server + one mysql db server
  • smoketests (test matrix) which tests largely one mgmt server + one mysql db server
  • multiple (say 3) mgmt servers + one mysql db server
  • multiple (say 3) mgmt servers + mysql db cluster with say 3 nodes

rohityadavcloud avatar Apr 24 '24 12:04 rohityadavcloud

This is largely WIP and experimental, at this point I'm only looking for automated tests which are easier done via a PR, I'm not looking for any feedback and review - thanks.

@blueorangutan package

rohityadavcloud avatar Apr 24 '24 12:04 rohityadavcloud

@blueorangutan package

rohityadavcloud avatar Apr 24 '24 17:04 rohityadavcloud

@rohityadavcloud a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Apr 24 '24 17:04 blueorangutan

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9411

blueorangutan avatar Apr 24 '24 18:04 blueorangutan

@blueorangutan test matrix

rohityadavcloud avatar Apr 24 '24 18:04 rohityadavcloud

@rohityadavcloud a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

blueorangutan avatar Apr 24 '24 18:04 blueorangutan

[SF] Trillian Build Failed (tid-9995)

blueorangutan avatar Apr 24 '24 19:04 blueorangutan

[SF] Trillian Build Failed (tid-9991)

blueorangutan avatar Apr 24 '24 19:04 blueorangutan

[SF] Trillian Build Failed (tid-9993)

blueorangutan avatar Apr 24 '24 19:04 blueorangutan

@blueorangutan package

rohityadavcloud avatar Apr 24 '24 20:04 rohityadavcloud

@rohityadavcloud a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Apr 24 '24 20:04 blueorangutan

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9412

blueorangutan avatar Apr 24 '24 21:04 blueorangutan

@blueorangutan test matrix

rohityadavcloud avatar Apr 25 '24 03:04 rohityadavcloud

@rohityadavcloud a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

blueorangutan avatar Apr 25 '24 03:04 blueorangutan

[SF] Trillian Build Failed (tid-10003)

blueorangutan avatar Apr 25 '24 04:04 blueorangutan

[SF] Trillian Build Failed (tid-10001)

blueorangutan avatar Apr 25 '24 04:04 blueorangutan

Codecov Report

Attention: Patch coverage is 40.84507% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 14.96%. Comparing base (e409c6d) to head (9830bbe).

Files Patch % Lines
...java/com/cloud/upgrade/DatabaseUpgradeChecker.java 0.00% 22 Missing :warning:
...rk/db/src/main/java/com/cloud/utils/db/DbUtil.java 62.96% 7 Missing and 3 partials :warning:
.../src/main/java/com/cloud/utils/net/MacAddress.java 54.54% 6 Missing and 4 partials :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #8968      +/-   ##
============================================
- Coverage     14.96%   14.96%   -0.01%     
+ Complexity    10995    10989       -6     
============================================
  Files          5373     5373              
  Lines        468989   468920      -69     
  Branches      61009    57594    -3415     
============================================
- Hits          70191    70164      -27     
+ Misses       391019   390993      -26     
+ Partials       7779     7763      -16     
Flag Coverage Δ
uitests 4.31% <ø> (ø)
unittests 15.66% <40.84%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 25 '24 04:04 codecov-commenter

@blueorangutan test matrix

rohityadavcloud avatar Apr 25 '24 05:04 rohityadavcloud

@rohityadavcloud a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

blueorangutan avatar Apr 25 '24 05:04 blueorangutan

[SF] Trillian Build Failed (tid-10004)

blueorangutan avatar Apr 25 '24 05:04 blueorangutan

[SF] Trillian Build Failed (tid-10006)

blueorangutan avatar Apr 25 '24 05:04 blueorangutan

@blueorangutan test ol8 kvm-ol8

rohityadavcloud avatar Apr 25 '24 11:04 rohityadavcloud

@rohityadavcloud [SL] unsupported parameters provided. Supported mgmt server os are: centos7, centos6, suse15, alma8, ubuntu18, ubuntu22, ubuntu20, rocky8, alma9. Supported hypervisors are: kvm-centos6, kvm-centos7, kvm-rocky8, kvm-alma8, kvm-alma9, kvm-ubuntu18, kvm-ubuntu20, kvm-ubuntu22, kvm-suse15, vmware-55u3, vmware-60u2, vmware-65u2, vmware-67u3, vmware-70u1, vmware-70u2, vmware-70u3, vmware-80, vmware-80u1, xenserver-65sp1, xenserver-71, xenserver-74, xcpng74, xcpng76, xcpng80, xcpng81, xcpng82

blueorangutan avatar Apr 25 '24 11:04 blueorangutan

@blueorangutan test alma8 vmware-70u3

rohityadavcloud avatar Apr 25 '24 11:04 rohityadavcloud

@rohityadavcloud a [SL] Trillian-Jenkins test job (alma8 mgmt + vmware-70u3) has been kicked to run smoke tests

blueorangutan avatar Apr 25 '24 11:04 blueorangutan

@blueorangutan test alma8 kvm-alma8

rohityadavcloud avatar Apr 25 '24 12:04 rohityadavcloud

@rohityadavcloud a [SL] Trillian-Jenkins test job (alma8 mgmt + kvm-alma8) has been kicked to run smoke tests

blueorangutan avatar Apr 25 '24 12:04 blueorangutan

[SF] Trillian Build Failed (tid-10028)

blueorangutan avatar Apr 25 '24 13:04 blueorangutan

[SF] Trillian test result (tid-10005) Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8 Total time taken: 55775 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8968-t10005-vmware-67u3.zip Smoke tests completed. 129 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 346.17 test_events_resource.py

blueorangutan avatar Apr 25 '24 21:04 blueorangutan

[SF] Trillian test result (tid-10025) Environment: vmware-70u3 (x2), Advanced Networking with Mgmt server a8 Total time taken: 61906 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8968-t10025-vmware-70u3.zip Smoke tests completed. 127 look OK, 3 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 345.93 test_events_resource.py
test_01_list_sec_storage_vm Failure 0.21 test_ssvm.py
test_03_ssvm_internals Failure 3.34 test_ssvm.py
test_05_stop_ssvm Failure 934.96 test_ssvm.py
test_06_stop_cpvm Error 988.39 test_ssvm.py
test_08_reboot_cpvm Error 914.21 test_ssvm.py
test_01_redundant_vpc_site2site_vpn Failure 522.63 test_vpc_vpn.py

blueorangutan avatar Apr 26 '24 06:04 blueorangutan