B<<Note>>:Thecallerisresponsibleforensuringthedataonthesourewillnotchangeduringthecopy.Ifthesourceisaserver,makesureit's off. If the source is a file system, make sure it'sunmounted.
my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
results => $results,
count => $count,
}});
foreach my $row (@{$results})
{
my $variable_uuid = $row->[0];
my $variable_name = $row->[1];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
's1:variable_name' => $variable_name,
's2:variable_uuid' => $variable_uuid,
}});
# Find out of there are any records to remove at all.
my $query = "SELECT history_id FROM history.variables WHERE variable_uuid = ".$anvil->Database->quote($variable_uuid)." AND modified_date <= '".$old_timestamp."';";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
my $results = $anvil->Database->query({uuid => $uuid, query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
results => $results,
count => $count,
}});
if ($count)
{
# Find how many records will be left. If it's 0, we'll use an OFFSET 1.
my $query = "SELECT history_id FROM history.variables WHERE variable_uuid = ".$anvil->Database->quote($variable_uuid)." AND modified_date > '".$old_timestamp."';";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
my $results = $anvil->Database->query({uuid => $uuid, query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
results => $results,
count => $count,
}});
if ($count)
{
# At least one record will be left, we can do a simple delete.
my $query = "DELETE FROM history.variables WHERE variable_uuid = ".$anvil->Database->quote($variable_uuid)." AND modified_date <= '".$old_timestamp."';";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
push @{$queries}, $query;
}
else
{
# This would delete everything, reserve at least one record.
foreach my $row (@{$results})
{
my $history_id = $row->[0];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { history_id => $history_id }});
my $query = "DELETE FROM history.variables WHERE variable_uuid = ".$anvil->Database->quote($variable_uuid)." AND history_id = '".$history_id."';";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
push @{$queries}, $query;
}
}
}
}
my $commits = @{$queries};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { commits => $commits }});
This mode is NOT supported by the Anvil! Intelligent Availability™ platform!
</key>
<keyname="scan_network_log_0001">Aging out RX and TX data under: [#!variable!records!#] interfaces. These have 1 or more historical records older than: [#!variable!age!#] hours old from the database host: [#!variable!host!#].</key>
@ -1267,6 +1267,28 @@ It will take time for it to initialize, please be patient.</key>
<keyname="job_0383">The job has been recorded with the UUID: [#!variable!job_uuid!#], it will start in just a moment if anvil-daemon is running.</key>
<keyname="job_0384">Manage DR tasks for a given server</key>
<keyname="job_0385">This job can protect, remove (unprotect), connect, disconnect or update (connect, sync, disconnect) a given server.</key>
<keyname="job_0386">
Do you want to connect the DR host for the server: [#!variable!server!#]?
Note: Depending on the disk write load and storage network speed to the DR host,
this could cause reduced disk write performance.</key>
<keyname="job_0387">About to connect the DR resource for the server: [#!variable!server!#].</key>
<keyname="job_0388">Brought up the connection locally. Now checking that the resource is up on the nodes.</key>
<keyname="job_0389">Making sure the resource is up on: [#!variable!host_name!#].</key>
<keyname="job_0390">Waiting now for the our resource to connect.</key>
<keyname="job_0391">Done! The server: [#!variable!server!#] is now connected.</key>
<keyname="job_0392">
Do you want to disconnect the DR host for the server: [#!variable!server!#]?
Note: Once down, no further changes will be written to the DR host.</key>
<keyname="job_0393">About to disconnect the DR resource for the server: [#!variable!server!#].</key>
<keyname="job_0394">Done! The server: [#!variable!server!#] is now disconnected.</key>
<keyname="job_0395">
Do you want to update the DR host for the server: [#!variable!server!#]?
Note: This will connect the DR host until the disk(s) on DR are (all) UpToDate.
Depending on the disk write load and storage network speed to the DR host,
this could cause reduced disk write performance.</key>
<keyname="job_0396">Still sync'ing from: [#!variable!sync_source!#] at a rate of: [#!variable!sync_speed!#/sec]. Estimated time remaining is: [#!variable!time_to_sync!#].</key>
<keyname="job_0397">Sync'ed! Bringing the resource back down now.</key>
<keyname="job_0398">Waiting for the connection to come up...</key>
@ -2031,6 +2053,7 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<keyname="log_0660">Stopped the postgresql daemon as a peer is currently primary.</key>
<keyname="log_0661">Our most recent database dump is newer than any from our peers. As such, we'll just start the database without a load.</key>
<keyname="log_0662">Retrying to connect to the database.</key>
<keyname="log_0663">The target can be reached on the dedicated migration network: [#!variable!target!#] via the IP address: [#!variable!ip!#], switching to use that for the RAM copy.</key>
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<keyname="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>