pgsql: Fall back to serializing when parallel apply runs out of DSM seg
pgsql: Fall back to serializing when parallel apply runs out of DSM seg
От:
Masahiko Sawada <msawada@postgresql.org>
Дата:
Fall back to serializing when parallel apply runs out of DSM segments. Commit 216a784829c made the leader apply worker serialize a streamed transaction to a file if it fails to set up the shared memory for a parallel apply worker. However, it called dsm_create() without DSM_CREATE_NULL_IF_MAXSEGMENTS, so running out of DSM segments raised an ERROR instead. The leader apply worker then exited and failed again at the same STREAM START after restarting, so replication made no progress until segments were freed. Fix by passing DSM_CREATE_NULL_IF_MAXSEGMENTS, as parallel query does. Backpatch to v16, where parallel apply was introduced. Author: Baji Shaik Reviewed-by: Zhijie Hou Reviewed-by: Bharath Rupireddy Reviewed-by: Masahiko Sawada Discussion: https://postgr.es/m/CA+fm-RMyb6EoMuk+a4_hZou9cdTHfB6mj1UV-7yb_YuTWLug1g@mail.gmail.com Backpatch-through: 16 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c790e38b4a26f8546a10f3a4fdb79cf090f70632 Modified Files -------------- src/backend/replication/logical/applyparallelworker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)