* Fixed a bug in Get->host_from_ip_address() where hosts that are no longer used are returned, meaning 2+ results could be returned after a node was replaced, meaning no host name was returned.

* Fixed a bug in anvil-provision-server where forcing initialization of a new DRBD resource when running on node 2 would fail because the node ID in the drbdsetup command was hard-coded to be run from node 1.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent 218934bec8
commit 3d7ce84c38
  1. 6
      Anvil/Tools/Get.pm
  2. 6
      tools/anvil-provision-server
  3. 2
      tools/test.pl

@ -1255,11 +1255,13 @@ FROM
ip_addresses b ip_addresses b
WHERE WHERE
a.host_uuid = b.ip_address_host_uuid a.host_uuid = b.ip_address_host_uuid
AND
a.host_key != 'DELETED'
AND AND
b.ip_address_note != 'DELETED' b.ip_address_note != 'DELETED'
AND AND
b.ip_address_address = ".$anvil->Database->quote($ip_address)."; b.ip_address_address = ".$anvil->Database->quote($ip_address)."
"; ;";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }});
my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__}); my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results}; my $count = @{$results};

@ -162,12 +162,16 @@ sub run_jobs
$anvil->data->{job}{short_host_name} = $anvil->Get->short_host_name; $anvil->data->{job}{short_host_name} = $anvil->Get->short_host_name;
$anvil->data->{job}{node1_short_host_name} = $anvil->data->{hosts}{host_uuid}{$node1_host_uuid}{short_host_name}; $anvil->data->{job}{node1_short_host_name} = $anvil->data->{hosts}{host_uuid}{$node1_host_uuid}{short_host_name};
$anvil->data->{job}{node2_short_host_name} = $anvil->data->{hosts}{host_uuid}{$node2_host_uuid}{short_host_name}; $anvil->data->{job}{node2_short_host_name} = $anvil->data->{hosts}{host_uuid}{$node2_host_uuid}{short_host_name};
$anvil->data->{job}{drbd_local_node_id} = $host_uuid eq $node1_host_uuid ? 0 : 1;
$anvil->data->{job}{drbd_peer_node_id} = $host_uuid eq $node1_host_uuid ? 1 : 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
'job::node1_host_uuid' => $anvil->data->{job}{node1_host_uuid}, 'job::node1_host_uuid' => $anvil->data->{job}{node1_host_uuid},
'job::node2_host_uuid' => $anvil->data->{job}{node2_host_uuid}, 'job::node2_host_uuid' => $anvil->data->{job}{node2_host_uuid},
'job::node1_short_host_name' => $anvil->data->{job}{node1_short_host_name}, 'job::node1_short_host_name' => $anvil->data->{job}{node1_short_host_name},
'job::node2_short_host_name' => $anvil->data->{job}{node2_short_host_name}, 'job::node2_short_host_name' => $anvil->data->{job}{node2_short_host_name},
'job::short_host_name' => $anvil->data->{job}{short_host_name}, 'job::short_host_name' => $anvil->data->{job}{short_host_name},
'job::drbd_local_node_id' => $anvil->data->{job}{drbd_local_node_id},
'job::drbd_peer_node_id' => $anvil->data->{job}{drbd_peer_node_id},
}}); }});
# We convert to extents as it ensure clean boundaries and, being based on bytes in both cases, gets # We convert to extents as it ensure clean boundaries and, being based on bytes in both cases, gets
@ -676,7 +680,7 @@ sub startup_resource
}); });
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "job_0195"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "job_0195"});
my $shell_call = $anvil->data->{path}{exe}{drbdsetup}." net-options ".$anvil->data->{job}{server_name}." 1 --set-defaults --_name=".$anvil->data->{job}{peer_short_name}." --protocol=C --fencing=dont-care"; my $shell_call = $anvil->data->{path}{exe}{drbdsetup}." net-options ".$anvil->data->{job}{server_name}." ".$anvil->data->{job}{drbd_peer_node_id}." --set-defaults --_name=".$anvil->data->{job}{peer_short_name}." --protocol=C --fencing=dont-care";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }});
my ($output, $return_code) = $anvil->System->call({shell_call => $shell_call}); my ($output, $return_code) = $anvil->System->call({shell_call => $shell_call});

@ -26,6 +26,6 @@ $anvil->Get->switches;
$anvil->Database->connect({debug => 3}); $anvil->Database->connect({debug => 3});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0132"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0132"});
$anvil->Cluster->assemble_storage_groups({debug => 2, anvil_uuid => '1aded871-fcb1-4473-9b97-6e9c246fc568'}); $anvil->DRBD->gather_data({debug => 2});
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});

Loading…
Cancel
Save