| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
A still-running agent whose host was deleted keeps its locally-persisted GUID and reconnects indefinitely. The management server looks up hosts by GUID excluding removed rows, so it fails to recognize the returning agent and re-registers it as a brand-new host. The existing 'add.host.on.service.restart.kvm' setting only guards this agent-side, for KVM/LXC, and only when the agent is still connected at delete time. Enforce that setting's intent on the management server: when 'add.host.on.service.restart.kvm' is false, refuse an agent whose GUID matches a previously deleted host. This also covers the case where the agent was offline when the host was deleted, and applies to all hypervisor types. - Preserve the host GUID on the soft-deleted record so the returning agent can be recognized (deleteHost no longer nulls the GUID). - Add HostDao.findByGuidIncludingRemoved / findByGuidPrefixIncludingRemoved. - getNewHost now rejects re-registration via rejectReAddOfDeletedHost.
Codecov Report❌ Patch coverage is 59.45946% with 15 lines in your changes missing coverage. Please review. @@ Coverage Diff @@
## main #13719 +/- ##
============================================
- Coverage 19.74% 19.73% -0.01%
- Complexity 19960 19969 +9
============================================
Files 6371 6371
Lines 575784 575820 +36
Branches 70478 70482 +4
============================================
- Hits 113665 113664 -1
- Misses 449765 449806 +41
+ Partials 12354 12350 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Sorry, something went wrong.
…ed-hosts # Conflicts: # server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
Cover the management-server guard that refuses an agent whose GUID belongs to a previously deleted host: - honours 'add.host.on.service.restart.kvm': when true the guard returns early and issues no database lookup at all - rejects a match on the full GUID and, separately, on the GUID prefix - the rejection message names both the GUID and the setting to flip - a full-GUID hit short-circuits the prefix lookup - a live host (removed = null) returned by the *IncludingRemoved lookups is never rejected, so an ordinary agent reconnect keeps working - blank/null GUID and prefix are not looked up, so a blank prefix cannot turn into a wildcard query matching an unrelated host The tests mutate the static ADD_HOST_ON_SERVICE_RESTART_KVM ConfigKey, so tearDown() restores its declared default to keep the change from leaking into other tests sharing the JVM fork.
Addresses review feedback: the explanation lives in the javadoc on rejectReAddOfDeletedHost(), the inline comments only cluttered the code.
|
@DaanHoogland comments removed in 43a3adc, thanks! |
Sorry, something went wrong.
There was a problem hiding this comment.
clgtm
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
A still-running agent whose host was deleted keeps its locally-persisted GUID and reconnects indefinitely. The management server looks up hosts by GUID excluding removed rows, so it fails to recognize the returning agent and re-registers it as a brand-new host. The existing 'add.host.on.service.restart.kvm' setting only guards this agent-side, for KVM/LXC, and only when the agent is still connected at delete time.
Enforce that setting's intent on the management server: when 'add.host.on.service.restart.kvm' is false, refuse an agent whose GUID matches a previously deleted host. This also covers the case where the agent was offline when the host was deleted, and applies to all hypervisor types.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity