Skip to content

Commit 616ae3d

Browse files
committed
Move routine definitions of xlogarchive.c to a new header file
The definitions of the routines defined in xlogarchive.c have been part of xlog_internal.h which is included by several frontend tools, but all those routines are only called by the backend. More cleanup could be done within xlog_internal.h, but that's already a nice cut. This will help a follow-up patch for pg_rewind where handling of restore_command is added for frontends. Author: Alexey Kondratov, Michael Paquier Reviewed-by: Álvaro Herrera, Alexander Korotkov Discussion: https://postgr.es/m/a3acff50-5a0d-9a2c-b3b2-ee36168955c1@postgrespro.ru
1 parent fc8c3bd commit 616ae3d

File tree

6 files changed

+39
-18
lines changed

6 files changed

+39
-18
lines changed

src/backend/access/transam/timeline.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "access/timeline.h"
3838
#include "access/xlog.h"
3939
#include "access/xlog_internal.h"
40+
#include "access/xlogarchive.h"
4041
#include "access/xlogdefs.h"
4142
#include "pgstat.h"
4243
#include "storage/fd.h"

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "access/twophase.h"
3434
#include "access/xact.h"
3535
#include "access/xlog_internal.h"
36+
#include "access/xlogarchive.h"
3637
#include "access/xloginsert.h"
3738
#include "access/xlogreader.h"
3839
#include "access/xlogutils.h"

src/backend/access/transam/xlogarchive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "access/xlog.h"
2323
#include "access/xlog_internal.h"
24+
#include "access/xlogarchive.h"
2425
#include "common/archive.h"
2526
#include "miscadmin.h"
2627
#include "postmaster/startup.h"

src/backend/replication/walreceiver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "access/timeline.h"
5656
#include "access/transam.h"
5757
#include "access/xlog_internal.h"
58+
#include "access/xlogarchive.h"
5859
#include "catalog/pg_authid.h"
5960
#include "catalog/pg_type.h"
6061
#include "common/ip.h"

src/include/access/xlog_internal.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -320,22 +320,4 @@ extern bool InArchiveRecovery;
320320
extern bool StandbyMode;
321321
extern char *recoveryRestoreCommand;
322322

323-
/*
324-
* Prototypes for functions in xlogarchive.c
325-
*/
326-
extern bool RestoreArchivedFile(char *path, const char *xlogfname,
327-
const char *recovername, off_t expectedSize,
328-
bool cleanupEnabled);
329-
extern void ExecuteRecoveryCommand(const char *command, const char *commandName,
330-
bool failOnSignal);
331-
extern void KeepFileRestoredFromArchive(const char *path, const char *xlogfname);
332-
extern void XLogArchiveNotify(const char *xlog);
333-
extern void XLogArchiveNotifySeg(XLogSegNo segno);
334-
extern void XLogArchiveForceDone(const char *xlog);
335-
extern bool XLogArchiveCheckDone(const char *xlog);
336-
extern bool XLogArchiveIsBusy(const char *xlog);
337-
extern bool XLogArchiveIsReady(const char *xlog);
338-
extern bool XLogArchiveIsReadyOrDone(const char *xlog);
339-
extern void XLogArchiveCleanup(const char *xlog);
340-
341323
#endif /* XLOG_INTERNAL_H */

src/include/access/xlogarchive.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*------------------------------------------------------------------------
2+
*
3+
* xlogarchive.h
4+
* Prototypes for WAL archives in the backend
5+
*
6+
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
7+
* Portions Copyright (c) 1994, Regents of the University of California
8+
*
9+
* IDENTIFICATION
10+
* src/include/access/xlogarchive.h
11+
*
12+
*------------------------------------------------------------------------
13+
*/
14+
15+
#ifndef XLOG_ARCHIVE_H
16+
#define XLOG_ARCHIVE_H
17+
18+
#include "access/xlogdefs.h"
19+
20+
extern bool RestoreArchivedFile(char *path, const char *xlogfname,
21+
const char *recovername, off_t expectedSize,
22+
bool cleanupEnabled);
23+
extern void ExecuteRecoveryCommand(const char *command, const char *commandName,
24+
bool failOnSignal);
25+
extern void KeepFileRestoredFromArchive(const char *path, const char *xlogfname);
26+
extern void XLogArchiveNotify(const char *xlog);
27+
extern void XLogArchiveNotifySeg(XLogSegNo segno);
28+
extern void XLogArchiveForceDone(const char *xlog);
29+
extern bool XLogArchiveCheckDone(const char *xlog);
30+
extern bool XLogArchiveIsBusy(const char *xlog);
31+
extern bool XLogArchiveIsReady(const char *xlog);
32+
extern bool XLogArchiveIsReadyOrDone(const char *xlog);
33+
extern void XLogArchiveCleanup(const char *xlog);
34+
35+
#endif /* XLOG_ARCHIVE_H */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy