Re: isolation tester limitation in case of multiple injection points in a single command
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-20T00:50:53Z
Lists: pgsql-hackers
On Sun, Oct 19, 2025 at 03:41:00PM +0200, Mihail Nikalayeu wrote: > Hello, everyone! > > While stabilizing tests for [0] I realized I have no idea how to set > up a pretty simple scenario using an isolation tester. > > It looks like this: > * session S1 start long running query (CREATE INDEX CONCURRENTLY) and > traps into injection point X > * session S2 executes some command > * session S2 wakes up S1 > * now S2 needs to run one more command BUT only AFTER S1 traps into > another injection point Y (and it is still the same CREATE INDEX) > <------- tricky part here Ah, OK. So you want to have one single command, still wait through two injection points inside it. I am wondering about one thing: do you really require that? Could it be simpler to have two permutations, each one of them using one wait point to check your two scenarios? > So, my proposal options: > a) tell me if there's a clear solution I missed > b) for 'wait' injection_point - learn isolation tester to detect it > and implement logic like 'S2_query(S1 traps Y)' > c) learn isolation tester to treat 'notice' from injection_point the > same way as RAISE NOTICE + (preferable) add possibility to > apply 'notice' and 'wait' for the same injection point (like > 'wait+notice') > d) add injection_point_await - utility to wait until injected point is not > "waited" by some backend > > What do you think? Any other ideas? Something close to what you are suggested in b), that can be defined in the specs, sounds like a natural solution to me. It also feels like a better approach from the spec's reader perspective, as well: this would document multiple wait steps in the test itself. -- Michael
Commits
-
Improve test case stability
- 417ac9c1eeeb 19 (unreleased) landed
-
injection_points: Add injection_points_list()
- 4eca711bc991 19 (unreleased) cited
-
Add InjectionPointList() to retrieve list of injection points
- 7b2eb72b1b8c 19 (unreleased) cited