From e24cc45b7073403fa3edb6686e5888b3afc3e45b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sun, 25 Mar 2012 15:15:58 +0000 Subject: [PATCH] Fix problem where Table.pm fails to skip cache for low nodecounts git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11984 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index cbde2d920..14f81f1ee 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -57,6 +57,7 @@ if ($^O =~ /^aix/i) { use lib "$::XCATROOT/lib/perl"; my $cachethreshold=16; #How many nodes in 'getNodesAttribs' before switching to full DB retrieval +#TODO: dynamic tracking/adjustment, the point where cache is cost effective differs based on overall db size use DBI; $DBI::dbi_debug=9; # increase the debug output @@ -2051,7 +2052,8 @@ sub getNodesAttribs { } else { @attribs = @_; } - if (scalar($nodelist) > $cachethreshold) { + #it should also be the case that cache will be used if it already is in play even if below cache threshold. This would be desired behavior + if (scalar(@$nodelist) > $cachethreshold) { $self->{_use_cache} = 0; $self->{nodelist}->{_use_cache}=0; if ($self->{tabname} eq 'nodelist') { #a sticky situation