summaryrefslogtreecommitdiff
path: root/bdb/txn
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2002-12-19 12:38:32 +0400
committerunknown <ram@mysql.r18.ru>2002-12-19 12:38:32 +0400
commitde539bf30adc10a93759729531622dd10ac42155 (patch)
tree98eee4f316172c3c9c047e0cdfcf87f3457f927d /bdb/txn
parent2cae041aa8724c443208693053c488caa5499421 (diff)
downloadmariadb-git-de539bf30adc10a93759729531622dd10ac42155.tar.gz
patches from sleepycat.com have been applied (SCRUM)
ha_berkeley::rename_table() has been added (SCRUM) bdb/db/db_open.c: patches from sleepycat.com have been applied bdb/log/log_put.c: patches from sleepycat.com have been applied bdb/mp/mp_fopen.c: patches from sleepycat.com have been applied bdb/rep/rep_record.c: patches from sleepycat.com have been applied bdb/txn/txn.c: patches from sleepycat.com have been applied sql/ha_berkeley.cc: ha_berkeley::rename_table() has been added sql/ha_berkeley.h: ha_berkeley::rename_table() has been added
Diffstat (limited to 'bdb/txn')
-rw-r--r--bdb/txn/txn.c46
1 files changed, 34 insertions, 12 deletions
diff --git a/bdb/txn/txn.c b/bdb/txn/txn.c
index 06fc8264afd..78c54791d06 100644
--- a/bdb/txn/txn.c
+++ b/bdb/txn/txn.c
@@ -1209,18 +1209,7 @@ do_ckp: /* Look through the active transactions for the lowest begin LSN. */
return (ret);
}
- /*
- * We want to make sure last_ckp only moves forward; since
- * we drop locks above and in log_put, it's possible
- * for two calls to __txn_ckp_log to finish in a different
- * order from how they were called.
- */
- R_LOCK(dbenv, &mgr->reginfo);
- if (log_compare(&region->last_ckp, &ckp_lsn) < 0) {
- region->last_ckp = ckp_lsn;
- (void)time(&region->time_ckp);
- }
- R_UNLOCK(dbenv, &mgr->reginfo);
+ __txn_updateckp(dbenv, &ckp_lsn);
}
return (0);
}
@@ -1404,3 +1393,36 @@ __txn_reset(dbenv)
return (__txn_recycle_log(dbenv,
NULL, &scrap, 0, TXN_MINIMUM, TXN_MAXIMUM));
}
+
+/*
+ * __txn_updateckp --
+ * Update the last_ckp field in the transaction region. This happens
+ * at the end of a normal checkpoint and also when a replication client
+ * receives a checkpoint record.
+ *
+ * PUBLIC: void __txn_updateckp __P((DB_ENV *, DB_LSN *));
+ */
+void
+__txn_updateckp(dbenv, lsnp)
+ DB_ENV *dbenv;
+ DB_LSN *lsnp;
+{
+ DB_TXNMGR *mgr;
+ DB_TXNREGION *region;
+
+ mgr = dbenv->tx_handle;
+ region = mgr->reginfo.primary;
+
+ /*
+ * We want to make sure last_ckp only moves forward; since
+ * we drop locks above and in log_put, it's possible
+ * for two calls to __txn_ckp_log to finish in a different
+ * order from how they were called.
+ */
+ R_LOCK(dbenv, &mgr->reginfo);
+ if (log_compare(&region->last_ckp, lsnp) < 0) {
+ region->last_ckp = *lsnp;
+ (void)time(&region->time_ckp);
+ }
+ R_UNLOCK(dbenv, &mgr->reginfo);
+}