Improve handover logic between sync and apply workers
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 6 Jun 2017 18:38:44 +0000 (14:38 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 6 Jun 2017 18:41:04 +0000 (14:41 -0400)
commite3a815d2faa5be28551e71d5db44fb2c78133433
treeef1b82057accb564eecb16763607167a0af5ee2a
parent79c4fa0f62291fd30d126a12f35b9ce71f06b3c0
Improve handover logic between sync and apply workers

Make apply busy wait check the catalog instead of shmem state to ensure
that next transaction will see the expected table synchronization state.

Also make the handover always go through same set of steps to make the
overall process easier to understand and debug.

Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Tested-by: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Tested-by: Erik Rijkers <er@xs4all.nl>
src/backend/replication/logical/tablesync.c