pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Melanie Plageman <melanieplageman@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17821: Assertion failed in heap_update() due to heap pruning
Date: Tue, 9 Apr 2024 22:00:00 +0300
Message-ID: <53a0f263-bece-bc96-e016-1690628a9980@gmail.com> (raw)
In-Reply-To: <CAAKRu_bWz0KhTKW3SzetvhZL3gpsnyekB2WFCn-MO4aCx=37=g@mail.gmail.com>
References: <17821-dd8c334263399284@postgresql.org>
	<13d30799-0107-6502-c81c-39ff5f1e7eb0@gmail.com>
	<BEB9A06A-3B05-41DC-AEE4-AD3DC4AD67E5@anarazel.de>
	<25c3399b-58a3-d727-7f97-93394fd1afa9@gmail.com>
	<2a203fd8-e9c8-5f5d-40f8-707848905a1a@gmail.com>
	<CAAKRu_bWz0KhTKW3SzetvhZL3gpsnyekB2WFCn-MO4aCx=37=g@mail.gmail.com>

Hi Melanie,

09.04.2024 20:41, Melanie Plageman wrote:
> Just to confirm, the original bug was filed against 15, but I see
> ad98fb142 was committed on master as well as backpatched. You are able
> to reproduce  your pg_subscription example on master? I tried your
> repro (including the modification to minfree) and wasn't able to
> reproduce on master on my machine. This could totally be my fault, but
> I just wanted to confirm you were able to repro on master.
>

Yes, I reproduced both cases on master (27074bce0).
Please look at the self-contained script that works for me:
.../repro-17821-SUBSCRIPTION.sh
...
CREATE ROLE
WARNING:  subscription was created, but is not connected
HINT:  To initiate replication, you must manually create the replication slot, enable the subscription, and refresh the 
subscription.
CREATE SUBSCRIPTION
iteration 1
iteration 2
iteration 3
TRAP: failed Assert("ItemIdIsNormal(lp)"), File: "heapam.c", Line: 3296, PID: 1069025
TRAP: failed Assert("ItemIdIsNormal(lp)"), File: "heapam.c", Line: 3296, PID: 1069621

Best regards,
Alexander
sed 's/minfree = Max(minfree, BLCKSZ \/ 10)/minfree = Max(minfree, BLCKSZ \/1)/' -i src/backend/access/heap/pruneheap.c
./configure --enable-debug --enable-cassert -q && make -j8 -s && TESTS=test_setup make -s check-tests

PGROOT=`pwd`/tmp_install/usr/local/pgsql
export PGDATA=`pwd`/tmpdb

export PATH="$PGROOT/bin:$PATH"
export LD_LIBRARY_PATH="$PGROOT/lib"

[ -f "$PGDATA/postmaster.pid" ] && pg_ctl stop -m immediate

rm *.log
rm -rf "$PGDATA"; initdb >initdb.log 2>&1

export PGPORT=15431
echo "
fsync=off
port=$PGPORT
" >> $PGDATA/postgresql.auto.conf

ulimit -c unlimited
pg_ctl -l server.log start
createdb regression
export PGDATABASE=regression
export PGHOST=127.0.0.1

res=0

echo "
CREATE ROLE su SUPERUSER;
CREATE SUBSCRIPTION sub CONNECTION 'dbname=nonexisting'
  PUBLICATION pub WITH (connect = false);
" | psql

for ((i=1;i<=20;i++)); do
  echo "iteration $i"

  for ((k=1;k<=100;k++)); do
    for ((j=1;j<=200;j++)); do echo "
ALTER SUBSCRIPTION sub SET (synchronous_commit = false);
    "; done | psql >/dev/null 2>&1 &
 
    for ((j=1;j<=200;j++)); do echo "
ALTER SUBSCRIPTION sub OWNER TO su;
ALTER SUBSCRIPTION sub SET (slot_name = NONE);
    "; done | psql >/dev/null 2>&1 &
    wait
  done

grep 'TRAP:' server.log && break;
done

pg_ctl -w -t 5 stop || pg_ctl stop -m immediate


Attachments:

repro-17821-SUBSCRIPTION.sh.txt (text/plain, 1.3K) download sed 's/minfree = Max(minfree, BLCKSZ \/ 10)/minfree = Max(minfree, BLCKSZ \/1)/' -i src/backend/access/heap/pruneheap.c ./configure --enable-debug --enable-cassert -q && make -j8 -s && TESTS=test_setup make -s check-tests PGROOT=`pwd`/tmp_install/usr/local/pgsql export PGDATA=`pwd`/tmpdb export PATH="$PGROOT/bin:$PATH" export LD_LIBRARY_PATH="$PGROOT/lib" [ -f "$PGDATA/postmaster.pid" ] && pg_ctl stop -m immediate rm *.log rm -rf "$PGDATA"; initdb >initdb.log 2>&1 export PGPORT=15431 echo " fsync=off port=$PGPORT " >> $PGDATA/postgresql.auto.conf ulimit -c unlimited pg_ctl -l server.log start createdb regression export PGDATABASE=regression export PGHOST=127.0.0.1 res=0 echo " CREATE ROLE su SUPERUSER; CREATE SUBSCRIPTION sub CONNECTION 'dbname=nonexisting' PUBLICATION pub WITH (connect = false); " | psql for ((i=1;i<=20;i++)); do echo "iteration $i" for ((k=1;k<=100;k++)); do for ((j=1;j<=200;j++)); do echo " ALTER SUBSCRIPTION sub SET (synchronous_commit = false); "; done | psql >/dev/null 2>&1 & for ((j=1;j<=200;j++)); do echo " ALTER SUBSCRIPTION sub OWNER TO su; ALTER SUBSCRIPTION sub SET (slot_name = NONE); "; done | psql >/dev/null 2>&1 & wait done grep 'TRAP:' server.log && break; done pg_ctl -w -t 5 stop || pg_ctl stop -m immediate

view thread (13+ messages)  latest in thread

Message-ID: <53a0f263-bece-bc96-e016-1690628a9980@gmail.com>
Permalink:  ../53a0f263-bece-bc96-e016-1690628a9980@gmail.com/
Also on:    postgresql.org/message-id/53a0f263-bece-bc96-e016-1690628a9980@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: exclusion@gmail.com, melanieplageman@gmail.com, hlinnaka@iki.fi, andres@anarazel.de, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17821: Assertion failed in heap_update() due to heap pruning
  In-Reply-To: <53a0f263-bece-bc96-e016-1690628a9980@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox