Rename injection points used in AIO tests
authorMichael Paquier <michael@paquier.xyz>
Sat, 19 Apr 2025 09:53:35 +0000 (18:53 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 19 Apr 2025 09:53:35 +0000 (18:53 +0900)
The format of the injection point names used by the AIO code does not
match the existing naming convention used everywhere else in the code,
so let's be consistent.  These points are used in test_aio.

Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Discussion: https://postgr.es/m/Z_yTB80bdu1sYDqJ@paquier.xyz

src/backend/storage/aio/aio.c
src/backend/storage/aio/method_worker.c
src/test/modules/test_aio/test_aio.c

index 86f7250b7a5f21a6e7913284076c36f247779e55..64e8e81e18496b4b7755377eca6a7b2b70773a38 100644 (file)
@@ -507,7 +507,7 @@ pgaio_io_process_completion(PgAioHandle *ioh, int result)
 
    pgaio_io_update_state(ioh, PGAIO_HS_COMPLETED_IO);
 
-   pgaio_io_call_inj(ioh, "AIO_PROCESS_COMPLETION_BEFORE_SHARED");
+   pgaio_io_call_inj(ioh, "aio-process-completion-before-shared");
 
    pgaio_io_call_complete_shared(ioh);
 
index 8ad17ec1ef7393f788eefd15ae68570386cc7e56..0fde2a5b30daf4ac6330acb524ce208b47993b71 100644 (file)
@@ -525,7 +525,7 @@ IoWorkerMain(const void *startup_data, size_t startup_data_len)
             * To be able to exercise the reopen-fails path, allow injection
             * points to trigger a failure at this point.
             */
-           pgaio_io_call_inj(ioh, "AIO_WORKER_AFTER_REOPEN");
+           pgaio_io_call_inj(ioh, "aio-worker-after-reopen");
 
            error_errno = 0;
            error_ioh = NULL;
index 1d776010ef410242133fa7925fe0cb8fe4ff6bae..7745244b0e2471a1eb5855af8d4ae0a432a3c383 100644 (file)
@@ -86,19 +86,19 @@ test_aio_shmem_startup(void)
        inj_io_error_state->enabled_reopen = false;
 
 #ifdef USE_INJECTION_POINTS
-       InjectionPointAttach("AIO_PROCESS_COMPLETION_BEFORE_SHARED",
+       InjectionPointAttach("aio-process-completion-before-shared",
                             "test_aio",
                             "inj_io_short_read",
                             NULL,
                             0);
-       InjectionPointLoad("AIO_PROCESS_COMPLETION_BEFORE_SHARED");
+       InjectionPointLoad("aio-process-completion-before-shared");
 
-       InjectionPointAttach("AIO_WORKER_AFTER_REOPEN",
+       InjectionPointAttach("aio-worker-after-reopen",
                             "test_aio",
                             "inj_io_reopen",
                             NULL,
                             0);
-       InjectionPointLoad("AIO_WORKER_AFTER_REOPEN");
+       InjectionPointLoad("aio-worker-after-reopen");
 
 #endif
    }
@@ -109,8 +109,8 @@ test_aio_shmem_startup(void)
         * critical section.
         */
 #ifdef USE_INJECTION_POINTS
-       InjectionPointLoad("AIO_PROCESS_COMPLETION_BEFORE_SHARED");
-       InjectionPointLoad("AIO_WORKER_AFTER_REOPEN");
+       InjectionPointLoad("aio-process-completion-before-shared");
+       InjectionPointLoad("aio-worker-after-reopen");
        elog(LOG, "injection point loaded");
 #endif
    }