]>
Commit | Line | Data |
---|---|---|
36596195 AM |
1 | *** dbinc_auto/int_def.in 2002/09/03 17:27:19 1.70 |
2 | --- dbinc_auto/int_def.in 2002/09/18 19:01:43 | |
3 | *************** | |
4 | *** 1172,1177 **** | |
5 | --- 1172,1178 ---- | |
6 | #define __txn_force_abort __txn_force_abort@DB_VERSION_UNIQUE_NAME@ | |
7 | #define __txn_preclose __txn_preclose@DB_VERSION_UNIQUE_NAME@ | |
8 | #define __txn_reset __txn_reset@DB_VERSION_UNIQUE_NAME@ | |
9 | + #define __txn_updateckp __txn_updateckp@DB_VERSION_UNIQUE_NAME@ | |
10 | #define __txn_regop_log __txn_regop_log@DB_VERSION_UNIQUE_NAME@ | |
11 | #define __txn_regop_getpgnos __txn_regop_getpgnos@DB_VERSION_UNIQUE_NAME@ | |
12 | #define __txn_regop_print __txn_regop_print@DB_VERSION_UNIQUE_NAME@ | |
13 | *** dbinc_auto/txn_ext.h 2002/09/03 17:27:20 1.32 | |
14 | --- dbinc_auto/txn_ext.h 2002/09/18 19:01:43 | |
15 | *************** | |
16 | *** 20,25 **** | |
17 | --- 20,26 ---- | |
18 | int __txn_force_abort __P((DB_ENV *, u_int8_t *)); | |
19 | int __txn_preclose __P((DB_ENV *)); | |
20 | int __txn_reset __P((DB_ENV *)); | |
21 | + void __txn_updateckp __P((DB_ENV *, DB_LSN *)); | |
22 | int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t)); | |
23 | int __txn_regop_getpgnos __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); | |
24 | int __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); | |
25 | *** rep/rep_record.c 2002/09/11 19:39:11 1.111 | |
26 | --- rep/rep_record.c 2002/09/18 19:01:58 | |
27 | *************** | |
28 | *** 1198,1203 **** | |
29 | --- 1198,1206 ---- | |
30 | * replica get flushed now and again. | |
31 | */ | |
32 | ret = dbenv->log_flush(dbenv, &ckp_lsn); | |
33 | + /* Update the last_ckp in the txn region. */ | |
34 | + if (ret == 0) | |
35 | + __txn_updateckp(dbenv, &rp->lsn); | |
36 | break; | |
37 | case DB___txn_regop: | |
38 | if (!F_ISSET(dbenv, DB_ENV_REP_LOGSONLY)) | |
39 | *** txn/txn.c 2002/08/29 17:41:17 11.179 | |
40 | --- txn/txn.c 2002/09/18 19:02:05 | |
41 | *************** | |
42 | *** 1209,1226 **** | |
43 | return (ret); | |
44 | } | |
45 | ||
46 | ! /* | |
47 | ! * We want to make sure last_ckp only moves forward; since | |
48 | ! * we drop locks above and in log_put, it's possible | |
49 | ! * for two calls to __txn_ckp_log to finish in a different | |
50 | ! * order from how they were called. | |
51 | ! */ | |
52 | ! R_LOCK(dbenv, &mgr->reginfo); | |
53 | ! if (log_compare(®ion->last_ckp, &ckp_lsn) < 0) { | |
54 | ! region->last_ckp = ckp_lsn; | |
55 | ! (void)time(®ion->time_ckp); | |
56 | ! } | |
57 | ! R_UNLOCK(dbenv, &mgr->reginfo); | |
58 | } | |
59 | return (0); | |
60 | } | |
61 | --- 1209,1215 ---- | |
62 | return (ret); | |
63 | } | |
64 | ||
65 | ! __txn_updateckp(dbenv, &ckp_lsn); | |
66 | } | |
67 | return (0); | |
68 | } | |
69 | *************** | |
70 | *** 1403,1406 **** | |
71 | --- 1392,1428 ---- | |
72 | DB_ASSERT(LOGGING_ON(dbenv)); | |
73 | return (__txn_recycle_log(dbenv, | |
74 | NULL, &scrap, 0, TXN_MINIMUM, TXN_MAXIMUM)); | |
75 | + } | |
76 | + | |
77 | + /* | |
78 | + * __txn_updateckp -- | |
79 | + * Update the last_ckp field in the transaction region. This happens | |
80 | + * at the end of a normal checkpoint and also when a replication client | |
81 | + * receives a checkpoint record. | |
82 | + * | |
83 | + * PUBLIC: void __txn_updateckp __P((DB_ENV *, DB_LSN *)); | |
84 | + */ | |
85 | + void | |
86 | + __txn_updateckp(dbenv, lsnp) | |
87 | + DB_ENV *dbenv; | |
88 | + DB_LSN *lsnp; | |
89 | + { | |
90 | + DB_TXNMGR *mgr; | |
91 | + DB_TXNREGION *region; | |
92 | + | |
93 | + mgr = dbenv->tx_handle; | |
94 | + region = mgr->reginfo.primary; | |
95 | + | |
96 | + /* | |
97 | + * We want to make sure last_ckp only moves forward; since | |
98 | + * we drop locks above and in log_put, it's possible | |
99 | + * for two calls to __txn_ckp_log to finish in a different | |
100 | + * order from how they were called. | |
101 | + */ | |
102 | + R_LOCK(dbenv, &mgr->reginfo); | |
103 | + if (log_compare(®ion->last_ckp, lsnp) < 0) { | |
104 | + region->last_ckp = *lsnp; | |
105 | + (void)time(®ion->time_ckp); | |
106 | + } | |
107 | + R_UNLOCK(dbenv, &mgr->reginfo); | |
108 | } |