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
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f22cb79d05b0a9dfc9b4065a8f8f08c4c716fd2d

Modified Files
--------------
src/backend/replication/logical/applyparallelworker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

FAQ