2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 10:18:20 +00:00

Remove the PDU max outlet check

Walking all pdus prior to every PDU command is
too expensive.  Can revisit and improve if the error
is really worth it.
This commit is contained in:
Jarrod Johnson
2017-06-27 15:43:06 -04:00
parent 8a2a7ccdc1
commit 1a50b6bed6

View File

@@ -131,9 +131,10 @@ sub process_request
}
#fill in the total outlet count for each pdu
$pdutab = xCAT::Table->new('pdu');
@pduents = $pdutab->getAllNodeAttribs(['node', 'outlet']);
fill_outletCount(\@pduents, $callback);
#This is *way* too expensive in a large cluster to try to walk every PDU every time
#$pdutab = xCAT::Table->new('pdu');
#@pduents = $pdutab->getAllNodeAttribs(['node', 'outlet']);
#fill_outletCount(\@pduents, $callback);
if( $command eq "rinv") {
#for higher performance, handle node in batch
@@ -290,10 +291,12 @@ sub powerpduoutlet {
$callback->({ errorcode => [1],error => "Couldn't connect to $pdu"});
next;
}
if ($outlet > $pdunodes->{$pdu}->{outlet} ) {
$callback->({ errorcode => [1],error => "outlet number $outlet is invalid for $pdu"});
next;
}
# the check is too expensive. To re-enable, would have to
# check if known, fetch on demand. For now, let the previous behavior stand
#if ($outlet > $pdunodes->{$pdu}->{outlet} ) {
# $callback->({ errorcode => [1],error => "outlet number $outlet is invalid for $pdu"});
# next;
#}
my $cmd;
if ($subcmd eq "pdustat") {
$statstr=outletstat($session, $outlet);