PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/relation.h"
#include "fmgr.h"
#include "storage/aio.h"
#include "storage/aio_internal.h"
#include "storage/buf_internals.h"
#include "storage/bufmgr.h"
#include "storage/checksum.h"
#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "utils/builtins.h"
#include "utils/injection_point.h"
#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
struct | InjIoErrorState |
Macros | |
#define | MAX_BUFFERS_TO_EXTEND_BY 64 |
Typedefs | |
typedef struct InjIoErrorState | InjIoErrorState |
Variables | |
PG_MODULE_MAGIC | |
static InjIoErrorState * | inj_io_error_state |
static shmem_request_hook_type | prev_shmem_request_hook = NULL |
static shmem_startup_hook_type | prev_shmem_startup_hook = NULL |
static PgAioHandle * | last_handle |
#define MAX_BUFFERS_TO_EXTEND_BY 64 |
typedef struct InjIoErrorState InjIoErrorState |
void _PG_init | ( | void | ) |
Definition at line 122 of file test_aio.c.
References prev_shmem_request_hook, prev_shmem_startup_hook, process_shared_preload_libraries_in_progress, shmem_request_hook, shmem_startup_hook, test_aio_shmem_request(), and test_aio_shmem_startup().
Datum batch_end | ( | PG_FUNCTION_ARGS | ) |
Definition at line 670 of file test_aio.c.
References PG_RETURN_VOID, and pgaio_exit_batchmode().
Datum batch_start | ( | PG_FUNCTION_ARGS | ) |
Definition at line 662 of file test_aio.c.
References PG_RETURN_VOID, and pgaio_enter_batchmode().
Referenced by log_newpages().
Datum buffer_call_start_io | ( | PG_FUNCTION_ARGS | ) |
Definition at line 529 of file test_aio.c.
References buf, BufferIsLocal, CurrentResourceOwner, DebugPrintBufferRefcount(), ereport, errhidecontext(), errhidestmt(), errmsg(), GetBufferDescriptor(), GetLocalBufferDescriptor(), LOG, PG_GETARG_BOOL, PG_GETARG_INT32, PG_RETURN_BOOL, ResourceOwnerForgetBufferIO(), StartBufferIO(), and StartLocalBufferIO().
Datum buffer_call_terminate_io | ( | PG_FUNCTION_ARGS | ) |
Definition at line 561 of file test_aio.c.
References BM_IO_ERROR, BM_VALID, buf, BufferIsLocal, DebugPrintBufferRefcount(), ereport, errhidecontext(), errhidestmt(), errmsg(), GetBufferDescriptor(), GetLocalBufferDescriptor(), LOG, PG_GETARG_BOOL, PG_GETARG_INT32, PG_RETURN_VOID, TerminateBufferIO(), and TerminateLocalBufferIO().
Datum buffer_create_toy | ( | PG_FUNCTION_ARGS | ) |
Definition at line 510 of file test_aio.c.
References AccessExclusiveLock, buf, create_toy_buffer(), NoLock, PG_GETARG_OID, PG_GETARG_UINT32, PG_RETURN_INT32, relation_close(), relation_open(), and ReleaseBuffer().
|
static |
Definition at line 307 of file test_aio.c.
References BM_DIRTY, BM_VALID, buf, BUF_STATE_GET_REFCOUNT, BUFFER_LOCK_UNLOCK, elog, ERROR, GetBufferDescriptor(), GetLocalBufferDescriptor(), LockBuffer(), LockBufHdr(), MAIN_FORKNUM, pg_atomic_read_u32(), pg_atomic_unlocked_write_u32(), RBM_ZERO_AND_LOCK, ReadBufferExtended(), RelationUsesLocalBuffers, BufferDesc::state, and UnlockBufHdr().
Referenced by buffer_create_toy(), and read_rel_block_ll().
Datum errno_from_string | ( | PG_FUNCTION_ARGS | ) |
Definition at line 136 of file test_aio.c.
References EAGAIN, EINTR, ereport, errcode(), errmsg_internal(), ERROR, PG_GETARG_TEXT_PP, PG_RETURN_INT32, and text_to_cstring().
Datum grow_rel | ( | PG_FUNCTION_ARGS | ) |
Definition at line 159 of file test_aio.c.
References AccessExclusiveLock, BMR_REL, ExtendBufferedRelBy(), i, MAIN_FORKNUM, MAX_BUFFERS_TO_EXTEND_BY, Min, NoLock, PG_GETARG_OID, PG_GETARG_UINT32, PG_RETURN_VOID, relation_close(), relation_open(), and ReleaseBuffer().
Datum handle_get | ( | PG_FUNCTION_ARGS | ) |
Definition at line 609 of file test_aio.c.
References CurrentResourceOwner, last_handle, PG_RETURN_VOID, and pgaio_io_acquire().
Datum handle_get_and_error | ( | PG_FUNCTION_ARGS | ) |
Definition at line 630 of file test_aio.c.
References CurrentResourceOwner, elog, ERROR, PG_RETURN_VOID, and pgaio_io_acquire().
Datum handle_get_release | ( | PG_FUNCTION_ARGS | ) |
Definition at line 650 of file test_aio.c.
References CurrentResourceOwner, PG_RETURN_VOID, pgaio_io_acquire(), and pgaio_io_release().
Datum handle_get_twice | ( | PG_FUNCTION_ARGS | ) |
Definition at line 640 of file test_aio.c.
References CurrentResourceOwner, PG_RETURN_VOID, and pgaio_io_acquire().
Datum handle_release_last | ( | PG_FUNCTION_ARGS | ) |
Definition at line 618 of file test_aio.c.
References elog, ERROR, last_handle, PG_RETURN_VOID, and pgaio_io_release().
Datum inj_io_reopen_attach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 787 of file test_aio.c.
References elog, InjIoErrorState::enabled_reopen, ERROR, inj_io_error_state, and PG_RETURN_VOID.
Datum inj_io_reopen_detach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 800 of file test_aio.c.
References elog, InjIoErrorState::enabled_reopen, ERROR, inj_io_error_state, and PG_RETURN_VOID.
Datum inj_io_short_read_attach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 759 of file test_aio.c.
References elog, InjIoErrorState::enabled_short_read, ERROR, inj_io_error_state, PG_ARGISNULL, PG_GETARG_INT32, PG_RETURN_VOID, InjIoErrorState::short_read_result, and InjIoErrorState::short_read_result_set.
Datum inj_io_short_read_detach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 775 of file test_aio.c.
References elog, InjIoErrorState::enabled_short_read, ERROR, inj_io_error_state, and PG_RETURN_VOID.
Datum invalidate_rel_block | ( | PG_FUNCTION_ARGS | ) |
Definition at line 457 of file test_aio.c.
References AccessExclusiveLock, BM_DIRTY, buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferIsLocal, BufferIsValid(), elog, ERROR, EvictUnpinnedBuffer(), FlushLocalBuffer(), FlushOneBuffer(), GetBufferDescriptor(), GetLocalBufferDescriptor(), InvalidateLocalBuffer(), LockBuffer(), MAIN_FORKNUM, pg_atomic_read_u32(), PG_GETARG_OID, PG_GETARG_UINT32, PG_RETURN_VOID, PrefetchBuffer(), RelationData::rd_locator, ReadRecentBuffer(), PrefetchBufferResult::recent_buffer, relation_close(), relation_open(), ReleaseBuffer(), and BufferDesc::state.
Datum modify_rel_block | ( | PG_FUNCTION_ARGS | ) |
Definition at line 198 of file test_aio.c.
References AccessExclusiveLock, buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetPage(), BufferGetPageSize(), BufferIsLocal, elog, ERROR, EvictUnpinnedBuffer(), GetLocalBufferDescriptor(), i, InvalidateLocalBuffer(), LockBuffer(), LOG, MAIN_FORKNUM, NoLock, PageInit(), PageIsEmpty(), PageSetChecksumInplace(), palloc_aligned(), PageHeaderData::pd_checksum, PageHeaderData::pd_special, pg_checksum_page(), PG_GETARG_BOOL, PG_GETARG_OID, PG_GETARG_UINT32, PG_IO_ALIGN_SIZE, PG_RETURN_VOID, RBM_ZERO_ON_ERROR, ReadBufferExtended(), relation_close(), relation_open(), RelationGetSmgr(), ReleaseBuffer(), and smgrwrite().
PG_FUNCTION_INFO_V1 | ( | batch_end | ) |
PG_FUNCTION_INFO_V1 | ( | batch_start | ) |
PG_FUNCTION_INFO_V1 | ( | buffer_call_start_io | ) |
PG_FUNCTION_INFO_V1 | ( | buffer_call_terminate_io | ) |
PG_FUNCTION_INFO_V1 | ( | buffer_create_toy | ) |
PG_FUNCTION_INFO_V1 | ( | errno_from_string | ) |
PG_FUNCTION_INFO_V1 | ( | grow_rel | ) |
PG_FUNCTION_INFO_V1 | ( | handle_get | ) |
PG_FUNCTION_INFO_V1 | ( | handle_get_and_error | ) |
PG_FUNCTION_INFO_V1 | ( | handle_get_release | ) |
PG_FUNCTION_INFO_V1 | ( | handle_get_twice | ) |
PG_FUNCTION_INFO_V1 | ( | handle_release_last | ) |
PG_FUNCTION_INFO_V1 | ( | inj_io_reopen_attach | ) |
PG_FUNCTION_INFO_V1 | ( | inj_io_reopen_detach | ) |
PG_FUNCTION_INFO_V1 | ( | inj_io_short_read_attach | ) |
PG_FUNCTION_INFO_V1 | ( | inj_io_short_read_detach | ) |
PG_FUNCTION_INFO_V1 | ( | invalidate_rel_block | ) |
PG_FUNCTION_INFO_V1 | ( | modify_rel_block | ) |
PG_FUNCTION_INFO_V1 | ( | read_rel_block_ll | ) |
Datum read_rel_block_ll | ( | PG_FUNCTION_ARGS | ) |
Definition at line 358 of file test_aio.c.
References AccessExclusiveLock, BufferGetBlock(), BufferIsLocal, create_toy_buffer(), CurrentResourceOwner, RelFileLocator::dbOid, elog, ERROR, GetBufferDescriptor(), GetLocalBufferDescriptor(), i, ignore_checksum_failure, RelFileLocatorBackend::locator, MAIN_FORKNUM, NoLock, PG_GETARG_BOOL, PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_UINT32, PG_IOV_MAX, PG_RETURN_VOID, pgaio_enter_batchmode(), pgaio_exit_batchmode(), PGAIO_HCB_LOCAL_BUFFER_READV, PGAIO_HCB_SHARED_BUFFER_READV, PGAIO_HF_REFERENCES_LOCAL, pgaio_io_acquire(), pgaio_io_get_wref(), pgaio_io_register_callbacks(), pgaio_io_set_flag(), pgaio_io_set_handle_data_32(), pgaio_result_report(), PGAIO_RS_ERROR, PGAIO_RS_OK, pgaio_wref_wait(), pgstat_prepare_report_checksum_failure(), READ_BUFFERS_IGNORE_CHECKSUM_FAILURES, READ_BUFFERS_ZERO_ON_ERROR, relation_close(), relation_open(), RelationGetSmgr(), RelationUsesLocalBuffers, ReleaseBuffer(), PgAioReturn::result, SMgrRelationData::smgr_rlocator, smgrreleaseall(), smgrstartreadv(), StartBufferIO(), StartLocalBufferIO(), PgAioResult::status, PgAioReturn::target_data, WARNING, and zero_damaged_pages.
|
static |
Definition at line 59 of file test_aio.c.
References prev_shmem_request_hook, and RequestAddinShmemSpace().
Referenced by _PG_init().
|
static |
Definition at line 68 of file test_aio.c.
References elog, InjIoErrorState::enabled_reopen, InjIoErrorState::enabled_short_read, inj_io_error_state, InjectionPointAttach(), InjectionPointLoad(), LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), prev_shmem_startup_hook, and ShmemInitStruct().
Referenced by _PG_init().
|
static |
Definition at line 47 of file test_aio.c.
Referenced by inj_io_reopen_attach(), inj_io_reopen_detach(), inj_io_short_read_attach(), inj_io_short_read_detach(), and test_aio_shmem_startup().
|
static |
Definition at line 54 of file test_aio.c.
Referenced by handle_get(), and handle_release_last().
PG_MODULE_MAGIC |
Definition at line 35 of file test_aio.c.
|
static |
Definition at line 50 of file test_aio.c.
Referenced by _PG_init(), and test_aio_shmem_request().
|
static |
Definition at line 51 of file test_aio.c.
Referenced by _PG_init(), and test_aio_shmem_startup().