Skip to content

Latest commit

 

History

History
108 lines (76 loc) · 5.27 KB

20230407_02.md

File metadata and controls

108 lines (76 loc) · 5.27 KB

PostgreSQL 16 preview - postgres_fdw foreign server option 支持 parallel_abort 选项, 并行回滚远端事务

作者

digoal

日期

2023-04-07

标签

PostgreSQL , PolarDB , postgres_fdw , parallel_abort , parallel_commit


背景

PostgreSQL 16 preview - postgres_fdw foreign server option 支持 parallel_abort 选项, 并行回滚远端事务

此前postgres_fdw foreign server option 已支持 parallel_commit

+ALTER SERVER loopback2 OPTIONS (ADD parallel_abort 'true');  

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=983ec23007bd83a649af9bc823f13feb0da27e0e

postgres_fdw: Add support for parallel abort.  
author	Etsuro Fujita <efujita@postgresql.org>	  
Thu, 6 Apr 2023 08:30:00 +0000 (17:30 +0900)  
committer	Etsuro Fujita <efujita@postgresql.org>	  
Thu, 6 Apr 2023 08:30:00 +0000 (17:30 +0900)  
commit	983ec23007bd83a649af9bc823f13feb0da27e0e  
tree	d16c129d9a721b8ca9001390dc67bd58d072f451	tree  
parent	b9b125b9c14381c4d04a446e335bb2da5f602596	commit | diff  
postgres_fdw: Add support for parallel abort.  
  
postgres_fdw aborts remote (sub)transactions opened on remote server(s)  
in a local (sub)transaction one by one when the local (sub)transaction  
aborts.  This patch allows it to abort the remote (sub)transactions in  
parallel to improve performance.  This is enabled by the server option  
"parallel_abort".  The default is false.  
  
Etsuro Fujita, reviewed by David Zhang.  
  
Discussion: http://postgr.es/m/CAPmGK15FuPVGx3TGHKShsbPKKtF1y58-ZLcKoxfN-nqLj1dZ%3Dg%40mail.gmail.com  
 524     <varlistentry>  
 525      <term><literal>parallel_commit</literal> (<type>boolean</type>)</term>  
 526      <listitem>  
 527       <para>  
 528        This option controls whether <filename>postgres_fdw</filename> commits  
 529        in parallel remote transactions opened on a foreign server in a local  
 530        transaction when the local transaction is committed. This setting also  
 531        applies to remote and local subtransactions. This option can only be  
 532        specified for foreign servers, not per-table. The default is  
 533        <literal>false</literal>.  
 534       </para>  
 535      </listitem>  
 536     </varlistentry>  
 537   
 538     <varlistentry>  
 539      <term><literal>parallel_abort</literal> (<type>boolean</type>)</term>  
 540      <listitem>  
 541       <para>  
 542        This option controls whether <filename>postgres_fdw</filename> aborts  
 543        in parallel remote transactions opened on a foreign server in a local  
 544        transaction when the local transaction is aborted. This setting also  
 545        applies to remote and local subtransactions. This option can only be  
 546        specified for foreign servers, not per-table. The default is  
 547        <literal>false</literal>.  
 548       </para>  
 549      </listitem>  
 550     </varlistentry>  
  
+   <para>  
+    If multiple foreign servers with these options enabled are involved in a  
+    local transaction, multiple remote transactions on those foreign servers  
+    are committed or aborted in parallel across those foreign servers when  
+    the local transaction is committed or aborted.  
+   </para>  

digoal's wechat