Skip to content

Commit

Permalink
Start background workers on consistent state
Browse files Browse the repository at this point in the history
Allows workers to start on hot standby.
  • Loading branch information
adamguo0 committed Jan 18, 2024
1 parent 4670862 commit fc7fea4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/clientauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ clientauth_init(void)
shmem_startup_hook = clientauth_shmem_startup;

worker.bgw_flags = BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION;
worker.bgw_start_time = BgWorkerStart_RecoveryFinished;
worker.bgw_start_time = BgWorkerStart_ConsistentState;
worker.bgw_restart_time = 1;
worker.bgw_notify_pid = 0;
sprintf(worker.bgw_library_name, PG_TLE_EXTNAME);
Expand Down
2 changes: 1 addition & 1 deletion src/passcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ passcheck_check_password_hook(const char *username, const char *shadow_pass, Pas
* 2. Spin up background worker.
*/
worker.bgw_flags = BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION;
worker.bgw_start_time = BgWorkerStart_RecoveryFinished;
worker.bgw_start_time = BgWorkerStart_ConsistentState;
worker.bgw_restart_time = 1;
worker.bgw_notify_pid = MyProcPid;
sprintf(worker.bgw_library_name, PG_TLE_EXTNAME);
Expand Down

0 comments on commit fc7fea4

Please sign in to comment.