2005-06-18 00:32:51 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* twophase.h
|
|
|
|
* Two-phase-commit related declarations.
|
|
|
|
*
|
|
|
|
*
|
2009-01-01 18:24:05 +01:00
|
|
|
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
2005-06-18 00:32:51 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2009-11-23 10:58:36 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/access/twophase.h,v 1.12 2009/11/23 09:58:36 heikki Exp $
|
2005-06-18 00:32:51 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef TWOPHASE_H
|
|
|
|
#define TWOPHASE_H
|
|
|
|
|
2006-07-13 18:49:20 +02:00
|
|
|
#include "access/xlogdefs.h"
|
2009-11-23 10:58:36 +01:00
|
|
|
#include "storage/backendid.h"
|
2005-06-19 22:00:39 +02:00
|
|
|
#include "storage/proc.h"
|
2005-06-18 21:33:42 +02:00
|
|
|
#include "utils/timestamp.h"
|
2005-06-18 00:32:51 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* GlobalTransactionData is defined in twophase.c; other places have no
|
|
|
|
* business knowing the internal definition.
|
|
|
|
*/
|
|
|
|
typedef struct GlobalTransactionData *GlobalTransaction;
|
|
|
|
|
|
|
|
/* GUC variable */
|
2005-10-15 04:49:52 +02:00
|
|
|
extern int max_prepared_xacts;
|
2005-06-18 00:32:51 +02:00
|
|
|
|
2005-08-21 01:26:37 +02:00
|
|
|
extern Size TwoPhaseShmemSize(void);
|
2005-06-18 00:32:51 +02:00
|
|
|
extern void TwoPhaseShmemInit(void);
|
|
|
|
|
|
|
|
extern PGPROC *TwoPhaseGetDummyProc(TransactionId xid);
|
2009-11-23 10:58:36 +01:00
|
|
|
extern BackendId TwoPhaseGetDummyBackendId(TransactionId xid);
|
2005-06-18 00:32:51 +02:00
|
|
|
|
2005-06-18 21:33:42 +02:00
|
|
|
extern GlobalTransaction MarkAsPreparing(TransactionId xid, const char *gid,
|
2005-10-15 04:49:52 +02:00
|
|
|
TimestampTz prepared_at,
|
|
|
|
Oid owner, Oid databaseid);
|
2005-06-18 00:32:51 +02:00
|
|
|
|
|
|
|
extern void StartPrepare(GlobalTransaction gxact);
|
|
|
|
extern void EndPrepare(GlobalTransaction gxact);
|
|
|
|
|
|
|
|
extern TransactionId PrescanPreparedTransactions(void);
|
|
|
|
extern void RecoverPreparedTransactions(void);
|
|
|
|
|
|
|
|
extern void RecreateTwoPhaseFile(TransactionId xid, void *content, int len);
|
|
|
|
extern void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning);
|
|
|
|
|
2005-06-19 22:00:39 +02:00
|
|
|
extern void CheckPointTwoPhase(XLogRecPtr redo_horizon);
|
|
|
|
|
2005-06-18 21:33:42 +02:00
|
|
|
extern void FinishPreparedTransaction(const char *gid, bool isCommit);
|
2005-06-18 00:32:51 +02:00
|
|
|
|
|
|
|
#endif /* TWOPHASE_H */
|