Merge pull request #565 from ClusterLabs/node-ready-issue

Node ready issue
main
Digimer 11 months ago committed by GitHub
commit b1a9de9318
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 36
      Anvil/Tools/Cluster.pm
  2. 2
      scancore-agents/scan-filesystems/scan-filesystems
  3. 1
      scancore-agents/scan-server/scan-server

@ -3585,26 +3585,46 @@ sub parse_cib
# The "coming up" order is 'in_ccm' then 'crmd' then 'join'. # The "coming up" order is 'in_ccm' then 'crmd' then 'join'.
my $node_id = $anvil->data->{cib}{parsed}{data}{node}{$node_name}{id}; my $node_id = $anvil->data->{cib}{parsed}{data}{node}{$node_name}{id};
my $maintenance_mode = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'maintenance-mode'} eq "on" ? 1 : 0; # 'on' or 'off' - Node is not monitoring resources my $maintenance_mode = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'maintenance-mode'} eq "on" ? 1 : 0; # 'on' or 'off' - Node is not monitoring resources
my $in_ccm = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} eq "true" ? 1 : 0; # 'true' or 'false' - Corosync member
my $crmd = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} eq "online" ? 1 : 0; # 'online' or 'offline' - In corosync process group
my $join = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} eq "member" ? 1 : 0; # 'member' or 'down' - Completed controller join process
my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0; # Our summary of if the node is "up"
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:node_name' => $node_name, 's1:node_name' => $node_name,
's2:node_id' => $node_id, 's2:node_id' => $node_id,
's3:maintenance_mode' => $maintenance_mode, 's3:maintenance_mode' => $maintenance_mode,
's4:in_ccm' => $in_ccm,
's5:crmd' => $crmd,
's6:join' => $join,
's7:ready' => $ready,
}}); }});
### These have changed. In older clusters, these are 'true/false' or 'online/offline', but now show as a timestamp.
# in_ccm - Corosync member
my $in_ccm = 0;
if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} eq "true") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} =~ /^\d+$/))
{
$in_ccm = 1;
}
# crmd - In corosync process group
my $crmd = 0;
if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} eq "online") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} =~ /^\d+$/))
{
$crmd = 1;
}
# join - Completed controller join process
my $join = 0;
if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} eq "member") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} =~ /^\d+$/))
{
$join = 1;
}
# If the global maintenance mode is set, set maintenance mode to true. # If the global maintenance mode is set, set maintenance mode to true.
if (($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'}) && ($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'} eq "true")) if (($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'}) && ($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'} eq "true"))
{ {
$maintenance_mode = 1; $maintenance_mode = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { maintenance_mode => $maintenance_mode }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { maintenance_mode => $maintenance_mode }});
} }
# Our summary of if the node is "up"
my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:in_ccm' => $in_ccm,
's2:crmd' => $crmd,
's3:join' => $join,
's4:ready' => $ready,
}});
$anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{pacemaker_id} = $node_id; $anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{pacemaker_id} = $node_id;
$anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{'maintenance-mode'} = $maintenance_mode; $anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{'maintenance-mode'} = $maintenance_mode;

@ -487,7 +487,7 @@ INSERT INTO
{ {
# First time we've fallen under 5% # First time we've fallen under 5%
my $alert_level = "warning"; my $alert_level = "warning";
if ($new_mount_point eq "<swap>") if ($new_mount_point =~ /swap/)
{ {
$alert_level = "notice"; $alert_level = "notice";
} }

@ -184,6 +184,7 @@ sub connect_to_virsh
clear => 1, clear => 1,
message => $key, message => $key,
set_by => $THIS_FILE, set_by => $THIS_FILE,
variables => $variables,
}); });
} }
} }

Loading…
Cancel
Save