回复:BUG #17695: Failed Assert in logical replication snapbuild.

From: 施博文 <zxwsbg(at)qq(dot)com>
To: zxwsbg <zxwsbg(at)qq(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: 回复:BUG #17695: Failed Assert in logical replication snapbuild.
Date: 2022-11-24 10:19:17
Message-ID: tencent_423DD739584911567442832E5AE5BAC92909@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

------------------&nbsp;原始邮件&nbsp;------------------
发件人: "zxwsbg" <noreply(at)postgresql(dot)org&gt;;
发送时间:&nbsp;2022年11月24日(星期四) 晚上6:15
收件人:&nbsp;"pgsql-bugs"<pgsql-bugs(at)lists(dot)postgresql(dot)org&gt;;
抄送:&nbsp;"施博文"<zxwsbg(at)qq(dot)com&gt;;
主题:&nbsp;BUG #17695: Failed Assert in logical replication snapbuild.

The following bug has been logged on the website:

Bug reference:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 17695
Logged by:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 施博文
Email address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zxwsbg(at)qq(dot)com
PostgreSQL version: 14.6
Operating system:&nbsp;&nbsp; centos
Description:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

In PG14 or higher version, I notice that SnapBuildRestore don't set
builder-&gt;next_phase_at=InvalidTransactionId .

But in SnapBuildSerialize function, the assert check this condition.

Assert(builder-&gt;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-&gt;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]

Attachment Content-Type Size
0001-Fix-builder-state-in-snapshot-restore-function.patch application/octet-stream 952 bytes
034_replication_snapbuild.pl application/octet-stream 2.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message vignesh C 2022-11-24 12:39:15 Re: BUG #17695: Failed Assert in logical replication snapbuild.
Previous Message PG Bug reporting form 2022-11-24 10:15:55 BUG #17695: Failed Assert in logical replication snapbuild.