Re: DROP DATABASE is interruptible
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2023-06-22T02:38:17Z
Lists: pgsql-hackers
Hi, On 2023-05-09 15:41:36 +1200, Thomas Munro wrote: > +# FIXME: It'd be good to test the actual interruption path. But it's not > +# immediately obvious how. > > I wonder if there is some way to incorporate something based on > SIGSTOP signals into the test, but I don't know how to do it on > Windows and maybe that's a bit weird anyway. For a non-OS-specific > way to do it, I was wondering about having a test module function that > has a wait loop that accepts ^C but deliberately ignores > ProcSignalBarrier, and leaving that running in a background psql for a > similar effect? I found a way to test it reliably, albeit partially. However, I'm not sure where to do so / if it's worth doing so. The problem occurs once remove_dbtablespaces() starts working. The fix does a heap_inplace_update() before that. So to reproduce the problem one session can lock pg_tablespace, another can drop a database. Then the second session can be cancelled by the first. Waiting for locks to be acquired etc is somewhat cumbersome in a tap test. It'd be easier in an isolation test. But I don't think we want to do this as part of the normal isolation schedule? So just open coding it in a tap test seems to be the best way? Is it worth doing? Greetings, Andres Freund
Commits
-
pg_dump: tests: Correct test condition for invalid databases
- 881defde944c 16.1 landed
- 6a3b19bbefd7 11.22 landed
- fd7a114dbb4e 12.17 landed
- d1c76fdec375 13.13 landed
- 4dfb610822d5 14.10 landed
- 9dc3c5472ed9 15.5 landed
- 849d367ff9a2 17.0 landed
-
Handle DROP DATABASE getting interrupted
- f66403749df7 15.4 landed
- 1c38e7ae17b6 11.21 landed
- 034a9fcd2bb8 12.16 landed
- 81ce000067e3 13.12 landed
- d11efe830385 14.9 landed
- a4b4cc1d60f7 16.0 landed
- c66a7d75e652 17.0 landed