diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 453133662..984329810 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -60,6 +60,11 @@ sub nodesmissed { return @$missingnodes; } +sub reset_db { +#workaround, something seems to be trying to use a corrupted reference to grptab +#this allows init_dbworker to reset the object + $grptab=0; +} sub nodesbycriteria { #TODO: this should be in a common place, shared by tabutils nodech/nodels and noderange #there is a set of functions already, but the path is a little complicated and @@ -182,11 +187,6 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels # Try to match groups? unless ($grptab) { $grptab = xCAT::Table->new('nodegroup'); - } else { # if DB2 we need to get a new table handle always - my $DBname = xCAT::Utils->get_DBName; - if (($DBname =~ /^DB2/) && (xCAT::Utils->isServiceNode())){ - $grptab = xCAT::Table->new('nodegroup'); - } } if ($grptab and not $didgrouplist and not scalar @grplist) { $didgrouplist = 1; diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index ecc0b7bfd..63ced6a9c 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -151,6 +151,7 @@ sub init_dbworker { $dbworkerpid = fork; + xCAT::NodeRange::reset_db(); #do in both processes, to be sure unless (defined $dbworkerpid) { die "Error spawining database worker";