gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 line
1.7KB

  1. /*
  2. * clog.h
  3. *
  4. * PostgreSQL transaction-commit-log manager
  5. *
  6. * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994, Regents of the University of California
  8. *
  9. * src/include/access/clog.h
  10. */
  11. #ifndef CLOG_H
  12. #define CLOG_H
  13. #include "access/xlogreader.h"
  14. #include "lib/stringinfo.h"
  15. /*
  16. * Possible transaction statuses --- note that all-zeroes is the initial
  17. * state.
  18. *
  19. * A "subcommitted" transaction is a committed subtransaction whose parent
  20. * hasn't committed or aborted yet.
  21. */
  22. typedef int XidStatus;
  23. #define TRANSACTION_STATUS_IN_PROGRESS 0x00
  24. #define TRANSACTION_STATUS_COMMITTED 0x01
  25. #define TRANSACTION_STATUS_ABORTED 0x02
  26. #define TRANSACTION_STATUS_SUB_COMMITTED 0x03
  27. typedef struct xl_clog_truncate
  28. {
  29. int pageno;
  30. TransactionId oldestXact;
  31. Oid oldestXactDb;
  32. } xl_clog_truncate;
  33. extern void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
  34. TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
  35. extern XidStatus TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn);
  36. extern Size CLOGShmemBuffers(void);
  37. extern Size CLOGShmemSize(void);
  38. extern void CLOGShmemInit(void);
  39. extern void BootStrapCLOG(void);
  40. extern void StartupCLOG(void);
  41. extern void TrimCLOG(void);
  42. extern void ShutdownCLOG(void);
  43. extern void CheckPointCLOG(void);
  44. extern void ExtendCLOG(TransactionId newestXact);
  45. extern void TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid);
  46. /* XLOG stuff */
  47. #define CLOG_ZEROPAGE 0x00
  48. #define CLOG_TRUNCATE 0x10
  49. extern void clog_redo(XLogReaderState *record);
  50. extern void clog_desc(StringInfo buf, XLogReaderState *record);
  51. extern const char *clog_identify(uint8 info);
  52. #endif /* CLOG_H */
上海开阖软件有限公司 沪ICP备12045867号-1