@ -551,7 +551,11 @@ This calls C<< drbdadm >> to collect the configuration of the local system and p
On error , C << 1 >> is returned . On success , C << 0 >> is returned .
On error , C << 1 >> is returned . On success , C << 0 >> is returned .
This method takes no parameters .
Parameters ;
= head3 xml ( optional )
If set to the XML generated by C << drbdadm dump - xml >> elsewhere , this will be parsed instead of making the call .
= cut
= cut
sub gather_data
sub gather_data
@ -562,220 +566,230 @@ sub gather_data
my $ debug = defined $ parameter - > { debug } ? $ parameter - > { debug } : 3 ;
my $ debug = defined $ parameter - > { debug } ? $ parameter - > { debug } : 3 ;
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , key = > "log_0125" , variables = > { method = > "DRBD->gather_data()" } } ) ;
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , key = > "log_0125" , variables = > { method = > "DRBD->gather_data()" } } ) ;
### NOTE: Left off here - take an XML and parse that instead of collecting it, if passed.
my $ xml = defined $ parameter - > { xml } ? $ parameter - > { xml } : "" ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
xml = > $ xml ,
} } ) ;
# Is DRBD even installed?
# Is DRBD even installed?
if ( not - e $ anvil - > data - > { path } { exe } { drbdadm } )
if ( not $ xml )
{
{
# This is an error, but it happens a lot because we're called by scan_drbd from Striker
if ( not - e $ anvil - > data - > { path } { exe } { drbdadm } )
# dashboards often. As such, this log level is '2'.
{
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > 2 , key = > "error_0251" } ) ;
# This is an error, but it happens a lot because we're called by scan_drbd from Striker
return ( 1 ) ;
# dashboards often. As such, this log level is '2'.
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > 2 , key = > "error_0251" } ) ;
return ( 1 ) ;
}
( $ xml , my $ return_code ) = $ anvil - > System - > call ( { shell_call = > $ anvil - > data - > { path } { exe } { drbdadm } . " dump-xml" } ) ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
xml = > $ xml ,
return_code = > $ return_code ,
} } ) ;
if ( $ return_code )
{
# Failed to dump the XML.
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > 1 , key = > "error_0252" , variables = > { return_code = > $ return_code } } ) ;
return ( 1 ) ;
}
}
}
my ( $ drbd_xml , $ return_code ) = $ anvil - > System - > call ( { shell_call = > $ anvil - > data - > { path } { exe } { drbdadm } . " dump-xml" } ) ;
local $@ ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { drbd_xml = > $ drbd_xml , return_code = > $ return_code } } ) ;
my $ dom = eval { XML::LibXML - > load_xml ( string = > $ xml ) ; } ;
if ( $ return_code )
if ( $@ )
{
{
# Failed to dump the XML.
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > 1 , key = > "error_0253" , variables = > {
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > 1 , key = > "error_0252" , variables = > { return_code = > $ return_code } } ) ;
xml = > $ xml ,
error = > $@ ,
} } ) ;
return ( 1 ) ;
return ( 1 ) ;
}
}
else
else
{
{
local $@ ;
# Successful parse!
my $ dom = eval { XML::LibXML - > load_xml ( string = > $ drbd_xml ) ; } ;
### TODO: Might be best to config these default values by calling/parsing
if ( $@ )
### 'drbdsetup show <resource> --show-defaults'.
{
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_common_xml } = $ xml ;
$ anvil - > Log - > entry ( { source = > $ THIS_FILE , line = > __LINE__ , level = > 1 , key = > "error_0253" , variables = > {
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_disk } = 1 ;
xml = > $ drbd_xml ,
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_md } = 1 ;
error = > $@ ,
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_timeout } = 6 ; # Default is '60', 6 seconds
} } ) ;
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_total_sync_speed } = 0 ;
return ( 1 ) ;
}
foreach my $ name ( $ dom - > findnodes ( '/config/common/section' ) )
else
{
{
# Successful parse!
my $ section = $ name - > { name } ;
### TODO: Might be best to config these default values by calling/parsing
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { section = > $ section } } ) ;
### 'drbdsetup show <resource> --show-defaults'.
foreach my $ option_name ( $ name - > findnodes ( './option' ) )
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_common_xml } = $ drbd_xml ;
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_disk } = 1 ;
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_md } = 1 ;
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_timeout } = 6 ; # Default is '60', 6 seconds
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_total_sync_speed } = 0 ;
foreach my $ name ( $ dom - > findnodes ( '/config/common/section' ) )
{
{
my $ section = $ name - > { name } ;
my $ variable = $ option_name - > { name } ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { section = > $ section } } ) ;
my $ value = $ option_name - > { value } ;
foreach my $ option_name ( $ name - > findnodes ( './option' ) )
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
{
's1:variable' = > $ variable ,
my $ variable = $ option_name - > { name } ;
's2:value' = > $ value ,
my $ value = $ option_name - > { value } ;
} } ) ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
's1:variable' = > $ variable ,
's2:value' = > $ value ,
} } ) ;
if ( $ section eq "net" )
if ( $ section eq "net" )
{
if ( $ variable eq "timeout" )
{
{
if ( $ variable eq "timeout" )
$ value /= 10 ;
{
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_timeout } = ( $ value / 10 ) ;
$ value /= 10 ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_timeout } = ( $ value / 10 ) ;
"new::scan_drbd::scan_drbd_timeout" = > $ anvil - > data - > { new } { scan_drbd } { scan_drbd_timeout } ,
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
} } ) ;
"new::scan_drbd::scan_drbd_timeout" = > $ anvil - > data - > { new } { scan_drbd } { scan_drbd_timeout } ,
} } ) ;
}
}
}
if ( $ section eq "disk" )
}
if ( $ section eq "disk" )
{
if ( $ variable eq "disk-flushes" )
{
{
if ( $ variable eq "disk-flushes" )
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_disk } = $ value eq "no" ? 0 : 1 ;
{
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_disk } = $ value eq "no" ? 0 : 1 ;
"new::scan_drbd::scan_drbd_flush_disk" = > $ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_disk } ,
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
} } ) ;
"new::scan_drbd::scan_drbd_flush_disk" = > $ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_disk } ,
}
} } ) ;
if ( $ variable eq "md-flushes" )
}
{
if ( $ variable eq "md-flushes" )
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_md } = $ value eq "no" ? 0 : 1 ;
{
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_md } = $ value eq "no" ? 0 : 1 ;
"new::scan_drbd::scan_drbd_flush_md" = > $ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_md } ,
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
} } ) ;
"new::scan_drbd::scan_drbd_flush_md" = > $ anvil - > data - > { new } { scan_drbd } { scan_drbd_flush_md } ,
} } ) ;
}
}
}
}
}
}
}
}
foreach my $ name ( $ dom - > findnodes ( '/config/resource' ) )
foreach my $ name ( $ dom - > findnodes ( '/config/resource' ) )
{
{
my $ resource = $ name - > { name } ;
my $ resource = $ name - > { name } ;
my $ conf_file = $ name - > { 'conf-file-line' } ;
my $ conf_file = $ name - > { 'conf-file-line' } ;
$ conf_file =~ s/:\d+$// ;
$ conf_file =~ s/:\d+$// ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
's1:resource' = > $ resource ,
's1:resource' = > $ resource ,
's2:conf_file' = > $ conf_file ,
's2:conf_file' = > $ conf_file ,
} } ) ;
} } ) ;
$ anvil - > data - > { new } { resource } { $ resource } { up } = 0 ;
$ anvil - > data - > { new } { resource } { $ resource } { up } = 0 ;
$ anvil - > data - > { new } { resource } { $ resource } { xml } = $ name - > toString ;
$ anvil - > data - > { new } { resource } { $ resource } { xml } = $ name - > toString ;
$ anvil - > data - > { new } { resource } { $ resource } { config_file } = $ conf_file ;
$ anvil - > data - > { new } { resource } { $ resource } { config_file } = $ conf_file ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
"new::resource::${resource}::xml" = > $ anvil - > data - > { new } { resource } { $ resource } { xml } ,
"new::resource::${resource}::xml" = > $ anvil - > data - > { new } { resource } { $ resource } { xml } ,
"new::resource::${resource}::config_file" = > $ anvil - > data - > { new } { resource } { $ resource } { config_file } ,
"new::resource::${resource}::config_file" = > $ anvil - > data - > { new } { resource } { $ resource } { config_file } ,
} } ) ;
} } ) ;
foreach my $ host ( $ name - > findnodes ( './host' ) )
{
my $ this_host_name = $ host - > { name } ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { this_host_name = > $ this_host_name } } ) ;
foreach my $ host ( $ name - > findnodes ( './host' ) )
# Record the details under the hosts
foreach my $ volume_vnr ( $ host - > findnodes ( './volume' ) )
{
{
my $ this_host_name = $ host - > { name } ;
my $ volume = $ volume_vnr - > { vnr } ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { this_host_name = > $ this_host_name } } ) ;
my $ meta_disk = $ volume_vnr - > findvalue ( './meta-disk' ) ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
's1:volume' = > $ volume ,
's2:meta_disk' = > $ meta_disk ,
} } ) ;
# Record the details under the hosts
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { device_path } = $ volume_vnr - > findvalue ( './device' ) ;
foreach my $ volume_vnr ( $ host - > findnodes ( './volume' ) )
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { backing_disk } = $ volume_vnr - > findvalue ( './disk' ) ;
{
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { device_minor } = $ volume_vnr - > findvalue ( './device/@minor' ) ;
my $ volume = $ volume_vnr - > { vnr } ;
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { size } = 0 ;
my $ meta_disk = $ volume_vnr - > findvalue ( './meta-disk' ) ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
"s1:new::resource::${resource}::host::${this_host_name}::volume::${volume}::device_path" = > $ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { device_path } ,
's1:volume' = > $ volume ,
"s2:new::resource::${resource}::host::${this_host_name}::volume::${volume}::backing_disk" = > $ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { backing_disk } ,
's2:meta_disk' = > $ meta_disk ,
"s3:new::resource::${resource}::host::${this_host_name}::volume::${volume}::device_minor" = > $ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { device_minor } ,
} } ) ;
} } ) ;
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { device_path } = $ volume_vnr - > findvalue ( './device' ) ;
# Record the local data only.
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { backing_disk } = $ volume_vnr - > findvalue ( './disk' ) ;
if ( ( $ this_host_name eq $ anvil - > Get - > host_name ) or ( $ this_host_name eq $ anvil - > Get - > short_host_name ) )
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { device_minor } = $ volume_vnr - > findvalue ( './device/@minor' ) ;
{
$ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { size } = 0 ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_path } = $ volume_vnr - > findvalue ( './device' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { backing_disk } = $ volume_vnr - > findvalue ( './disk' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_minor } = $ volume_vnr - > findvalue ( './device/@minor' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { size } = 0 ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
"s1:new::resource::${resource}::host::${this_host_name}::volume::${volume}::device_path" = > $ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { device_path } ,
"s1:new::resource::${resource}::volume::${volume}::device_path" = > $ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_path } ,
"s2:new::resource::${resource}::host::${this_host_name}::volume::${volume}::backing_disk" = > $ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_name } { volume } { $ volume } { backing_disk } ,
"s2:new::resource::${resource}::volume::${volume}::backing_disk" = > $ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { backing_disk } ,
"s3:new::resource::${resource}::host::${this_host_name}:: volume::${volume}::device_minor" = > $ anvil - > data - > { new } { resource } { $ resource } { host } { $ this_host_nam e } { volume } { $ volume } { device_minor } ,
"s3:new::resource::${resource}::volume::${volume}::device_minor" = > $ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_minor } ,
} } ) ;
} } ) ;
# Record the local data only.
if ( ( $ this_host_name eq $ anvil - > Get - > host_name ) or ( $ this_host_name eq $ anvil - > Get - > short_host_name ) )
{
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_path } = $ volume_vnr - > findvalue ( './device' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { backing_disk } = $ volume_vnr - > findvalue ( './disk' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_minor } = $ volume_vnr - > findvalue ( './device/@minor' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { size } = 0 ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
"s1:new::resource::${resource}::volume::${volume}::device_path" = > $ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_path } ,
"s2:new::resource::${resource}::volume::${volume}::backing_disk" = > $ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { backing_disk } ,
"s3:new::resource::${resource}::volume::${volume}::device_minor" = > $ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { device_minor } ,
} } ) ;
}
}
}
}
}
}
foreach my $ connection ( $ name - > findnodes ( './connection' ) )
foreach my $ connection ( $ name - > findnodes ( './connection' ) )
{
my $ peer = "" ;
foreach my $ host ( $ connection - > findnodes ( './host' ) )
{
{
my $ peer = "" ;
my $ this_host_name = $ host - > { name } ;
foreach my $ host ( $ connection - > findnodes ( './host' ) )
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { this_host_name = > $ this_host_name } } ) ;
{
my $ this_host_name = $ host - > { name } ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { this_host_name = > $ this_host_name } } ) ;
next if ( ( $ this_host_name eq $ anvil - > Get - > host_name ) or ( $ this_host_name eq $ anvil - > Get - > short_host_name ) ) ;
next if ( ( $ this_host_name eq $ anvil - > Get - > host_name ) or ( $ this_host_name eq $ anvil - > Get - > short_host_name ) ) ;
$ peer = $ this_host_name ;
$ peer = $ this_host_name ;
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { peer_ip_address } = $ host - > findvalue ( './address' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { peer_ip_address } = $ host - > findvalue ( './address' ) ;
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { tcp_port } = $ host - > findvalue ( './address/@port' ) ; ;
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { tcp_port } = $ host - > findvalue ( './address/@port' ) ; ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
"s1:new::resource::${resource}::peer::${peer}::peer_ip_address" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { peer_ip_address } ,
"s2:new::resource::${resource}::peer::${peer}::tcp_port" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { tcp_port } ,
} } ) ;
if ( not exists $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } )
{
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } = "unknown" ;
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } = "unknown" ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
"s1:new::resource::${resource}::peer::${peer}::peer_ip_address" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { peer_ip_address } ,
"s1:new::resource::${resource}::peer::${peer}::protocol " = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } ,
"s2:new::resource::${resource}::peer::${peer}::tcp_port" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { tcp_port } ,
"s2:new::resource::${resource}::peer::${peer}::fencing" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } ,
} } ) ;
} } ) ;
}
if ( not exists $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } )
foreach my $ volume ( sort { $ a cmp $ b } keys % { $ anvil - > data - > { new } { resource } { $ resource } { volume } } )
{
{
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } = "unknown" ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { connection_state } = "disconnected" ;
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } = "unknown" ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { local_disk_state } = "down" ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { peer_disk_state } = "unknown" ;
"s1:new::resource::${resource}::peer::${peer}::protocol" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } ,
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { local_role } = "down" ;
"s2:new::resource::${resource}::peer::${peer}::fencing" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } ,
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { peer_role } = "unknown" ;
} } ) ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { out_of_sync_size } = - 1 ;
}
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { replication_speed } = 0 ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { estimated_time_to_sync } = 0 ;
foreach my $ volume ( sort { $ a cmp $ b } keys % { $ anvil - > data - > { new } { resource } { $ resource } { volume } } )
{
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { connection_state } = "disconnected" ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { local_disk_state } = "down" ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { peer_disk_state } = "unknown" ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { local_role } = "down" ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { peer_role } = "unknown" ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { out_of_sync_size } = - 1 ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { replication_speed } = 0 ;
$ anvil - > data - > { new } { resource } { $ resource } { volume } { $ volume } { peer } { $ peer } { estimated_time_to_sync } = 0 ;
}
}
}
}
foreach my $ name ( $ connection - > findnodes ( './section' ) )
foreach my $ name ( $ connection - > findnodes ( './section' ) )
{
my $ section = $ name - > { name } ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { section = > $ section } } ) ;
foreach my $ option_name ( $ name - > findnodes ( './option' ) )
{
{
my $ section = $ name - > { name } ;
my $ variable = $ option_name - > { name } ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > { section = > $ section } } ) ;
my $ value = $ option_name - > { value } ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
's1:variable' = > $ variable ,
's2:value' = > $ value ,
} } ) ;
foreach my $ option_name ( $ name - > findnodes ( './option' ) )
i f ( $ section eq "net" )
{
{
my $ variable = $ option_name - > { name } ;
if ( $ variable eq "protocol" )
my $ value = $ option_name - > { value } ;
{
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } = $ value ;
's1:variable' = > $ variable ,
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
's2:value' = > $ value ,
"new::resource::${resource}::peer::${peer}::protocol" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } ,
} } ) ;
} } ) ;
}
if ( $ section eq "net ")
if ( $ variable eq "fencing ")
{
{
if ( $ variable eq "protocol" )
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } = $ value ;
{
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } = $ value ;
"new::resource::${resource}::peer::${peer}::fencing" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } ,
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
} } ) ;
"new::resource::${resource}::peer::${peer}::protocol" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { protocol } ,
} } ) ;
}
if ( $ variable eq "fencing" )
{
$ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } = $ value ;
$ anvil - > Log - > variables ( { source = > $ THIS_FILE , line = > __LINE__ , level = > $ debug , list = > {
"new::resource::${resource}::peer::${peer}::fencing" = > $ anvil - > data - > { new } { resource } { $ resource } { peer } { $ peer } { fencing } ,
} } ) ;
}
}
}
}
}
}
}