暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL 15 preview - pg_basebackup 增强, 支持扩展COPY协议

原创 digoal 2022-01-20
272

作者

digoal

日期

2022-01-19

标签

PostgreSQL , pg_basebackup


pg_basebackup 扩展协议, 将来将支持更好的进度展示、压缩格式、等.

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

Modify pg_basebackup to use a new COPY subprotocol for base backups.  
author  Robert Haas <rhaas@postgresql.org>    
Tue, 18 Jan 2022 18:47:26 +0000 (13:47 -0500)  
committer   Robert Haas <rhaas@postgresql.org>    
Tue, 18 Jan 2022 18:47:49 +0000 (13:47 -0500)  
commit  cc333f32336f5146b75190f57ef587dff225f565  
tree    8bcc3bf1b50cf4cbfe597a519b37e7aa8fcc5bde    tree  
parent  3414099c338bf619c00dd82d96f29a9668a3bf07    commit | diff  
Modify pg_basebackup to use a new COPY subprotocol for base backups.  
In the new approach, all files across all tablespaces are sent in a  
single COPY OUT operation. The CopyData messages are no longer raw  
archive content; rather, each message is prefixed with a type byte  
that describes its purpose, e.g. 'n' signifies the start of a new  
archive and 'd' signifies archive or manifest data. This protocol  
is significantly more extensible than the old approach, since we can  
later create more message types, though not without concern for  
backward compatibility.  
The new protocol sends a few things to the client that the old one  
did not. First, it sends the name of each archive explicitly, instead  
of letting the client compute it. This is intended to make it easier  
to write future patches that might send archives in a format other  
that tar (e.g. cpio, pax, tar.gz). Second, it sends explicit progress  
messages rather than allowing the client to assume that progress is  
defined by the number of bytes received. This will help with future  
features where the server compresses the data, or sends it someplace  
directly rather than transmitting it to the client.  
The old protocol is still supported for compatibility with previous  
releases. The new protocol is selected by means of a new  
TARGET option to the BASE_BACKUP command. Currently, the  
only supported target is 'client'. Support for additional  
targets will be added in a later commit.  
Patch by me. The patch set of which this is a part has had review  
and/or testing from Jeevan Ladhe, Tushar Ahuja, Suraj Kharage,  
Dipesh Pandit, and Mark Dilger.  
Discussion: http://postgr.es/m/CA+TgmoaYZbz0=Yk797aOJwkGJC-LK3iXn+wzzMx7KdwNpZhS5g@mail.gmail.com  

https://www.postgresql.org/docs/devel/protocol-replication.html

new archive (B)  
Byte1('n')  
Identifes the messaage as indicating the start of a new archive.  
String  
The file name for this archive.  
String  
For the main data directory, an empty string. For other tablespaces, the full path to the directory from which this archive was created.  
manifest (B)  
Byte1('m')  
Identifes the message as indicating the start of the backup manifest.  
archive or manifest data (B)  
Byte1('d')  
Identifes the message as containing archive or manifest data.  
Byten  
Data bytes.  
progress report (B)  
Byte1('p')  
Identifes the message as a progress report.  
Int64  
The number of bytes from the current tablespace for which processing has been completed.  

期望 PostgreSQL 增加什么功能?

PolarDB for PostgreSQL云原生分布式开源数据库

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论