Enhance DB recovery to survive a failed recovery attempt
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11018 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
670d5cb754
commit
4fdc6b5850
@ -274,6 +274,14 @@ sub handle_dbc_request {
|
||||
}
|
||||
my $oldhandle = $::XCAT_DBHS->{$dbindex}; #store old handle off
|
||||
$::XCAT_DBHS->{$dbindex} = $::XCAT_DBHS->{$dbindex}->clone(); #replace broken db handle with nice, new, working one
|
||||
unless ($::XCAT_DBHS->{$dbindex}) { #this means the clone failed
|
||||
#most likely result is the DB is down
|
||||
#restore the old broken handle
|
||||
#so that future recovery attempts have a shot
|
||||
#a broken db handle we can recover, no db handle we cannot
|
||||
$::XCAT_DBHS->{$dbindex} = $oldhandle;
|
||||
return undef;
|
||||
}
|
||||
$dbobjsforhandle->{$::XCAT_DBHS->{$dbindex}} = $dbobjsforhandle->{$oldhandle}; #Move the map of depenednt objects to the new handle
|
||||
foreach (@afflictedobjs) { #migrate afflicted objects to the new DB handle
|
||||
$$_->{dbh} = $::XCAT_DBHS->{$dbindex};
|
||||
|
Loading…
Reference in New Issue
Block a user