Skip to content

Commit b1a9de9

Browse files
authored
Merge pull request #565 from ClusterLabs/node-ready-issue
Node ready issue
2 parents 56a9916 + c5e7279 commit b1a9de9

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

Anvil/Tools/Cluster.pm

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3585,26 +3585,46 @@ sub parse_cib
35853585
# The "coming up" order is 'in_ccm' then 'crmd' then 'join'.
35863586
my $node_id = $anvil->data->{cib}{parsed}{data}{node}{$node_name}{id};
35873587
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
3588-
my $in_ccm = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} eq "true" ? 1 : 0; # 'true' or 'false' - Corosync member
3589-
my $crmd = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} eq "online" ? 1 : 0; # 'online' or 'offline' - In corosync process group
3590-
my $join = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} eq "member" ? 1 : 0; # 'member' or 'down' - Completed controller join process
3591-
my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0; # Our summary of if the node is "up"
35923588
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
35933589
's1:node_name' => $node_name,
35943590
's2:node_id' => $node_id,
35953591
's3:maintenance_mode' => $maintenance_mode,
3596-
's4:in_ccm' => $in_ccm,
3597-
's5:crmd' => $crmd,
3598-
's6:join' => $join,
3599-
's7:ready' => $ready,
36003592
}});
36013593

3594+
### These have changed. In older clusters, these are 'true/false' or 'online/offline', but now show as a timestamp.
3595+
# in_ccm - Corosync member
3596+
my $in_ccm = 0;
3597+
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+$/))
3598+
{
3599+
$in_ccm = 1;
3600+
}
3601+
# crmd - In corosync process group
3602+
my $crmd = 0;
3603+
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+$/))
3604+
{
3605+
$crmd = 1;
3606+
}
3607+
# join - Completed controller join process
3608+
my $join = 0;
3609+
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+$/))
3610+
{
3611+
$join = 1;
3612+
}
3613+
36023614
# If the global maintenance mode is set, set maintenance mode to true.
36033615
if (($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'}) && ($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'} eq "true"))
36043616
{
36053617
$maintenance_mode = 1;
36063618
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { maintenance_mode => $maintenance_mode }});
36073619
}
3620+
# Our summary of if the node is "up"
3621+
my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0;
3622+
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
3623+
's1:in_ccm' => $in_ccm,
3624+
's2:crmd' => $crmd,
3625+
's3:join' => $join,
3626+
's4:ready' => $ready,
3627+
}});
36083628

36093629
$anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{pacemaker_id} = $node_id;
36103630
$anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{'maintenance-mode'} = $maintenance_mode;

scancore-agents/scan-filesystems/scan-filesystems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ INSERT INTO
487487
{
488488
# First time we've fallen under 5%
489489
my $alert_level = "warning";
490-
if ($new_mount_point eq "<swap>")
490+
if ($new_mount_point =~ /swap/)
491491
{
492492
$alert_level = "notice";
493493
}

scancore-agents/scan-server/scan-server

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ sub connect_to_virsh
184184
clear => 1,
185185
message => $key,
186186
set_by => $THIS_FILE,
187+
variables => $variables,
187188
});
188189
}
189190
}

0 commit comments

Comments
 (0)