Subject: how to ensure parallel restore consistency ?

From: "熊艳辉" <[email-masked]>
Date: Tue, 8 Aug 2023 09:54:38 +0800

PG version 15.4
i read code about pg_dump &amp; pg_restore, there is an option -j/--jobs related with parallel,
i have questions about parallel dump &amp; restore
1)&nbsp;In pg_dump when running parallel dump, it can ensure dump data consistency using synchronized snaphot,

why should it start a trasaction in every parallel jobs, also set isolation level ,read only, and no need commit trasaction
2)&nbsp;In pg_restore there are no actions same with pg_dump under parallel mode, how to ensure restore data consistency?

no trasaction and no commit action
3)&nbsp;when we do dump or restore under parallel mode, should we set whole database read-only(write behavior forbidden??)

发自我的企业微信