Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc80b31d

Browse files
Refactor headers to split out standby defs
Jeff Janes
1 parent978b2f6 commitc80b31d

File tree

4 files changed

+56
-37
lines changed

4 files changed

+56
-37
lines changed

‎src/backend/access/rmgrdesc/standbydesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
#include"postgres.h"
1616

17-
#include"storage/standby.h"
17+
#include"storage/standbydefs.h"
1818

1919
staticvoid
2020
standby_desc_running_xacts(StringInfobuf,xl_running_xacts*xlrec)

‎src/bin/pg_xlogdump/rmgrdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include"commands/tablespace.h"
2828
#include"replication/origin.h"
2929
#include"rmgrdesc.h"
30-
#include"storage/standby.h"
30+
#include"storage/standbydefs.h"
3131
#include"utils/relmapper.h"
3232

3333
#definePG_RMGR(symname,name,redo,desc,identify,startup,cleanup) \

‎src/include/storage/standby.h

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#ifndefSTANDBY_H
1515
#defineSTANDBY_H
1616

17-
#include"access/xlogreader.h"
18-
#include"lib/stringinfo.h"
19-
#include"storage/lockdefs.h"
17+
#include"storage/standbydefs.h"
2018
#include"storage/procsignal.h"
2119
#include"storage/relfilenode.h"
2220

@@ -51,41 +49,9 @@ extern void StandbyReleaseLockTree(TransactionId xid,
5149
externvoidStandbyReleaseAllLocks(void);
5250
externvoidStandbyReleaseOldLocks(intnxids,TransactionId*xids);
5351

54-
/*
55-
* XLOG message types
56-
*/
57-
#defineXLOG_STANDBY_LOCK0x00
58-
#defineXLOG_RUNNING_XACTS0x10
59-
60-
typedefstructxl_standby_locks
61-
{
62-
intnlocks;/* number of entries in locks array */
63-
xl_standby_locklocks[FLEXIBLE_ARRAY_MEMBER];
64-
}xl_standby_locks;
65-
66-
/*
67-
* When we write running xact data to WAL, we use this structure.
68-
*/
69-
typedefstructxl_running_xacts
70-
{
71-
intxcnt;/* # of xact ids in xids[] */
72-
intsubxcnt;/* # of subxact ids in xids[] */
73-
boolsubxid_overflow;/* snapshot overflowed, subxids missing */
74-
TransactionIdnextXid;/* copy of ShmemVariableCache->nextXid */
75-
TransactionIdoldestRunningXid;/* *not* oldestXmin */
76-
TransactionIdlatestCompletedXid;/* so we can set xmax */
77-
78-
TransactionIdxids[FLEXIBLE_ARRAY_MEMBER];
79-
}xl_running_xacts;
80-
8152
#defineMinSizeOfXactRunningXacts offsetof(xl_running_xacts, xids)
8253

8354

84-
/* Recovery handlers for the Standby Rmgr (RM_STANDBY_ID) */
85-
externvoidstandby_redo(XLogReaderState*record);
86-
externvoidstandby_desc(StringInfobuf,XLogReaderState*record);
87-
externconstchar*standby_identify(uint8info);
88-
8955
/*
9056
* Declarations for GetRunningTransactionData(). Similar to Snapshots, but
9157
* not quite. This has nothing at all to do with visibility on this server,

‎src/include/storage/standbydefs.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* standbydef.h
4+
* Frontend exposed definitions for hot standby mode.
5+
*
6+
*
7+
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
8+
* Portions Copyright (c) 1994, Regents of the University of California
9+
*
10+
* src/include/storage/standbydefs.h
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
#ifndefSTANDBYDEFS_H
15+
#defineSTANDBYDEFS_H
16+
17+
#include"access/xlogreader.h"
18+
#include"lib/stringinfo.h"
19+
#include"storage/lockdefs.h"
20+
21+
/* Recovery handlers for the Standby Rmgr (RM_STANDBY_ID) */
22+
externvoidstandby_redo(XLogReaderState*record);
23+
externvoidstandby_desc(StringInfobuf,XLogReaderState*record);
24+
externconstchar*standby_identify(uint8info);
25+
26+
/*
27+
* XLOG message types
28+
*/
29+
#defineXLOG_STANDBY_LOCK0x00
30+
#defineXLOG_RUNNING_XACTS0x10
31+
32+
typedefstructxl_standby_locks
33+
{
34+
intnlocks;/* number of entries in locks array */
35+
xl_standby_locklocks[FLEXIBLE_ARRAY_MEMBER];
36+
}xl_standby_locks;
37+
38+
/*
39+
* When we write running xact data to WAL, we use this structure.
40+
*/
41+
typedefstructxl_running_xacts
42+
{
43+
intxcnt;/* # of xact ids in xids[] */
44+
intsubxcnt;/* # of subxact ids in xids[] */
45+
boolsubxid_overflow;/* snapshot overflowed, subxids missing */
46+
TransactionIdnextXid;/* copy of ShmemVariableCache->nextXid */
47+
TransactionIdoldestRunningXid;/* *not* oldestXmin */
48+
TransactionIdlatestCompletedXid;/* so we can set xmax */
49+
50+
TransactionIdxids[FLEXIBLE_ARRAY_MEMBER];
51+
}xl_running_xacts;
52+
53+
#endif/* STANDBYDEFS_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp