all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Fiona Ebner" <f.ebner@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH ha-manager 2/2] make idle LRMs resolve leftover moving HA resources while disarmed
Date: Wed, 20 May 2026 08:53:40 +0200	[thread overview]
Message-ID: <DINB1D9OP7XH.HMLQ6152CNIU@proxmox.com> (raw)
In-Reply-To: <5978c036-c864-413c-a4a7-6febe1b7f2b3@proxmox.com>

On Tue May 19, 2026 at 6:00 PM CEST, Fiona Ebner wrote:
> Am 19.05.26 um 4:39 PM schrieb Daniel Kral:
>> If there are HA resources, which are in transient states that defer the
>> disarming process, but their LRMs are already in idle state and disarmed
>> mode, these LRMs will not properly resolve the transient states of these
>> HA resources as assumed by the HA Manager.
>> 
>> For HA resources, which are still moving, this makes the HA Manager
>> stuck in a loop, which tries to defer the disarming process to wait for
>> a LRM response for these moving HA resources, which will never come as
>> the LRM is idle.
>> 
>> Therefore allow the LRM to become active in disarm mode if there are any
>> HA resources on the LRM's node, which are in any of these transient
>> states, and make sure that the LRM only processes the disarm-deferring
>> HA resources while the LRM is active.
>> 
>> Signed-off-by: Daniel Kral <d.kral@proxmox.com>
>> ---
>>  src/PVE/HA/LRM.pm                         | 19 ++++++++++-
>>  src/PVE/HA/Manager.pm                     |  8 ++---
>>  src/PVE/HA/Tools.pm                       | 17 ++++++++++
>>  src/test/test-disarm-idle-lrm1/log.expect | 37 ++++++---------------
>>  src/test/test-disarm-idle-lrm2/log.expect | 39 +++++++----------------
>>  5 files changed, 58 insertions(+), 62 deletions(-)
>> 
>> diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm
>> index 426982cc..9100d611 100644
>> --- a/src/PVE/HA/LRM.pm
>> +++ b/src/PVE/HA/LRM.pm
>> @@ -312,6 +312,18 @@ sub active_service_count {
>>      return PVE::HA::Tools::count_active_services($ss, $nodename);
>>  }
>>  
>> +# returns a truthy value if there are HA resources in transient states, which
>> +# need to be resolved, e.g. to complete the disarm procedure.
>> +sub has_disarm_deferred_services {
>
> Nit: I feel like the variables and functions should rather be named
> disarm_deferring rather than disarm_deferred

Thanks for the review, agree with all the renames!

[snip]

>> diff --git a/src/PVE/HA/Tools.pm b/src/PVE/HA/Tools.pm
>> index 26629fb5..37b27e11 100644
>> --- a/src/PVE/HA/Tools.pm
>> +++ b/src/PVE/HA/Tools.pm
>> @@ -213,6 +213,23 @@ sub count_active_services {
>>      return $active_count;
>>  }
>>  
>> +sub get_disarm_deferred_services {
>> +    my ($ss, $node) = @_;
>> +
>> +    my $deferred_sids = {};
>> +    my @deferrable_states = qw(fence recovery migrate relocate);
>
> Nit: disarm_deferring_states
>
>> +
>> +    for my $sid (keys %$ss) {
>> +        my ($state, $current_node, $target_node) = $ss->{$sid}->@{qw(state node target)};
>> +
>> +        next if $node && (!$current_node || $current_node ne $node);
>
> Just wondering: when does !$current_node happen?

AFAIK the only case where this can currently happen is if the HA
resource's guest doesn't exist in the cluster anymore according to the
pmxcfs' vmlist and isn't removed by HA Manager anymore (as is done when
the HA stack is in disarm mode).

>
>> +
>> +        $deferred_sids->{$sid} = 1 if grep { $state eq $_ } @deferrable_states;
>> +    }
>> +
>> +    return $deferred_sids;
>> +}
>> +
>>  sub get_verbose_service_state {
>>      my ($service_state, $service_conf) = @_;
>>  





  reply	other threads:[~2026-05-20  6:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 14:38 [PATCH-SERIES ha-manager 0/2] make idle LRMs resolve leftover moving HA resources while disarmed Daniel Kral
2026-05-19 14:38 ` [PATCH ha-manager 1/2] test: add disarm test cases for idle lrms with transient ha resources Daniel Kral
2026-05-19 14:38 ` [PATCH ha-manager 2/2] make idle LRMs resolve leftover moving HA resources while disarmed Daniel Kral
2026-05-19 16:00   ` Fiona Ebner
2026-05-20  6:53     ` Daniel Kral [this message]
2026-05-20  7:48       ` Daniel Kral
2026-05-19 14:47 ` [PATCH-SERIES ha-manager 0/2] " Daniel Kral
2026-05-19 16:00   ` Fiona Ebner
2026-05-19 20:11 ` applied: " Thomas Lamprecht
2026-05-20  8:07   ` Daniel Kral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DINB1D9OP7XH.HMLQ6152CNIU@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal