-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsyncpoint.h
52 lines (43 loc) · 1.4 KB
/
syncpoint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*-------------------------------------------------------------------------
*
* syncpoint.h
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 2021, Postgres Professional
*
*-------------------------------------------------------------------------
*/
#ifndef SYNCPOINT_H
#define SYNCPOINT_H
#include "access/xlogdefs.h"
#include "libpq-fe.h"
#include "utils/hsearch.h"
#include "replication/walsender.h"
typedef struct
{
XLogRecPtr origin_lsn;
XLogRecPtr local_lsn;
} Syncpoint;
/*
* Used as a hashkey in recovery filter.
*
* NB: make sure to memset this structure to zeroes before using as hashkey
* because it contains 4-byte padding hole in the middle.
*/
typedef struct
{
int node_id;
XLogRecPtr origin_lsn;
} FilterEntry;
extern int MtmSyncpointInterval;
extern void MaybeLogSyncpoint(void);
extern void SyncpointRegister(int origin_node_id, XLogRecPtr origin_lsn,
XLogRecPtr receiver_lsn);
extern Syncpoint SyncpointGetLatest(int origin_node_id);
extern Syncpoint *SyncpointGetAllLatest(int sender_node_id);
extern XLogRecPtr GetRecoveryHorizon(int sender_node_id);
extern void UpdateRecoveryHorizons(void);
extern HTAB *RecoveryFilterLoad(int filter_node_id, Syncpoint *spvector, MtmConfig *mtm_cfg);
extern char* pg_lsn_out_c(XLogRecPtr lsn);
#endif /* SYNCPOINT_H */