PostgreSQL Source Code git master
Loading...
Searching...
No Matches
test_checksums.c File Reference
#include "postgres.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "postmaster/datachecksum_state.h"
#include "storage/latch.h"
#include "utils/injection_point.h"
#include "utils/wait_event.h"
Include dependency graph for test_checksums.c:

Go to the source code of this file.

Functions

PGDLLEXPORT void dc_delay_barrier (const char *name, const void *private_data, void *arg)
 
PGDLLEXPORT void dc_modify_db_result (const char *name, const void *private_data, void *arg)
 
PGDLLEXPORT void dc_fake_temptable (const char *name, const void *private_data, void *arg)
 
 PG_FUNCTION_INFO_V1 (dcw_inject_delay_barrier)
 
Datum dcw_inject_delay_barrier (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (dcw_inject_launcher_delay)
 
Datum dcw_inject_launcher_delay (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (dcw_inject_startup_delay)
 
Datum dcw_inject_startup_delay (PG_FUNCTION_ARGS)
 

Variables

 PG_MODULE_MAGIC
 

Function Documentation

◆ dc_delay_barrier()

void dc_delay_barrier ( const char name,
const void private_data,
void arg 
)
extern

Definition at line 32 of file test_checksums.c.

33{
34 (void) name;
35 (void) private_data;
36
39 (3 * 1000),
41}
struct Latch * MyLatch
Definition globals.c:65
int WaitLatch(Latch *latch, int wakeEvents, long timeout, uint32 wait_event_info)
Definition latch.c:172
static int fb(int x)
const char * name
#define WL_TIMEOUT
#define WL_EXIT_ON_PM_DEATH
#define WL_LATCH_SET

References fb(), MyLatch, name, WaitLatch(), WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, and WL_TIMEOUT.

◆ dc_fake_temptable()

PGDLLEXPORT void dc_fake_temptable ( const char name,
const void private_data,
void arg 
)
extern

◆ dc_modify_db_result()

PGDLLEXPORT void dc_modify_db_result ( const char name,
const void private_data,
void arg 
)
extern

◆ dcw_inject_delay_barrier()

Datum dcw_inject_delay_barrier ( PG_FUNCTION_ARGS  )

Definition at line 45 of file test_checksums.c.

46{
47#ifdef USE_INJECTION_POINTS
48 bool attach = PG_GETARG_BOOL(0);
49
50 if (attach)
51 InjectionPointAttach("datachecksums-enable-checksums-delay",
52 "test_checksums",
53 "dc_delay_barrier",
54 NULL,
55 0);
56 else
57 InjectionPointDetach("datachecksums-enable-checksums-delay");
58#else
59 elog(ERROR,
60 "test is not working as intended when injection points are disabled");
61#endif
63}
#define ERROR
Definition elog.h:40
#define elog(elevel,...)
Definition elog.h:228
#define PG_RETURN_VOID()
Definition fmgr.h:350
#define PG_GETARG_BOOL(n)
Definition fmgr.h:274
bool InjectionPointDetach(const char *name)
void InjectionPointAttach(const char *name, const char *library, const char *function, const void *private_data, int private_data_size)

References elog, ERROR, fb(), InjectionPointAttach(), InjectionPointDetach(), PG_GETARG_BOOL, and PG_RETURN_VOID.

◆ dcw_inject_launcher_delay()

Datum dcw_inject_launcher_delay ( PG_FUNCTION_ARGS  )

Definition at line 67 of file test_checksums.c.

68{
69#ifdef USE_INJECTION_POINTS
70 bool attach = PG_GETARG_BOOL(0);
71
72 if (attach)
73 InjectionPointAttach("datachecksumsworker-launcher-delay",
74 "test_checksums",
75 "dc_delay_barrier",
76 NULL,
77 0);
78 else
79 InjectionPointDetach("datachecksumsworker-launcher-delay");
80#else
81 elog(ERROR,
82 "test is not working as intended when injection points are disabled");
83#endif
85}

References elog, ERROR, fb(), InjectionPointAttach(), InjectionPointDetach(), PG_GETARG_BOOL, and PG_RETURN_VOID.

◆ dcw_inject_startup_delay()

Datum dcw_inject_startup_delay ( PG_FUNCTION_ARGS  )

Definition at line 89 of file test_checksums.c.

90{
91#ifdef USE_INJECTION_POINTS
92 bool attach = PG_GETARG_BOOL(0);
93
94 if (attach)
95 InjectionPointAttach("datachecksumsworker-startup-delay",
96 "test_checksums",
97 "dc_delay_barrier",
98 NULL,
99 0);
100 else
101 InjectionPointDetach("datachecksumsworker-startup-delay");
102#else
103 elog(ERROR,
104 "test is not working as intended when injection points are disabled");
105#endif
107}

References elog, ERROR, fb(), InjectionPointAttach(), InjectionPointDetach(), PG_GETARG_BOOL, and PG_RETURN_VOID.

◆ PG_FUNCTION_INFO_V1() [1/3]

PG_FUNCTION_INFO_V1 ( dcw_inject_delay_barrier  )

◆ PG_FUNCTION_INFO_V1() [2/3]

PG_FUNCTION_INFO_V1 ( dcw_inject_launcher_delay  )

◆ PG_FUNCTION_INFO_V1() [3/3]

PG_FUNCTION_INFO_V1 ( dcw_inject_startup_delay  )

Variable Documentation

◆ PG_MODULE_MAGIC

PG_MODULE_MAGIC

Definition at line 22 of file test_checksums.c.