Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
shveta malik <shveta.malik@gmail.com>
From: shveta malik <shveta.malik@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>,
Amit Kapila <amit.kapila16@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>,
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
shveta malik <shveta.malik@gmail.com>
Date: 2025-11-14T09:25:20Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix regression test failure when wal_level is set to minimal.
- 0de5f0d869d1 19 (unreleased) landed
-
Toggle logical decoding dynamically based on logical slot presence.
- 67c20979ce72 19 (unreleased) landed
-
Disallow server start with sync_replication_slots = on and wal_level < logical.
- 12da45742cfd 19 (unreleased) cited
In an offline discussion with Kuroda-san, we realized that TRUNCATE
may hit Assert(XLogLogicalInfoActive()) in ExecuteTruncateGuts() under
our current implementation, where logical decoding is disabled lazily.
Consider the case where there’s only one logical slot and we attempt
to drop it. The backend issues the drop request, but before the
checkpointer actually disables logical decoding, a TRUNCATE is
executed. Since logical decoding is still marked as active at that
moment, the ExecuteTruncate() appends the OID to relids_logged.
However, by the time control reaches ExecuteTruncateGuts, the
checkpointer has already disabled logical decoding resulting in
Assert.
TRAP: failed Assert("XLogLogicalInfoActive()"), File: "tablecmds.c",
Line: 2298, PID: 16477
[local] TRUNCATE TABLE(ExceptionalCondition+0xbb)[0x5bc368d9c1fa]
[local] TRUNCATE TABLE(ExecuteTruncateGuts+0xc85)[0x5bc368806c5d]
thanks
Shveta