1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-19 17:02:53 +03:00

aio: Use runtime arguments with injections points in tests

This cleans up the code related to the testing infrastructure of AIO
that used injection points, switching the test code to use the new
facility for injection points added by 371f2db8b0 rather than tweaks
to pass and reset arguments to the callbacks run.

This removes all the dependencies to USE_INJECTION_POINTS in the AIO
code.  pgaio_io_call_inj(), pgaio_inj_io_get() and pgaio_inj_cur_handle
are now gone.

Reviewed-by: Greg Burd <greg@burd.me>
Discussion: https://postgr.es/m/Z_y9TtnXubvYAApS@paquier.xyz
This commit is contained in:
Michael Paquier
2025-05-10 12:36:57 +09:00
parent 36e5fda632
commit c259ba881c
4 changed files with 5 additions and 80 deletions

View File

@@ -684,7 +684,7 @@ extern PGDLLEXPORT void inj_io_reopen(const char *name,
void
inj_io_short_read(const char *name, const void *private_data, void *arg)
{
PgAioHandle *ioh;
PgAioHandle *ioh = (PgAioHandle *) arg;
ereport(LOG,
errmsg("short read injection point called, is enabled: %d",
@@ -693,8 +693,6 @@ inj_io_short_read(const char *name, const void *private_data, void *arg)
if (inj_io_error_state->enabled_short_read)
{
ioh = pgaio_inj_io_get();
/*
* Only shorten reads that are actually longer than the target size,
* otherwise we can trigger over-reads.