Skip to content

Files

Latest commit

Dec 15, 2023
f400df2 · Dec 15, 2023

History

History
90 lines (58 loc) · 4 KB

20210801_05.md

File metadata and controls

90 lines (58 loc) · 4 KB

PostgreSQL 15 preivew - 逻辑复制请求: START_REPLICATION ... LOGICAL 文档修正

作者

digoal

日期

2021-08-01

标签

PostgreSQL , 逻辑复制


背景

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=14d474e079e1edf08926a2e68028cbd82dd614c4

Improve documentation for START_REPLICATION ... LOGICAL.  
author	Jeff Davis <jdavis@postgresql.org>	  
Fri, 30 Jul 2021 21:59:19 +0000 (14:59 -0700)  
committer	Jeff Davis <jdavis@postgresql.org>	  
Fri, 30 Jul 2021 22:12:20 +0000 (15:12 -0700)  
commit	14d474e079e1edf08926a2e68028cbd82dd614c4  
tree	0f9c5e15e184cb7adb1395f6dabcf738f691a963	tree  
parent	5fcf3945bd90bb0170938ad780159779367dc8ac	commit | diff  
Improve documentation for START_REPLICATION ... LOGICAL.  
  
The starting point may not be exactly what the client requested; it  
may be at the slot's confirmed_flush_lsn.  
  
Also, upgrade the message from DEBUG1 to LOG when this happens.  
  
Reviewed-by: Amit Kapila  
Discussion: https://postgr.es/m/c5c861d576f2511732f8002c76245da587110b1c.camel%40j-davis.com  
doc/src/sgml/protocol.sgml		diff | blob | blame | history  
src/backend/replication/logical/logical.c		diff | blob | blame | history  
+      Instructs server to start streaming WAL for logical replication,  
+      starting at either WAL location <replaceable  
+      class="parameter">XXX/XXX</replaceable> or the slot's  
+      <literal>confirmed_flush_lsn</literal> (see <xref  
+      linkend="view-pg-replication-slots"/>), whichever is greater. This  
+      behavior makes it easier for clients to avoid updating their local LSN  
+      status when there is no data to process. However, starting at a  
+      different LSN than requested might not catch certain kinds of client  
+      errors; so the client may wish to check that  
+      <literal>confirmed_flush_lsn</literal> matches its expectations before  
+      issuing <literal>START_REPLICATION</literal>.  
+     </para>  
+  
+     <para>  
+      The server can reply with an error, for example if the  
+      slot does not exist. On success, server responds with a CopyBothResponse  

https://www.postgresql.org/docs/14/view-pg-replication-slots.html

confirmed_flush_lsn pg_lsn:
The address (LSN) up to which the logical slot's consumer has confirmed receiving data. Data older than this is not available anymore. NULL for physical slots.

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

digoal's wechat