/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 1996-2001
 *	Sleepycat Software.  All rights reserved.
 *
 * $Id: txn.src,v 11.14 2001/07/27 19:07:18 krinsky Exp $
 */

PREFIX	txn

INCLUDE	#include "db_config.h"
INCLUDE
INCLUDE #ifndef NO_SYSTEM_INCLUDES
INCLUDE #include <sys/types.h>
INCLUDE
INCLUDE #include <ctype.h>
INCLUDE #include <string.h>
INCLUDE #endif
INCLUDE
INCLUDE #include "db_int.h"
INCLUDE #include "db_page.h"
INCLUDE #include "db_dispatch.h"
INCLUDE #include "db_am.h"
INCLUDE #include "log.h"
INCLUDE #include "rep.h"
INCLUDE #include "txn.h"
INCLUDE

/*
 * This is the standard log operation for commit.
 * Note that we are using an int32_t for the timestamp.  This means that
 * in 2039 we will need to deprecate this log record and create one that
 * either changes the Epoch or has a 64-bit offset.
 */
BEGIN regop		10
ARG	opcode		u_int32_t	lu
ARG	timestamp	int32_t		ld
END

/*
 * This is the checkpoint record.  It contains the lsn that the checkpoint
 * guarantees and a pointer to the last checkpoint so we can walk backwards
 * by checkpoint.
 *
 * ckp_lsn:
 *	The lsn in the log of the most recent point at which all begun
 *	transactions have been aborted.  This is the point for which
 *	the checkpoint is relevant.
 * last_ckp:
 *	The previous checkpoint.
 * timestamp:
 *	See comment in commit about timestamps.
 */
BEGIN ckp		11
POINTER	ckp_lsn		DB_LSN *	lu
POINTER	last_ckp	DB_LSN *	lu
ARG	timestamp	int32_t		ld
END

/*
 * This is the standard log operation for prepare.
 */
BEGIN xa_regop		13
ARG	opcode		u_int32_t	lu
DBT	xid		DBT		s
ARG	formatID	int32_t		ld
ARG	gtrid		u_int32_t	u
ARG	bqual		u_int32_t	u
POINTER	begin_lsn	DB_LSN *	lu
END

/*
 * This is the (new) log operation for a child commit.  It is
 * logged as a record in the PARENT.  The child field contains
 * the transaction ID of the child committing and the c_lsn is
 * the last LSN of the child's log trail.
 */
BEGIN child	12
ARG	child	u_int32_t	lx
POINTER	c_lsn	DB_LSN *	lu
END
