mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Only attempt to log an event if the rempgr schema has been set
In some circumstances (primarily when executing `repmgr standby clone`) the `repmgr.conf` file is not mandated. However this means the repmgr schema is not known, and any attempt to create an event record will result in a log warning, which may cause confusion as to the success of the operation. It might be better to mandate providing `repmgr.conf` in all circumstances. Per report in https://github.com/2ndQuadrant/repmgr/issues/53 .
This commit is contained in:
@@ -1051,7 +1051,12 @@ create_event_record(PGconn *conn, t_configuration_options *options, int node_id,
|
||||
bool success = true;
|
||||
struct tm ts;
|
||||
|
||||
if(conn != NULL)
|
||||
/* Only attempt to write a record if a connection handle was provided/
|
||||
Also check that the repmgr schema has been properly intialised - if
|
||||
not it means no configuration file was provided, which can happen with
|
||||
e.g. `repmgr standby clone`, and we won't know which schema to write to.
|
||||
*/
|
||||
if(conn != NULL && strcmp(repmgr_schema, DEFAULT_REPMGR_SCHEMA_PREFIX) != 0)
|
||||
{
|
||||
int n_node_id = htonl(node_id);
|
||||
char *t_successful = successful ? "TRUE" : "FALSE";
|
||||
|
||||
Reference in New Issue
Block a user