PostgreSQL 10.0 preview 安全增强 - 任意wal副本数,金融级高可用与可靠性并存需求...

标签

PostgreSQL , 流复制 , 同步流复制 , 任意副本


背景

PostgreSQL很多年前就开始支持同步流复制,支持配置多个standby,当sync node异常时,potention standby节点会自动变成sync node。从而提供0丢失的高可用。

但是此前如果要配置超过2个副本的高可用时,需要打一个patch。

10.0将这个patch合并到了内核中,支持配置任意副本,即,所有节点都可能随时成为sync node。

比如有3个standby,配置为2时,则3个中任意2个收到事务结束的wal后,才会释放主库会话等待队列,返回用户。

这个特性已经达到了金融级的要求,例如两地三中心,可以保证有2个副本。

当然如果你的要求更高,可以配置5个甚至更多standby,那么即使挂掉3个备库,也不影响使用。

详见

Hi all,  
  
In 9.6 development cycle, we had been discussed about configuration  
syntax for a long time while considering expanding.  
As a result, we had new dedicated language for multiple synchronous  
replication, but it supports only priority method.  
We know that quorum commit is very useful for many users and can  
expand dedicated language easily for quorum commit.  
So I'd like to propose quorum commit for multiple synchronous replication here.  
  
The followings are changes attached patches made.  
- Add new syntax 'Any N ( node1, node2, ... )' to  
synchornous_standby_names for quorum commit.  
- In quorum commit, the master can return commit to client after  
received ACK from *at least* any N servers of listed standbys.  
- sync_priority of all listed servers are same, 1.  
- Add regression test for quorum commit.  
  
I was thinking that the syntax for quorum method would use '[ ... ]'  
but it will be confused with '( ... )' priority method used.  
001 patch adds 'Any N ( ... )' style syntax but I know that we still  
might need to discuss about better syntax, discussion is very welcome.  
Attached draft patch, please give me feedback.  
  
Regards,  
  
--  
Masahiko Sawada  

这个patch的讨论,详见邮件组,本文末尾URL。

PostgreSQL社区的作风非常严谨,一个patch可能在邮件组中讨论几个月甚至几年,根据大家的意见反复的修正,patch合并到master已经非常成熟,所以PostgreSQL的稳定性也是远近闻名的。

参考

https://commitfest.postgresql.org/12/826/

https://www.postgresql.org/message-id/flat/CAD21AoAACi9NeC_ecm+Vahm+MMA6nYh=Kqs3KB3np+MBOS_gZg@mail.gmail.com#CAD21AoAACi9NeC_ecm+Vahm+MMA6nYh=Kqs3KB3np+MBOS_gZg@mail.gmail.com

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值