将Postgres从奴隶推广到主节点
我有两个postgresql 11.4
以主和节点运行。
我正在将大量数据插入主数据,以发现它在从属上被复制。 尝试模拟以下情况,
- 请在从服务器上插入大量数据
pape_wal_replay
- 等待WAL文件将Slave Files运送到Slave
insume_wal_replay
从从服务器上- 立即在有多个WAL文件时立即促销 重播
如果此时发布 (当时有多个WAL时 - 已经发货并等待重播时),则会
- ?
重播所有现有的WAL文件[
发货并等待重播
] 或 - 接收促进信号后立即
。 [
不重播WAL文件
等待 -导致数据丢失
? ]
如果是(1)
,如果主节点仍在发送WAL文件,我会尝试推广从属,会发生什么。它会忽略即将来临的WAL并提升自己吗?
希望PG专家能够阐明这一点。
PS:如果值得一提的话,我正在通过创建'pg_failover_trigger
'来发出促进信号。
I have two postgresql 11.4
running as master and slave nodes.
I am inserting huge volume of data in master to see it get replicated on the slave.
Trying to simulate the following case,
- Insert huge data
pause_wal_replay
on slave- wait for the wal files to get shipped to slave
resume_wal_replay
on slave- promote immediately when there are multiple wal files waiting to be replayed
If a promote signal
is issued at this point [ When there are multiple wal - already shipped and waiting to be replayed ], When will slave promote itself?
After replaying all the existing wal files [
shipped and waiting to be replayed
]
orImmediately after receiving promote signal. [
Without replaying the wal files
waiting -causing data loss
? ]
If it is (1)
, what happens if the master node is still sending wal files and I try to promote the slave. Does it ignore the incoming wal and promote itself?
Hoping PG Experts can shed light on this.
PS : I'm issuing promote signal by creating a 'pg_failover_trigger
' if its worth mentioning.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
升级后,备用服务器关闭了WAL接收器流程,并恢复了所有剩余的WAL。因此,我们从1中获得行为。
When it is promoted, the standby server shuts down the WAL receiver process and recovers all remaining WAL it has. So we get the behavior from 1.