mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
repmgrd: various fixed, mainly clearing status after a failover event
This commit is contained in:
21
repmgr.c
21
repmgr.c
@@ -80,8 +80,8 @@ PG_FUNCTION_INFO_V1(notify_follow_primary);
|
||||
Datum get_new_primary(PG_FUNCTION_ARGS);
|
||||
PG_FUNCTION_INFO_V1(get_new_primary);
|
||||
|
||||
//Datum set_new_primary(PG_FUNCTION_ARGS);
|
||||
//PG_FUNCTION_INFO_V1(set_new_primary);
|
||||
Datum reset_voting_status(PG_FUNCTION_ARGS);
|
||||
PG_FUNCTION_INFO_V1(reset_voting_status);
|
||||
|
||||
/*
|
||||
* Module load callback
|
||||
@@ -153,9 +153,9 @@ repmgr_shmem_startup(void)
|
||||
shared_state->lock = LWLockAssign();
|
||||
#endif
|
||||
|
||||
shared_state->current_electoral_term = 0;
|
||||
shared_state->voting_status = VS_NO_VOTE;
|
||||
shared_state->candidate_node_id = UNKNOWN_NODE_ID;
|
||||
shared_state->current_electoral_term = 0;
|
||||
shared_state->follow_new_primary = false;
|
||||
}
|
||||
|
||||
@@ -315,3 +315,18 @@ get_new_primary(PG_FUNCTION_ARGS)
|
||||
|
||||
PG_RETURN_INT32(new_primary_node_id);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
reset_voting_status(PG_FUNCTION_ARGS)
|
||||
{
|
||||
LWLockAcquire(shared_state->lock, LW_SHARED);
|
||||
|
||||
shared_state->voting_status = VS_NO_VOTE;
|
||||
shared_state->candidate_node_id = UNKNOWN_NODE_ID;
|
||||
shared_state->follow_new_primary = false;
|
||||
|
||||
LWLockRelease(shared_state->lock);
|
||||
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user