mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
'repmgr witness create --force': overwrite any existing node record
Consistent with 'repmgr standby register --force'. Fixes Github #122.
This commit is contained in:
13
repmgr.c
13
repmgr.c
@@ -2297,6 +2297,19 @@ do_witness_create(void)
|
||||
|
||||
/* register ourselves in the master */
|
||||
|
||||
if (runtime_options.force)
|
||||
{
|
||||
bool node_record_deleted = delete_node_record(masterconn,
|
||||
options.node,
|
||||
"witness create");
|
||||
|
||||
if (node_record_deleted == false)
|
||||
{
|
||||
PQfinish(masterconn);
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
}
|
||||
|
||||
record_created = create_node_record(masterconn,
|
||||
"witness create",
|
||||
options.node,
|
||||
|
||||
Reference in New Issue
Block a user