回复:BUG #17695: Failed Assert in logical replication snapbuild.
zxwsbg <zxwsbg@qq.com>
From: 施博文 <zxwsbg@qq.com>
To: zxwsbg <zxwsbg@qq.com>, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2022-11-24T10:19:17Z
Lists: pgsql-bugs
Attachments
- 0001-Fix-builder-state-in-snapshot-restore-function.patch (application/octet-stream) patch 0001
- 034_replication_snapbuild.pl (application/octet-stream)
I write this perl test case to reproduce problem, it needs both superuser and database name 'postgres'.
Also, I write the patch to fix that problem.
Thanks.
------------------ 原始邮件 ------------------
发件人: "zxwsbg" <noreply@postgresql.org>;
发送时间: 2022年11月24日(星期四) 晚上6:15
收件人: "pgsql-bugs"<pgsql-bugs@lists.postgresql.org>;
抄送: "施博文"<zxwsbg@qq.com>;
主题: BUG #17695: Failed Assert in logical replication snapbuild.
The following bug has been logged on the website:
Bug reference: 17695
Logged by: 施博文
Email address: zxwsbg@qq.com
PostgreSQL version: 14.6
Operating system: centos
Description:
In PG14 or higher version, I notice that SnapBuildRestore don't set
builder->next_phase_at=InvalidTransactionId .
But in SnapBuildSerialize function, the assert check this condition.
Assert(builder->next_phase_at == InvalidTransactionId);
This would cause some problems, and I have repeat it with the perl test case
which I would update later, the problem is following:
TRAP: FailedAssertion("builder->next_phase_at == InvalidTransactionId",
File: "snapbuild.c", Line: 1604, PID: 29974)
postgres: master: walsender postgres [local]
START_REPLICATION(ExceptionalCondition+0xb9)[0xb1c9bd]
postgres: master: walsender postgres [local] START_REPLICATION[0x8f548d]
postgres: master: walsender postgres [local]
START_REPLICATION(SnapBuildProcessRunningXacts+0x55)[0x8f4c5c]
postgres: master: walsender postgres [local] START_REPLICATION[0x8dd8be]
postgres: master: walsender postgres [local]
START_REPLICATION(LogicalDecodingProcessRecord+0xd1)[0x8dd243]
postgres: master: walsender postgres [local] START_REPLICATION[0x915eb1]
postgres: master: walsender postgres [local] START_REPLICATION[0x91520c]
postgres: master: walsender postgres [local] START_REPLICATION[0x913bdd]
postgres: master: walsender postgres [local]
START_REPLICATION(exec_replication_command+0x42c)[0x914593]
postgres: master: walsender postgres [local]
START_REPLICATION(PostgresMain+0x7be)[0x984ddf]
postgres: master: walsender postgres [local] START_REPLICATION[0x8c0d41]
postgres: master: walsender postgres [local] START_REPLICATION[0x8c06b3]
postgres: master: walsender postgres [local] START_REPLICATION[0x8bc9c4]
postgres: master: walsender postgres [local]
START_REPLICATION(PostmasterMain+0x117a)[0x8bc29b]
postgres: master: walsender postgres [local] START_REPLICATION[0x7bdaf9]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f815dd92555]
postgres: master: walsender postgres [local] START_REPLICATION[0x488d09]
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix assertion failure in snapshot building
- 0f404c581247 15.13 landed
- 7be51eb4e169 14.18 landed
- eb27d3dc8887 16.0 landed
- 48efb2302bea 17.0 landed
-
Fix perl warning from commit 9b4eafcaf4
- c93254424f28 14.7 cited