pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: Peter Eisentraut <peter@eisentraut.org>
To: Andres Freund <andres@anarazel.de>
Cc: Aleksander Alekseev <aleksander@timescale.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: ResourceOwner refactoring
Date: Fri, 10 Nov 2023 12:00:00 +0300
Message-ID: <11b70743-c5f3-3910-8e5b-dd6c115ff829@gmail.com> (raw)
In-Reply-To: <d1bb4cfc-ce2b-4e20-bad7-7ae31c7b9cd0@iki.fi>
References: <CAOBaU_Z-NaqzAv=9YntFjbJhgWkJDAwCVyzvKUQTJ2UKgK4AOw@mail.gmail.com>
	<2e10b71b-352e-b97b-1e47-658e2669cecb@iki.fi>
	<20221101001523.lsgmohl6fjwppbgx@awork3.anarazel.de>
	<9a3245db-ca03-4a47-5706-73404cfe5108@iki.fi>
	<20221101154251.64vyq7wy6w7aykrn@awork3.anarazel.de>
	<bf88d2a9-a7bc-3d68-57e3-abfba87832e9@iki.fi>
	<CAJ7c6TNijrJ+0hnTiAPDBn-tCiJsk-yvpF3Y8rXG4gTw09JYbg@mail.gmail.com>
	<d17d4d6b-c39c-7e40-9f3d-b09f19e5ccec@iki.fi>
	<CAJ7c6TM_9XtQX6xAGkH2u2-b20z-1rii9szMdW-aMHJZC_NOsA@mail.gmail.com>
	<527af829-4a03-03b0-121c-46ff79c61887@iki.fi>
	<20230710191446.pn5ltm73t2i3xtxz@awork3.anarazel.de>
	<20607b96-b275-4a57-8509-29a3ed320d3f@iki.fi>
	<48b16f57-4204-4bd2-ab42-fb24144649c4@eisentraut.org>
	<bf814230-4172-47ce-a47c-6212ee6d298e@iki.fi>
	<9cb1277d-aee4-6511-44ee-7924676f7756@gmail.com>
	<599c6674-d40b-4b31-9251-c5c073ff9fdc@iki.fi>
	<be58d565-9e95-d417-4e47-f6bd408dea4b@gmail.com>
	<d1bb4cfc-ce2b-4e20-bad7-7ae31c7b9cd0@iki.fi>

Hello Heikki,

09.11.2023 02:48, Heikki Linnakangas wrote:
>
> Thanks for the testing! Fixed. ...

Thank you for the fix!

Please look at one more failure caused be the new implementation of
ResourceOwners:
numdbs=80
for ((i=1;i<=10;i++)); do
echo "ITERATION $i"

for ((d=1;d<=$numdbs;d++)); do createdb db$d; done

for ((d=1;d<=$numdbs;d++)); do
echo "
create table t(t1 text);
drop table t;
" | psql -d db$d >psql-$d.log 2>&1 &
done
wait
grep 'PANIC' server.log  && break;

for ((d=1;d<=$numdbs;d++)); do dropdb db$d; done
grep 'PANIC' server.log  && break;
done

I could see two failure modes:
2023-11-10 08:42:28.870 UTC [1163274] ERROR:  ResourceOwnerEnlarge called after release started
2023-11-10 08:42:28.870 UTC [1163274] STATEMENT:  drop table t;
2023-11-10 08:42:28.870 UTC [1163274] WARNING:  AbortTransaction while in COMMIT state
2023-11-10 08:42:28.870 UTC [1163274] PANIC:  cannot abort transaction 906, it was already committed

2023-11-10 08:43:27.897 UTC [1164148] ERROR:  ResourceOwnerEnlarge called after release started
2023-11-10 08:43:27.897 UTC [1164148] STATEMENT:  DROP DATABASE db69;
2023-11-10 08:43:27.897 UTC [1164148] WARNING:  AbortTransaction while in COMMIT state
2023-11-10 08:43:27.897 UTC [1164148] PANIC:  cannot abort transaction 1043, it was already committed

The stack trace for the second ERROR (ResourceOwnerEnlarge called ...) is:
...
#6  0x0000558af5b2f35c in ResourceOwnerEnlarge (owner=0x558af716f3c8) at resowner.c:455
#7  0x0000558af5888f18 in dsm_create_descriptor () at dsm.c:1207
#8  0x0000558af5889205 in dsm_attach (h=3172038420) at dsm.c:697
#9  0x0000558af5b1ebed in get_segment_by_index (area=0x558af711da18, index=2) at dsa.c:1764
#10 0x0000558af5b1ea4b in dsa_get_address (area=0x558af711da18, dp=2199023329568) at dsa.c:970
#11 0x0000558af5669366 in dshash_seq_next (status=0x7ffdd5912fd0) at dshash.c:687
#12 0x0000558af5901998 in pgstat_drop_database_and_contents (dboid=16444) at pgstat_shmem.c:830
#13 0x0000558af59016f0 in pgstat_drop_entry (kind=PGSTAT_KIND_DATABASE, dboid=16444, objoid=0) at pgstat_shmem.c:888
#14 0x0000558af59044eb in AtEOXact_PgStat_DroppedStats (xact_state=0x558af7111ee0, isCommit=true) at pgstat_xact.c:88
#15 0x0000558af59043c7 in AtEOXact_PgStat (isCommit=true, parallel=false) at pgstat_xact.c:55
#16 0x0000558af53c782e in CommitTransaction () at xact.c:2371
#17 0x0000558af53c709e in CommitTransactionCommand () at xact.c:306
...

Best regards,
Alexander





view thread (91+ messages)  latest in thread

Message-ID: <11b70743-c5f3-3910-8e5b-dd6c115ff829@gmail.com>
Permalink:  ../11b70743-c5f3-3910-8e5b-dd6c115ff829@gmail.com/
Also on:    postgresql.org/message-id/11b70743-c5f3-3910-8e5b-dd6c115ff829@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-hackers@postgresql.org
  Cc: exclusion@gmail.com, hlinnaka@iki.fi, peter@eisentraut.org, andres@anarazel.de, aleksander@timescale.com, rjuju123@gmail.com, robertmhaas@gmail.com
  Subject: Re: ResourceOwner refactoring
  In-Reply-To: <11b70743-c5f3-3910-8e5b-dd6c115ff829@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