aboutsummaryrefslogtreecommitdiff
path: root/src/include/backup/walsummary.h
blob: 6575df8e4067cd17cd2b59adddcc64b65c1e1f97 (plain)
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
/*-------------------------------------------------------------------------
 *
 * walsummary.h
 *	  WAL summary management
 *
 * Portions Copyright (c) 2010-2024, PostgreSQL Global Development Group
 *
 * src/include/backup/walsummary.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef WALSUMMARY_H
#define WALSUMMARY_H

#include <time.h>

#include "access/xlogdefs.h"
#include "nodes/pg_list.h"
#include "storage/fd.h"

typedef struct WalSummaryIO
{
	File		file;
	off_t		filepos;
} WalSummaryIO;

typedef struct WalSummaryFile
{
	XLogRecPtr	start_lsn;
	XLogRecPtr	end_lsn;
	TimeLineID	tli;
} WalSummaryFile;

extern List *GetWalSummaries(TimeLineID tli, XLogRecPtr start_lsn,
							 XLogRecPtr end_lsn);
extern List *FilterWalSummaries(List *wslist, TimeLineID tli,
								XLogRecPtr start_lsn, XLogRecPtr end_lsn);
extern bool WalSummariesAreComplete(List *wslist,
									XLogRecPtr start_lsn, XLogRecPtr end_lsn,
									XLogRecPtr *missing_lsn);
extern File OpenWalSummaryFile(WalSummaryFile *ws, bool missing_ok);
extern void RemoveWalSummaryIfOlderThan(WalSummaryFile *ws,
										time_t cutoff_time);

extern int	ReadWalSummary(void *wal_summary_io, void *data, int length);
extern int	WriteWalSummary(void *wal_summary_io, void *data, int length);
extern void ReportWalSummaryError(void *callback_arg, char *fmt,...) pg_attribute_printf(2, 3);

#endif							/* WALSUMMARY_H */