Re: pg13: xlogreader API adjust
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, "ah@cybertec.at" <ah@cybertec.at>, "andres@anarazel.de" <andres@anarazel.de>
Date: 2020-05-14T01:03:48Z
Lists: pgsql-hackers
I think I've discovered a problem with 850196b6. The following steps
can be used to trigger a segfault:
# wal_level = logical
psql postgres -c "create database testdb;"
psql testdb -c "select pg_create_logical_replication_slot('slot', 'test_decoding');"
psql "dbname=postgres replication=database" -c "START_REPLICATION SLOT slot LOGICAL 0/0;"
From a quick glance, I think the problem starts in
StartLogicalReplication() in walsender.c. The call to
CreateDecodingContext() may ERROR before xlogreader is initialized in
the next line, so the subsequent call to WalSndErrorCleanup()
segfaults when it attempts to access xlogreader.
Nathan
Commits
-
Fix walsender error cleanup code
- 1d3743023ef8 13.0 landed
-
Adjust walsender usage of xlogreader, simplify APIs
- 850196b610d2 13.0 landed