原 PG做任意DML操作均卡住,等待事件为SyncRep,类型为IPC
Tags: 原创PGPostgreSQL等待事件SyncRep
现象
某个PG 14的库,做任意DML操作均卡住,查看等待事件为SyncRep,类型为IPC
该等待事件表示同步复制时等待远程服务确认。
分析
查看告警日志,报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 2024-05-04 22:08:35.221 CST [5698] ERROR: requested WAL segment 000000010000003D0000004E has already been removed 2024-05-04 22:08:35.221 CST [5698] STATEMENT: START_REPLICATION 3D/4E000000 TIMELINE 1 2024-05-04 22:08:40.227 CST [5700] ERROR: requested WAL segment 000000010000003D0000004E has already been removed 2024-05-04 22:08:40.227 CST [5700] STATEMENT: START_REPLICATION 3D/4E000000 TIMELINE 1 2024-05-04 22:08:45.229 CST [5701] ERROR: requested WAL segment 000000010000003D0000004E has already been removed 2024-05-04 22:08:45.229 CST [5701] STATEMENT: START_REPLICATION 3D/4E000000 TIMELINE 1 2024-05-04 22:08:50.234 CST [5703] ERROR: requested WAL segment 000000010000003D0000004E has already been removed 2024-05-04 22:08:50.234 CST [5703] STATEMENT: START_REPLICATION 3D/4E000000 TIMELINE 1 2024-05-04 22:08:55.241 CST [5704] ERROR: requested WAL segment 000000010000003D0000004E has already been removed 2024-05-04 22:08:55.241 CST [5704] STATEMENT: START_REPLICATION 3D/4E000000 TIMELINE 1 2024-05-04 23:02:33.060 CST [55] FATAL: number of requested standby connections exceeds max_wal_senders (currently 0) 2024-05-04 23:02:38.067 CST [56] FATAL: number of requested standby connections exceeds max_wal_senders (currently 0) |
分析相关同步复制参数,发现并没有从库,但是开启了归档模式。