2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 01:26:38 +00:00

clear cache for IP change case in node discovery(#4890) (#4891)

This commit is contained in:
Bin Xu 2018-03-06 16:13:02 +08:00 committed by yangsong
parent fec0b8a75d
commit 804b132605
2 changed files with 23 additions and 0 deletions

View File

@ -388,6 +388,26 @@ sub getipaddr
#-------------------------------------------------------------------------------
=head3 clearcache
Workaround: Clear the IP address cache in case that the long running process
(discovery/install monitor) could work as normal when the node's IP address
is changed.
Globals:
cache: %::hostiphash
Error:
none
Example:
xCAT::NetworkUtils->clearcache();
=cut
#-------------------------------------------------------------------------------
sub clearcache
{
undef %::hostiphash;
}
#-------------------------------------------------------------------------------
=head3 linklocaladdr
Only for IPv6.
Takes a mac address, calculate the IPv6 link local address

View File

@ -8,6 +8,7 @@ BEGIN
}
use lib "$::XCATROOT/lib/perl";
use xCAT::DiscoveryUtils;
use xCAT::NetworkUtils;
sub handled_commands {
return {
@ -51,6 +52,8 @@ sub process_request {
xCAT::MsgUtils->message("S", "xcat.discovery.aaadiscovery: ($mac) Got a discovery request, attempting to discover the node...");
$req->{discoverymethod}->[0] = 'undef';
$req->{_xcat_clientmac}->[0] = $mac;
#Workaround (#4890) for IP changed cases.
xCAT::NetworkUtils->clearcache();
xCAT::DiscoveryUtils->update_discovery_data($req);
return;
}