天天看點

PostgreSQL 10.0 preview 功能增強 - slave支援WAITLSN 'lsn', time;用于設定安全replay栅欄

postgresql , 10.0 , waitlsn , replay , slave , 流複制 , 等待恢複

postgresql 的流複制是非常靈活的,在主庫端,可以将事務的級别設定為同步,異步,本地同步,遠端同步刷盤,遠端同步刷os緩存,遠端資料庫apply等多種級别。

<a href="https://github.com/digoal/blog/blob/master/201610/20161006_02.md">《postgresql 9.6 同步多副本 與 remote_apply事務同步級别》</a>

但是在備庫,還沒有一個可以設定安全栅欄的手段,比如說,我們要讓備庫apply到某個位點後,再執行某個query。

10.0提供了這樣的接口,來完成這個功能。

waitlsn 'lsn', time;文法

例子:

詳情

這個patch的讨論,詳見郵件組,本文末尾url。

postgresql社群的作風非常嚴謹,一個patch可能在郵件組中讨論幾個月甚至幾年,根據大家的意見反複的修正,patch合并到master已經非常成熟,是以postgresql的穩定性也是遠近聞名的。

<a href="https://commitfest.postgresql.org/13/772/">https://commitfest.postgresql.org/13/772/</a>

<a href="https://www.postgresql.org/message-id/flat/[email protected]#[email protected]">https://www.postgresql.org/message-id/flat/[email protected]#[email protected]</a>

繼續閱讀