Skip to content

Commit

Permalink
Reload configuration more frequently in apply worker.
Browse files Browse the repository at this point in the history
The apply worker was not reloading the configuration while processing
messages if there is a continuous flow of messages from upstream. It was
also not reloading the configuration if there is a change in the
configuration after it has waited for the message and before receiving the
new replication message. This can lead to failure in tests because we
expect that after reload, the behavior of apply worker to respect the
changed GUCs.

We found this while analyzing a rare buildfarm failure.

Author: Hou Zhijie
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/OS0PR01MB5716AF9079CC0755CD015322947E9@OS0PR01MB5716.jpnprd01.prod.outlook.com
  • Loading branch information
Amit Kapila committed Jun 7, 2023
1 parent 95f0340 commit d64e646
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backend/replication/logical/worker.c
Expand Up @@ -3562,6 +3562,12 @@ LogicalRepApplyLoop(XLogRecPtr last_received)
int c;
StringInfoData s;

if (ConfigReloadPending)
{
ConfigReloadPending = false;
ProcessConfigFile(PGC_SIGHUP);
}

/* Reset timeout. */
last_recv_timestamp = GetCurrentTimestamp();
ping_sent = false;
Expand Down

0 comments on commit d64e646

Please sign in to comment.