From: Amit Kapila Date: Wed, 7 Jun 2023 03:49:17 +0000 (+0530) Subject: Reload configuration more frequently in apply worker. X-Git-Tag: REL_16_BETA2~81 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=d64e6468f489effec356ce3501c0f226ac1cfcc0;p=postgresql.git Reload configuration more frequently in apply worker. 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 --- diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 78926f8647b..0ee764d68f1 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -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;