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)
 
 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 30 of file test_checksums.c.

31{
32 (void) name;
33 (void) private_data;
34
37 (3 * 1000),
39}
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.

◆ dcw_inject_delay_barrier()

Datum dcw_inject_delay_barrier ( PG_FUNCTION_ARGS  )

Definition at line 43 of file test_checksums.c.

44{
45#ifdef USE_INJECTION_POINTS
46 bool attach = PG_GETARG_BOOL(0);
47
48 if (attach)
49 InjectionPointAttach("datachecksums-enable-checksums-delay",
50 "test_checksums",
51 "dc_delay_barrier",
52 NULL,
53 0);
54 else
55 InjectionPointDetach("datachecksums-enable-checksums-delay");
56#else
57 elog(ERROR,
58 "test is not working as intended when injection points are disabled");
59#endif
61}
#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 65 of file test_checksums.c.

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

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 87 of file test_checksums.c.

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

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.