1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 1996,2008 Oracle.  All rights reserved.
5 *
6 * $Id: txn.src,v 12.13 2008/01/08 20:59:00 bostic Exp $
7 */
8
9DBPRIVATE
10PREFIX	__txn
11
12INCLUDE #include "db_int.h"
13INCLUDE #include "dbinc/crypto.h"
14INCLUDE #include "dbinc/db_page.h"
15INCLUDE #include "dbinc/db_dispatch.h"
16INCLUDE #include "dbinc/db_am.h"
17INCLUDE #include "dbinc/lock.h"
18INCLUDE #include "dbinc/log.h"
19INCLUDE #include "dbinc/txn.h"
20INCLUDE
21
22/*
23 * This is the standard log operation for commit.
24 * Note that we are using an int32_t for the timestamp.  This means that
25 * in 2039 we will need to deprecate this log record and create one that
26 * either changes the Epoch or has a 64-bit offset.
27 * envid:
28 *	Environment ID of this operation (4.4+).
29 */
30BEGIN_COMPAT regop		42	10
31ARG	opcode		u_int32_t	lu
32TIME	timestamp	int32_t		ld
33LOCKS	locks		DBT		s
34END
35
36BEGIN regop		44	10
37ARG	opcode		u_int32_t	lu
38TIME	timestamp	int32_t		ld
39ARG	envid		u_int32_t	lu
40LOCKS	locks		DBT		s
41END
42
43/*
44 * This is the checkpoint record.  It contains the lsn that the checkpoint
45 * guarantees and a pointer to the last checkpoint so we can walk backwards
46 * by checkpoint.
47 *
48 * ckp_lsn:
49 *	The lsn in the log of the most recent point at which all begun
50 *	transactions have been aborted.  This is the point for which
51 *	the checkpoint is relevant.
52 * last_ckp:
53 *	The previous checkpoint.
54 * timestamp:
55 *	See comment in commit about timestamps.
56 * envid:
57 *	Environment ID of this checkpoint (4.3+).
58 * rep_gen:
59 *	Persistent replication generation number (4.2-4.5 only).
60 *	Renamed to 'spare' in 4.6.
61 */
62BEGIN_COMPAT ckp		42	11
63POINTER	ckp_lsn		DB_LSN *	lu
64POINTER	last_ckp	DB_LSN *	lu
65TIME	timestamp	int32_t		ld
66ARG	rep_gen		u_int32_t	lu
67END
68
69BEGIN ckp		43	11
70POINTER	ckp_lsn		DB_LSN *	lu
71POINTER	last_ckp	DB_LSN *	lu
72TIME	timestamp	int32_t		ld
73ARG	envid		u_int32_t	lu
74ARG	spare		u_int32_t	lu
75END
76
77/*
78 * This is the (new) log operation for a child commit.  It is
79 * logged as a record in the PARENT.  The child field contains
80 * the transaction ID of the child committing and the c_lsn is
81 * the last LSN of the child's log trail.
82 */
83BEGIN child		42	12
84ARG	child	u_int32_t	lx
85POINTER	c_lsn	DB_LSN *	lu
86END
87
88
89/*
90 * This is the standard log operation for prepare.
91 */
92BEGIN xa_regop		42	13
93ARG	opcode		u_int32_t	lu
94DBT	xid		DBT		s
95ARG	formatID	int32_t		ld
96ARG	gtrid		u_int32_t	lu
97ARG	bqual		u_int32_t	lu
98POINTER	begin_lsn	DB_LSN *	lu
99LOCKS	locks		DBT		s
100END
101
102/*
103 * Log the fact that we are recycling txnids.
104 */
105BEGIN recycle		42	14
106ARG	min		u_int32_t	lu
107ARG	max		u_int32_t	lu
108END
109