mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
1
HISTORY
1
HISTORY
@@ -3,6 +3,7 @@
|
||||
repmgr: improve messages emitted during "standby promote" (Ian)
|
||||
repmgr: "standby clone" - don't copy external config files in --dry-run
|
||||
mode; GitHub #491 (Ian)
|
||||
repmgr: add "cluster_cleanup" event; GitHub #492 (Ian)
|
||||
repmgrd: ensure that sending SIGHUP always results in the log file
|
||||
being reopened; GitHub #485 (Ian)
|
||||
repmgrd: report version number *after* logger initialisation; GitHub #487 (Ian)
|
||||
|
||||
@@ -1760,7 +1760,6 @@ vacuum_table(PGconn *primary_conn, const char *table)
|
||||
res = PQexec(primary_conn, query.data);
|
||||
termPQExpBuffer(&query);
|
||||
|
||||
log_debug("%i", (int) PQresultStatus(res));
|
||||
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||
{
|
||||
success = false;
|
||||
@@ -3336,7 +3335,7 @@ _create_event(PGconn *conn, t_configuration_options *options, int node_id, char
|
||||
*/
|
||||
if (notify_ok == false)
|
||||
{
|
||||
log_debug(_("Not executing notification script for event type \"%s\""), event);
|
||||
log_debug(_("not executing notification script for event type \"%s\""), event);
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<command><link linkend="repmgr-cluster-cleanup">repmgr cluster cleanup</link></command>:
|
||||
add <literal>cluster_cleanup</literal> event. (GitHub #492)
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
@@ -193,6 +193,9 @@
|
||||
<listitem>
|
||||
<simpara><literal>node_rejoin</literal></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>cluster_cleanup</literal></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><literal>repmgrd_start</literal></simpara>
|
||||
</listitem>
|
||||
|
||||
@@ -44,6 +44,14 @@
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Event notifications</title>
|
||||
<para>
|
||||
A <literal>cluster_cleanup</literal> <link linkend="event-notifications">event notification</link> will be generated.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1>
|
||||
<title>See also</title>
|
||||
<para>
|
||||
|
||||
@@ -1332,6 +1332,7 @@ do_cluster_cleanup(void)
|
||||
PGconn *conn = NULL;
|
||||
PGconn *primary_conn = NULL;
|
||||
int entries_to_delete = 0;
|
||||
PQExpBufferData event_details;
|
||||
|
||||
conn = establish_db_connection(config_file_options.conninfo, true);
|
||||
|
||||
@@ -1355,10 +1356,23 @@ do_cluster_cleanup(void)
|
||||
log_debug("at least %i monitoring records for deletion",
|
||||
entries_to_delete);
|
||||
|
||||
initPQExpBuffer(&event_details);
|
||||
|
||||
if (delete_monitoring_records(primary_conn, runtime_options.keep_history) == false)
|
||||
{
|
||||
log_error(_("unable to delete monitoring records"));
|
||||
appendPQExpBuffer(&event_details,
|
||||
_("unable to delete monitoring records"));
|
||||
|
||||
log_error("%s", event_details.data);
|
||||
log_detail("%s", PQerrorMessage(primary_conn));
|
||||
|
||||
create_event_notification(primary_conn,
|
||||
&config_file_options,
|
||||
config_file_options.node_id,
|
||||
"cluster_cleanup",
|
||||
false,
|
||||
event_details.data);
|
||||
|
||||
PQfinish(primary_conn);
|
||||
exit(ERR_DB_QUERY);
|
||||
}
|
||||
@@ -1370,7 +1384,22 @@ do_cluster_cleanup(void)
|
||||
log_detail("%s", PQerrorMessage(primary_conn));
|
||||
}
|
||||
|
||||
appendPQExpBuffer(&event_details,
|
||||
_("monitoring records deleted"));
|
||||
|
||||
if (runtime_options.keep_history > 0)
|
||||
appendPQExpBuffer(&event_details,
|
||||
_("; records newer than %i day(s) retained"),
|
||||
runtime_options.keep_history);
|
||||
|
||||
create_event_notification(primary_conn,
|
||||
&config_file_options,
|
||||
config_file_options.node_id,
|
||||
"cluster_cleanup",
|
||||
true,
|
||||
event_details.data);
|
||||
|
||||
termPQExpBuffer(&event_details);
|
||||
PQfinish(primary_conn);
|
||||
|
||||
if (runtime_options.keep_history > 0)
|
||||
|
||||
Reference in New Issue
Block a user