Reload configuration more frequently in apply worker.
authorAmit Kapila <[email protected]>
Wed, 7 Jun 2023 03:49:17 +0000 (09:19 +0530)
committerAmit Kapila <[email protected]>
Wed, 7 Jun 2023 03:49:17 +0000 (09:19 +0530)
commitd64e6468f489effec356ce3501c0f226ac1cfcc0
tree9312fdc299ffa914e1bec91abecf0a70fdef178b
parent95f0340c3bc745aee3aa90847efd2007e40236e9
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
src/backend/replication/logical/worker.c