Commit 70eed01
committed
fix(linstor): surface ambiguous template fallbacks and legacy template orphans
Two small visibility improvements that make existing template
behaviour easier to audit, especially after upgrading from versions
that predated the ref-count convention.
LinstorUtil.findResourceDefinition
When no resource has the exact "_cs-template-for-<rscGrpName>" Aux
property, the method silently returned the first resource whose name
starts with the requested prefix. With multiple resource groups on a
single controller, this can route a clone to the wrong template. Now
logs a WARN naming the requested rscGrpName, the fallback resource,
and the actual aux properties present. Behaviour unchanged: still
returns the first match. Operators can act on the warning by setting
the property explicitly or removing the unrelated definition.
LinstorStorageAdaptor.deRefOrDeleteResource
When deleting a resource that has zero `_cs-template-for-` aux
properties AND whose name starts with the template-name prefix the
caller is acting on, log an INFO line. These are legacy templates
cached before the ref-count convention was introduced — they get
picked up by the existing "if expectedProps == 0" branch and
deleted. Surfacing them lets operators see how many orphans existed
at upgrade time and confirm the cleanup happened.1 parent 6f4445c commit 70eed01
2 files changed
Lines changed: 33 additions & 3 deletions
File tree
- plugins/storage/volume/linstor/src/main/java
- com/cloud/hypervisor/kvm/storage
- org/apache/cloudstack/storage/datastore/util
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
514 | 525 | | |
515 | 526 | | |
516 | 527 | | |
| |||
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
495 | 514 | | |
496 | 515 | | |
497 | 516 | | |
| |||
0 commit comments