postgresql/src/include/replication/walsender.h

58 lines
1.4 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* walsender.h
* Exports from replication/walsender.c.
*
* Portions Copyright (c) 2010-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/replication/walsender.h,v 1.5 2010/09/11 15:48:04 heikki Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef _WALSENDER_H
#define _WALSENDER_H
#include "access/xlog.h"
#include "storage/latch.h"
#include "storage/spin.h"
/*
* Each walsender has a WalSnd struct in shared memory.
*/
typedef struct WalSnd
{
2010-02-26 03:01:40 +01:00
pid_t pid; /* this walsender's process id, or 0 */
XLogRecPtr sentPtr; /* WAL has been sent up to this point */
2010-02-26 03:01:40 +01:00
slock_t mutex; /* locks shared variables shown above */
/*
* Latch used by backends to wake up this walsender when it has work
* to do.
*/
Latch latch;
} WalSnd;
/* There is one WalSndCtl struct for the whole database cluster */
typedef struct
{
2010-02-26 03:01:40 +01:00
WalSnd walsnds[1]; /* VARIABLE LENGTH ARRAY */
} WalSndCtlData;
extern WalSndCtlData *WalSndCtl;
/* global state */
2010-02-26 03:01:40 +01:00
extern bool am_walsender;
/* user-settable parameters */
extern int WalSndDelay;
extern int max_wal_senders;
2010-02-26 03:01:40 +01:00
extern int WalSenderMain(void);
extern void WalSndSignals(void);
extern Size WalSndShmemSize(void);
extern void WalSndShmemInit(void);
extern void WalSndWakeup(void);
2010-02-26 03:01:40 +01:00
#endif /* _WALSENDER_H */