1N/A * See the file LICENSE for redistribution information. 1N/A * Copyright (c) 1996, 1997, 1998 1N/A * Sleepycat Software. All rights reserved. 1N/A * Copyright (c) 1995, 1996 1N/A * The President and Fellows of Harvard University. All rights reserved. 1N/A * This code is derived from software contributed to Berkeley by 1N/A * Redistribution and use in source and binary forms, with or without 1N/A * modification, are permitted provided that the following conditions 1N/A * 1. Redistributions of source code must retain the above copyright 1N/A * notice, this list of conditions and the following disclaimer. 1N/A * 2. Redistributions in binary form must reproduce the above copyright 1N/A * notice, this list of conditions and the following disclaimer in the 1N/A * documentation and/or other materials provided with the distribution. 1N/A * 3. All advertising materials mentioning features or use of this software 1N/A * must display the following acknowledgement: 1N/A * This product includes software developed by the University of 1N/A * California, Berkeley and its contributors. 1N/A * 4. Neither the name of the University nor the names of its contributors 1N/A * may be used to endorse or promote products derived from this software 1N/A * without specific prior written permission. 1N/A * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1N/A#
endif /* not lint */ 1N/A * Data structures to manage the DB dispatch table. The dispatch table 1N/A * is a dynamically allocated array of pointers to dispatch functions. 1N/A * The dispatch_size is the number of entries possible in the current 1N/A * dispatch table and the dispatch_valid is the number of valid entries 1N/A * in the dispatch table. 1N/A * This is the transaction dispatch function used by the db access methods. 1N/A * It is designed to handle the record format used by all the access 1N/A * methods (the one automatically generated by the db_{h,log,read}.sh 1N/A * scripts in the tools directory). An application using a different 1N/A * recovery paradigm will supply a different dispatch function to txn_open. 1N/A * PUBLIC: int __db_dispatch __P((DB_LOG *, DBT *, DB_LSN *, int, void *)); 1N/A DBT *
db;
/* The log record upon which to dispatch. */ 1N/A int redo;
/* Redo this op (or undo it). */ 1N/A * Running full recovery in the backward pass. If we've 1N/A * seen this txnid before and added to it our commit list, 1N/A * then we do nothing during this pass. If we've never 1N/A * seen it, then we call the appropriate recovery routine 1N/A * In the forward pass, if we haven't seen the transaction, 1N/A * do nothing, else recovery it. 1N/A * __db_add_recovery -- 1N/A * PUBLIC: int __db_add_recovery __P((DB_ENV *, 1N/A * PUBLIC: int (*)(DB_LOG *, DBT *, DB_LSN *, int, void *), u_int32_t)); 1N/A /* Check if we have to grow the table. */ 1N/A * __db_txnlist_init -- 1N/A * Initialize transaction linked list. 1N/A * PUBLIC: int __db_txnlist_init __P((void *)); 1N/A * __db_txnlist_add -- 1N/A * Add an element to our transaction linked list. 1N/A * PUBLIC: int __db_txnlist_add __P((void *, u_int32_t)); 1N/A * __db_txnlist_find -- 1N/A * Checks to see if a txnid with the current generation is in the 1N/A * PUBLIC: int __db_txnlist_find __P((void *, u_int32_t)); 1N/A * __db_txnlist_end -- 1N/A * Discard transaction linked list. 1N/A * PUBLIC: void __db_txnlist_end __P((void *)); 1N/A * __db_txnlist_gen -- 1N/A * Change the current generation number. 1N/A * PUBLIC: void __db_txnlist_gen __P((void *, int)); 1N/A * During recovery generation numbers keep track of how many "restart" 1N/A * checkpoints we've seen. Restart checkpoints occur whenever we take 1N/A * a checkpoint and there are no outstanding transactions. When that 1N/A * happens, we can reset transaction IDs back to 1. It always happens 1N/A * at recovery and it prevents us from exhausting the transaction IDs 1N/A * __db_txnlist_print -- 1N/A * Print out the transaction list. 1N/A * PUBLIC: void __db_txnlist_print __P((void *));