diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 94fee2c21..db68819e5 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -299,7 +299,11 @@ sub handle_dbc_request { $opentables{$tablename}->{$autocommit} = xCAT::Table->new(@args); } if ($opentables{$tablename}->{$autocommit}) { - return 1; + if ($opentables{$tablename}->{$autocommit^1}) { + $opentables{$tablename}->{$autocommit}->{cachepeer}=$opentables{$tablename}->{$autocommit^1}; + $opentables{$tablename}->{$autocommit^1}->{cachepeer}=$opentables{$tablename}->{$autocommit}; + } + return 1; } else { return 0; } @@ -312,6 +316,10 @@ sub handle_dbc_request { unless ($opentables{$tablename}->{$autocommit}) { return undef; } + if ($opentables{$tablename}->{$autocommit^1}) { + $opentables{$tablename}->{$autocommit}->{cachepeer}=$opentables{$tablename}->{$autocommit^1}; + $opentables{$tablename}->{$autocommit^1}->{cachepeer}=$opentables{$tablename}->{$autocommit}; + } } } if ($functionname eq 'getAllAttribs') { @@ -2096,6 +2104,7 @@ sub getNodesAttribs { sub _refresh_cache { #if cache exists, force a rebuild, leaving reference counts alone my $self = shift; #dbworker check not currently required + if ($self->{cachepeer}->{_cachestamp}) { $self->{cachepeer}->{_cachestamp}=0; } if ($self->{_use_cache}) { #only do things if cache is set up $self->_build_cache(1); #for now, rebuild the whole thing. #in the future, a faster cache update may be possible