Fixed a bug where migrations would needlessly fail memory checks.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 5 months ago
parent ab33c716cb
commit b990d21dc3
  1. 7
      ocf/alteeve/server

@ -1991,10 +1991,17 @@ sub validate_ram
{
my ($anvil) = @_;
### TODO: During a migration, we need to check the memory in migrate_to.
if ($anvil->data->{switches}{migrate_to})
{
return(0);
}
# How mcuh RAM does the server need and how much do we have free?
my $local_host = $anvil->Get->short_host_name();
my $server = $anvil->data->{environment}{OCF_RESKEY_name};
my $server_ram_bytes = $anvil->data->{server}{$local_host}{$server}{from_disk}{memory};
# In migrations, this checks local RAM when validating if it can run on the peer, which makes no sense. Disabling.
my $available = $anvil->Get->free_memory({debug => 3});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
server_ram_bytes => $anvil->Convert->add_commas({number => $server_ram_bytes})." (".$anvil->Convert->bytes_to_human_readable({'bytes' => $server_ram_bytes}).")",

Loading…
Cancel
Save