Have NodeRange make more assurances that it will not be caching data upon explicit request

xcatd explicitly has noderange redo cache if client has a <noderange> element.  This distinguishes it from 'getpostscript' type commands.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12735 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-05-16 15:11:39 +00:00
parent 1b14168c84
commit 22b551750e
2 changed files with 9 additions and 4 deletions

View File

@ -32,13 +32,13 @@ my $grptab;
#my $nodeprefix = "node";
my @allnodeset;
my $allnodesetstamp=0;
my %allnodehash;
my @grplist;
my $didgrouplist;
my $glstamp=0;
my $allnodesetstamp=0;
my $allgrphashstamp=0;
my %allgrphash;
my $allgrphashstamp;
my $retaincache=0;
my $recurselevel=0;
@ -448,7 +448,10 @@ sub retain_cache { #A semi private operation to be used *ONLY* in the interestin
$retaincache=shift;
unless ($retaincache) { #take a call to retain_cache(0) to also mean that any existing
#cache must be zapped
if ($nodelist) { $nodelist->_clear_cache(); }
if ($nodelist) { $nodelist->_refresh_cache(); }
$glstamp=0;
$allnodesetstamp=0;
$allgrphashstamp=0;
undef $nodelist;
@allnodeset=();
%allnodehash=();

View File

@ -985,6 +985,7 @@ sub plugin_command {
if ($req->{node}) {
@nodes = @{$req->{node}};
} elsif ($req->{noderange} and $req->{noderange}->[0]) {
xCAT::NodeRange::retain_cache(0); #if the request has a 'noderange' element, take the performance hit for the sake of freshness
@nodes = noderange($req->{noderange}->[0]);
if (nodesmissed) {
my $rsp = {errorcode=>1,error=>"Invalid nodes and/or groups in noderange: ".join(',',nodesmissed)};
@ -1715,7 +1716,7 @@ sub service_connection {
if (not defined $bytesread and $! == EAGAIN) { next; } #
last;
}
my $flags=fcntl($sock,F_GETFL,0);
$flags=fcntl($sock,F_GETFL,0);
$flags &= ~O_NONBLOCK; #now we want *print* to be blocking IO
fcntl($sock,F_SETFL,$flags);
$request .= $line;
@ -1764,6 +1765,7 @@ sub service_connection {
} elsif ($cmd_handlers{$req->{command}->[0]}) {
return plugin_command($req,$sock,\&convey_response);
} elsif ($req->{command}->[0] eq "noderange" and $req->{noderange}) {
xCAT::NodeRange::retain_cache(0); #if the request has a 'noderange' element, take the performance hit for the sake of freshness
my @nodes = noderange($req->{noderange}->[0]);
my %resp;
if (nodesmissed) {