More logging to debug storage group race condition

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 2 years ago
parent bd575c6a7d
commit dc7b909bfc
  1. 8
      Anvil/Tools/Database.pm
  2. 2
      notes
  3. 2
      tools/anvil-manage-dr
  4. 2
      tools/anvil-manage-storage-groups
  5. 2
      tools/anvil-provision-server
  6. 5
      tools/anvil-report-usage

@ -6051,11 +6051,11 @@ WHERE
}}); }});
my $query = "DELETE FROM history.storage_group_members WHERE storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid).";"; my $query = "DELETE FROM history.storage_group_members WHERE storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid).";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { query => $query }});
$anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__}); $anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__});
$query = "DELETE FROM storage_group_members WHERE storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid).";"; $query = "DELETE FROM storage_group_members WHERE storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid).";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { query => $query }});
$anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__}); $anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__});
} }
} }
@ -13948,11 +13948,11 @@ SET
WHERE WHERE
storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid)." storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid)."
;"; ;";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { query => $query }});
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
$query = "DELETE FROM storage_group_members WHERE storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid).";"; $query = "DELETE FROM storage_group_members WHERE storage_group_member_uuid = ".$anvil->Database->quote($storage_group_member_uuid).";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { query => $query }});
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
} }
} }

@ -16,6 +16,8 @@ Common queries;
* SELECT a.job_uuid, b.host_name, a.job_command, a.job_data, a.job_progress, a.job_status FROM jobs a, hosts b WHERE a.job_host_uuid = b.host_uuid AND a.job_progress != 100; * SELECT a.job_uuid, b.host_name, a.job_command, a.job_data, a.job_progress, a.job_status FROM jobs a, hosts b WHERE a.job_host_uuid = b.host_uuid AND a.job_progress != 100;
* SELECT a.host_name, b.file_name, c.file_location_active FROM hosts a, files b, file_locations c WHERE a.host_uuid = c.file_location_host_uuid AND b.file_uuid = c.file_location_file_uuid ORDER BY b.file_name ASC, a.host_name ASC; * SELECT a.host_name, b.file_name, c.file_location_active FROM hosts a, files b, file_locations c WHERE a.host_uuid = c.file_location_host_uuid AND b.file_uuid = c.file_location_file_uuid ORDER BY b.file_name ASC, a.host_name ASC;
* SELECT a.dr_link_uuid, b.host_name, c.anvil_name, a.dr_link_note FROM dr_links a, hosts b, anvils c WHERE a.dr_link_host_uuid = b.host_uuid AND a.dr_link_anvil_uuid = c.anvil_uuid ORDER BY c.anvil_name ASC, b.host_name ASC; * SELECT a.dr_link_uuid, b.host_name, c.anvil_name, a.dr_link_note FROM dr_links a, hosts b, anvils c WHERE a.dr_link_host_uuid = b.host_uuid AND a.dr_link_anvil_uuid = c.anvil_uuid ORDER BY c.anvil_name ASC, b.host_name ASC;
* SELECT a.storage_group_uuid, d.storage_group_member_uuid, b.anvil_name, a.storage_group_name, c.host_name, d.storage_group_member_vg_uuid, d.storage_group_member_note FROM storage_groups a, anvils b, hosts c, storage_group_members d WHERE a.storage_group_uuid = d.storage_group_member_storage_group_uuid AND a.storage_group_anvil_uuid = b.anvil_uuid AND c.host_uuid = d.storage_group_member_host_uuid ORDER BY a.storage_group_name ASC, c.host_name ASC;
# Fail a resource for testing purposes. # Fail a resource for testing purposes.
crm_resource --fail --resource srv02-b -N vm-a01n01 crm_resource --fail --resource srv02-b -N vm-a01n01

@ -534,7 +534,7 @@ sub sanity_check
# Get the Anvil! details. # Get the Anvil! details.
$anvil->Database->get_hosts(); $anvil->Database->get_hosts();
$anvil->Database->get_anvils(); $anvil->Database->get_anvils();
$anvil->Database->get_storage_group_data(); $anvil->Database->get_storage_group_data({debug => 2});
$anvil->Database->get_dr_links({debug => 2}); $anvil->Database->get_dr_links({debug => 2});
# Does this Anvil! have at least one DR node? If there's only one, use it. If more than one, we need # Does this Anvil! have at least one DR node? If there's only one, use it. If more than one, we need

@ -60,7 +60,7 @@ if (not $anvil->data->{sys}{database}{connections})
$anvil->Database->get_hosts({include_deleted => 1}); $anvil->Database->get_hosts({include_deleted => 1});
$anvil->Database->get_anvils(); $anvil->Database->get_anvils();
$anvil->Database->get_storage_group_data(); $anvil->Database->get_storage_group_data({debug => 2});
get_vg_data($anvil); get_vg_data($anvil);
get_storage_data($anvil); get_storage_data($anvil);

@ -2417,7 +2417,7 @@ sub interactive_ask_server_storage_size
}}); }});
$anvil->Database->get_anvils(); $anvil->Database->get_anvils();
$anvil->Database->get_storage_group_data(); $anvil->Database->get_storage_group_data({debug => 2});
$anvil->Get->available_resources({ $anvil->Get->available_resources({
debug => 2, debug => 2,
anvil_uuid => $anvil_uuid, anvil_uuid => $anvil_uuid,

@ -116,7 +116,10 @@ sub collect_anvil_data
}}); }});
} }
$anvil->Get->available_resources({anvil_uuid => $anvil_uuid}); $anvil->Get->available_resources({
debug => 2,
anvil_uuid => $anvil_uuid,
});
my $cpu_cores = $anvil->data->{anvil_resources}{$anvil_uuid}{cpu}{cores}; my $cpu_cores = $anvil->data->{anvil_resources}{$anvil_uuid}{cpu}{cores};
my $cpu_threads = $anvil->data->{anvil_resources}{$anvil_uuid}{cpu}{threads}; my $cpu_threads = $anvil->data->{anvil_resources}{$anvil_uuid}{cpu}{threads};
my $say_cpu = $anvil->Words->string({key => "message_0289", variables => { my $say_cpu = $anvil->Words->string({key => "message_0289", variables => {

Loading…
Cancel
Save