mariadb/storage/bdb/txn/txn.src

115 lines
2.7 KiB
Text
Raw Normal View History

2001-03-04 19:42:05 -05:00
/*-
* See the file LICENSE for redistribution information.
*
2005-12-05 10:27:46 -08:00
* Copyright (c) 1996-2005
2001-03-04 19:42:05 -05:00
* Sleepycat Software. All rights reserved.
*
2005-12-05 10:27:46 -08:00
* $Id: txn.src,v 12.2 2005/09/21 18:34:07 sue Exp $
2001-03-04 19:42:05 -05:00
*/
2002-10-30 15:57:05 +04:00
PREFIX __txn
DBPRIVATE
2001-03-04 19:42:05 -05:00
INCLUDE #ifndef NO_SYSTEM_INCLUDES
INCLUDE #include <sys/types.h>
INCLUDE
2005-07-20 15:48:22 -07:00
INCLUDE #if TIME_WITH_SYS_TIME
INCLUDE #include <sys/time.h>
INCLUDE #include <time.h>
INCLUDE #else
INCLUDE #if HAVE_SYS_TIME_H
INCLUDE #include <sys/time.h>
INCLUDE #else
INCLUDE #include <time.h>
INCLUDE #endif /* HAVE_SYS_TIME_H */
INCLUDE #endif /* TIME_WITH SYS_TIME */
INCLUDE
2001-03-04 19:42:05 -05:00
INCLUDE #include <ctype.h>
INCLUDE #include <string.h>
INCLUDE #endif
INCLUDE
INCLUDE #include "db_int.h"
2002-10-30 15:57:05 +04:00
INCLUDE #include "dbinc/crypto.h"
INCLUDE #include "dbinc/db_page.h"
INCLUDE #include "dbinc/db_dispatch.h"
INCLUDE #include "dbinc/db_am.h"
2005-07-20 15:48:22 -07:00
INCLUDE #include "dbinc/db_shash.h"
INCLUDE #include "dbinc/lock.h"
2002-10-30 15:57:05 +04:00
INCLUDE #include "dbinc/log.h"
INCLUDE #include "dbinc/txn.h"
2001-03-04 19:42:05 -05:00
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.
2005-12-05 10:27:46 -08:00
* envid:
* Environment ID of this operation.
2001-03-04 19:42:05 -05:00
*/
BEGIN regop 10
2005-07-20 15:48:22 -07:00
ARG opcode u_int32_t ld
TIME timestamp int32_t ld
2005-12-05 10:27:46 -08:00
ARG envid u_int32_t ld
2005-07-20 15:48:22 -07:00
LOCKS locks DBT s
2001-03-04 19:42:05 -05:00
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.
2005-07-20 15:48:22 -07:00
* envid:
* Environment ID of this checkpoint.
* rep_gen:
* Persistent replication generation number.
2001-03-04 19:42:05 -05:00
*/
BEGIN ckp 11
POINTER ckp_lsn DB_LSN * lu
POINTER last_ckp DB_LSN * lu
2005-07-20 15:48:22 -07:00
TIME timestamp int32_t ld
ARG envid u_int32_t ld
ARG rep_gen u_int32_t ld
2001-03-04 19:42:05 -05:00
END
/*
2002-10-30 15:57:05 +04:00
* 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.
2001-03-04 19:42:05 -05:00
*/
2002-10-30 15:57:05 +04:00
BEGIN child 12
ARG child u_int32_t lx
POINTER c_lsn DB_LSN * lu
2001-03-04 19:42:05 -05:00
END
2002-10-30 15:57:05 +04:00
2001-03-04 19:42:05 -05:00
/*
2002-10-30 15:57:05 +04:00
* This is the standard log operation for prepare.
2001-03-04 19:42:05 -05:00
*/
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
2005-07-20 15:48:22 -07:00
LOCKS locks DBT s
2001-03-04 19:42:05 -05:00
END
/*
2002-10-30 15:57:05 +04:00
* Log the fact that we are recycling txnids.
2001-03-04 19:42:05 -05:00
*/
2002-10-30 15:57:05 +04:00
BEGIN recycle 14
ARG min u_int32_t u
ARG max u_int32_t u
2001-03-04 19:42:05 -05:00
END