您好,登錄后才能下訂單哦!
PG 12的新特性Connection slots and WAL senders,詳細描述如下:
Move max_wal_senders out of max_connections for connection slot handling.Since its introduction, max_wal_senders is counted as part of max_connections when it comes to define how many connection slots can be used for replication connections with a WAL sender context. This can lead to confusion for some users, as it could be possible to block a base backup or replication from happening because other backend sessions are already taken for other purposes by an application, and superuser-only connection slots are not a correct solution to handle that case.This commit makes max_wal_senders independent of max_connections for its handling of PGPROC entries in ProcGlobal, meaning that connection slots for WAL senders are handled using their own free queue, like autovacuum workers and bgworkers.
在PostgreSQL中,如果客戶端連接數超出max_connections參數設定的大小,會拒絕客戶端連接.
psql: FATAL: sorry, too many clients already
為了應對這種情況,PG 11或之前的版本提供了superuser_reserved_connections參數,為超級用戶(管理員)提供了連接的后門,但只是面向超級用戶而已,并沒有為復制用戶提供后門,如果超出最大連接數,那么復制需要連接時會出錯,導致HA環境的破壞.
為了確保HA環境的”HA”,在PG 12中,把復制連接所需要的資源單獨進行管理,不再與普通的客戶端連接(max_connections控制)共享同一個Array(ProcGlobal).同時,這個特性要求備機的max_wal_senders不能小于主機的max_wal_senders,否則可能會導致故障.
參考資料
Postgres 12 highlight - Connection slots and WAL senders
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。