diff options
author | unknown <ram@mysql.r18.ru> | 2002-12-19 12:38:32 +0400 |
---|---|---|
committer | unknown <ram@mysql.r18.ru> | 2002-12-19 12:38:32 +0400 |
commit | de539bf30adc10a93759729531622dd10ac42155 (patch) | |
tree | 98eee4f316172c3c9c047e0cdfcf87f3457f927d /bdb/txn | |
parent | 2cae041aa8724c443208693053c488caa5499421 (diff) | |
download | mariadb-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.c | 46 |
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(®ion->last_ckp, &ckp_lsn) < 0) { - region->last_ckp = ckp_lsn; - (void)time(®ion->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(®ion->last_ckp, lsnp) < 0) { + region->last_ckp = *lsnp; + (void)time(®ion->time_ckp); + } + R_UNLOCK(dbenv, &mgr->reginfo); +} |