diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-05-11 11:21:11 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-05-11 11:21:11 +1000 |
commit | 73bc6b51489ebbe7cb888ba2fb0125b22791ae8e (patch) | |
tree | 0b052c34231026203a78d3e7efe0914898a8d95c | |
parent | eb6ce904ba35459f717a70bc43c7db43b9a781a8 (diff) | |
download | mongo-73bc6b51489ebbe7cb888ba2fb0125b22791ae8e.tar.gz |
Add a "WT_" prefix to the many TXN_* macros in use inside WiredTiger.
Now that test/format mixes wt_internal.h with Berkeley DB's db.h, we were seeing conflicts over TXN_RUNNING. Try to fix that problem in general, at least for "TXN" macros.
refs WT-1925
-rw-r--r-- | dist/s_define.list | 1 | ||||
-rw-r--r-- | src/btree/bt_sync.c | 10 | ||||
-rw-r--r-- | src/conn/conn_api.c | 2 | ||||
-rw-r--r-- | src/evict/evict_lru.c | 6 | ||||
-rw-r--r-- | src/include/api.h | 18 | ||||
-rw-r--r-- | src/include/btree.i | 6 | ||||
-rw-r--r-- | src/include/txn.h | 50 | ||||
-rw-r--r-- | src/include/txn.i | 60 | ||||
-rw-r--r-- | src/lsm/lsm_cursor.c | 24 | ||||
-rw-r--r-- | src/lsm/lsm_manager.c | 2 | ||||
-rw-r--r-- | src/lsm/lsm_work_unit.c | 2 | ||||
-rw-r--r-- | src/reconcile/rec_track.c | 4 | ||||
-rw-r--r-- | src/reconcile/rec_write.c | 8 | ||||
-rw-r--r-- | src/session/session_api.c | 18 | ||||
-rw-r--r-- | src/session/session_compact.c | 2 | ||||
-rw-r--r-- | src/txn/txn.c | 65 | ||||
-rw-r--r-- | src/txn/txn_ckpt.c | 8 | ||||
-rw-r--r-- | src/txn/txn_ext.c | 4 | ||||
-rw-r--r-- | src/txn/txn_log.c | 34 | ||||
-rw-r--r-- | src/txn/txn_recover.c | 8 |
20 files changed, 167 insertions, 165 deletions
diff --git a/dist/s_define.list b/dist/s_define.list index eae95d527a1..c9f2db406bf 100644 --- a/dist/s_define.list +++ b/dist/s_define.list @@ -12,7 +12,6 @@ LF_SET LLONG_MAX LLONG_MIN SIZE_CHECK -TXNID_LE TXN_API_CALL TXN_API_CALL_NOCONF TXN_API_END diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c index cc52f63f1f5..6c5b1fb98e8 100644 --- a/src/btree/bt_sync.c +++ b/src/btree/bt_sync.c @@ -70,7 +70,7 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) if (__wt_page_is_modified(page) && __wt_txn_visible_all( session, page->modify->update_txn)) { - if (txn->isolation == TXN_ISO_READ_COMMITTED) + if (txn->isolation == WT_ISO_READ_COMMITTED) __wt_txn_get_snapshot(session); leaf_bytes += page->memory_footprint; ++leaf_pages; @@ -117,7 +117,7 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) */ if (walk != NULL && walk->page != NULL && (mod = walk->page->modify) != NULL && - TXNID_LT(btree->rec_max_txn, mod->rec_max_txn)) + WT_TXNID_LT(btree->rec_max_txn, mod->rec_max_txn)) btree->rec_max_txn = mod->rec_max_txn; WT_ERR(__wt_tree_walk(session, &walk, NULL, flags)); @@ -149,8 +149,8 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) * is written. */ if (!WT_PAGE_IS_INTERNAL(page) && - F_ISSET(txn, TXN_HAS_SNAPSHOT) && - TXNID_LT(txn->snap_max, mod->first_dirty_txn) && + F_ISSET(txn, WT_TXN_HAS_SNAPSHOT) && + WT_TXNID_LT(txn->snap_max, mod->first_dirty_txn) && !F_ISSET(mod, WT_PM_REC_REWRITE)) { __wt_page_modify_set(session, page); continue; @@ -185,7 +185,7 @@ err: /* On error, clear any left-over tree walk. */ if (walk != NULL) WT_TRET(__wt_page_release(session, walk, flags)); - if (txn->isolation == TXN_ISO_READ_COMMITTED && session->ncursors == 0) + if (txn->isolation == WT_ISO_READ_COMMITTED && session->ncursors == 0) __wt_txn_release_snapshot(session); if (btree->checkpointing) { diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index 56f15a89f30..7fc9ce8dd9b 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -814,7 +814,7 @@ err: /* */ for (s = conn->sessions, i = 0; i < conn->session_cnt; ++s, ++i) if (s->active && !F_ISSET(s, WT_SESSION_INTERNAL) && - F_ISSET(&s->txn, TXN_RUNNING)) { + F_ISSET(&s->txn, WT_TXN_RUNNING)) { wt_session = &s->iface; WT_TRET(wt_session->rollback_transaction( wt_session, NULL)); diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c index 3ad7e8a2723..3e7ebd12e52 100644 --- a/src/evict/evict_lru.c +++ b/src/evict/evict_lru.c @@ -684,14 +684,14 @@ __wt_evict_page(WT_SESSION_IMPL *session, WT_REF *ref) __wt_txn_update_oldest(session, 1); txn = &session->txn; saved_iso = txn->isolation; - txn->isolation = TXN_ISO_EVICTION; + txn->isolation = WT_ISO_EVICTION; /* * Sanity check: if a transaction has updates, its updates should not * be visible to eviction. */ - WT_ASSERT(session, - !F_ISSET(txn, TXN_HAS_ID) || !__wt_txn_visible(session, txn->id)); + WT_ASSERT(session, !F_ISSET(txn, WT_TXN_HAS_ID) || + !__wt_txn_visible(session, txn->id)); ret = __wt_evict(session, ref, 0); txn->isolation = saved_iso; diff --git a/src/include/api.h b/src/include/api.h index 8f8fd8e98b1..33f685cb279 100644 --- a/src/include/api.h +++ b/src/include/api.h @@ -33,11 +33,11 @@ if ((s) != NULL) { \ (s)->dhandle = __olddh; \ (s)->name = __oldname; \ - if (F_ISSET(&(s)->txn, TXN_RUNNING) && \ + if (F_ISSET(&(s)->txn, WT_TXN_RUNNING) && \ (ret) != 0 && \ (ret) != WT_NOTFOUND && \ (ret) != WT_DUPLICATE_KEY) \ - F_SET(&(s)->txn, TXN_ERROR); \ + F_SET(&(s)->txn, WT_TXN_ERROR); \ } \ } while (0) @@ -45,25 +45,25 @@ #define TXN_API_CALL(s, h, n, cur, bt, config, cfg) do { \ int __autotxn = 0; \ API_CALL(s, h, n, bt, cur, config, cfg); \ - __autotxn = !F_ISSET(&(s)->txn, TXN_AUTOCOMMIT | TXN_RUNNING); \ + __autotxn = !F_ISSET(&(s)->txn, WT_TXN_AUTOCOMMIT | WT_TXN_RUNNING);\ if (__autotxn) \ - F_SET(&(s)->txn, TXN_AUTOCOMMIT) + F_SET(&(s)->txn, WT_TXN_AUTOCOMMIT) /* An API call wrapped in a transaction if necessary. */ #define TXN_API_CALL_NOCONF(s, h, n, cur, bt) do { \ int __autotxn = 0; \ API_CALL_NOCONF(s, h, n, cur, bt); \ - __autotxn = !F_ISSET(&(s)->txn, TXN_AUTOCOMMIT | TXN_RUNNING); \ + __autotxn = !F_ISSET(&(s)->txn, WT_TXN_AUTOCOMMIT | WT_TXN_RUNNING);\ if (__autotxn) \ - F_SET(&(s)->txn, TXN_AUTOCOMMIT) + F_SET(&(s)->txn, WT_TXN_AUTOCOMMIT) /* End a transactional API call, optional retry on deadlock. */ #define TXN_API_END_RETRY(s, ret, retry) \ API_END(s, ret); \ if (__autotxn) { \ - if (F_ISSET(&(s)->txn, TXN_AUTOCOMMIT)) \ - F_CLR(&(s)->txn, TXN_AUTOCOMMIT); \ - else if (ret == 0 && !F_ISSET(&(s)->txn, TXN_ERROR)) \ + if (F_ISSET(&(s)->txn, WT_TXN_AUTOCOMMIT)) \ + F_CLR(&(s)->txn, WT_TXN_AUTOCOMMIT); \ + else if (ret == 0 && !F_ISSET(&(s)->txn, WT_TXN_ERROR)) \ ret = __wt_txn_commit((s), NULL); \ else { \ WT_TRET(__wt_txn_rollback((s), NULL)); \ diff --git a/src/include/btree.i b/src/include/btree.i index 5a2253f6078..2ff89c1bdd5 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -367,7 +367,7 @@ __wt_page_only_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page) * The page can never end up with changes older than the oldest * running transaction. */ - if (F_ISSET(&session->txn, TXN_HAS_SNAPSHOT)) + if (F_ISSET(&session->txn, WT_TXN_HAS_SNAPSHOT)) page->modify->disk_snap_min = session->txn.snap_min; /* @@ -384,7 +384,7 @@ __wt_page_only_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page) } /* Check if this is the largest transaction ID to update the page. */ - if (TXNID_LT(page->modify->update_txn, session->txn.id)) + if (WT_TXNID_LT(page->modify->update_txn, session->txn.id)) page->modify->update_txn = session->txn.id; } @@ -1109,7 +1109,7 @@ __wt_page_can_evict( * transaction. */ if (LF_ISSET(WT_EVICT_CHECK_SPLITS) && - TXNID_LE(txn_global->oldest_id, mod->inmem_split_txn)) + WT_TXNID_LE(txn_global->oldest_id, mod->inmem_split_txn)) return (0); return (1); diff --git a/src/include/txn.h b/src/include/txn.h index 62f565c0535..9f600ac95c1 100644 --- a/src/include/txn.h +++ b/src/include/txn.h @@ -17,11 +17,11 @@ * transaction), WT_TXN_NONE is smaller than any possible ID (visible to all * running transactions). */ -#define TXNID_LE(t1, t2) \ +#define WT_TXNID_LE(t1, t2) \ ((t1) <= (t2)) -#define TXNID_LT(t1, t2) \ - ((t1) != (t2) && TXNID_LE(t1, t2)) +#define WT_TXNID_LT(t1, t2) \ + ((t1) != (t2) && WT_TXNID_LE(t1, t2)) #define WT_SESSION_TXN_STATE(s) (&S2C(s)->txn_global.states[(s)->id]) @@ -60,10 +60,10 @@ struct __wt_txn_global { }; typedef enum __wt_txn_isolation { - TXN_ISO_EVICTION, /* Internal: eviction context */ - TXN_ISO_READ_UNCOMMITTED, - TXN_ISO_READ_COMMITTED, - TXN_ISO_SNAPSHOT + WT_ISO_EVICTION, /* Internal: eviction context */ + WT_ISO_READ_UNCOMMITTED, + WT_ISO_READ_COMMITTED, + WT_ISO_SNAPSHOT } WT_TXN_ISOLATION; /* @@ -75,29 +75,29 @@ typedef enum __wt_txn_isolation { struct __wt_txn_op { uint32_t fileid; enum { - TXN_OP_BASIC, - TXN_OP_INMEM, - TXN_OP_REF, - TXN_OP_TRUNCATE_COL, - TXN_OP_TRUNCATE_ROW + WT_TXN_OP_BASIC, + WT_TXN_OP_INMEM, + WT_TXN_OP_REF, + WT_TXN_OP_TRUNCATE_COL, + WT_TXN_OP_TRUNCATE_ROW } type; union { - /* TXN_OP_BASIC, TXN_OP_INMEM */ + /* WT_TXN_OP_BASIC, WT_TXN_OP_INMEM */ WT_UPDATE *upd; - /* TXN_OP_REF */ + /* WT_TXN_OP_REF */ WT_REF *ref; - /* TXN_OP_TRUNCATE_COL */ + /* WT_TXN_OP_TRUNCATE_COL */ struct { uint64_t start, stop; } truncate_col; - /* TXN_OP_TRUNCATE_ROW */ + /* WT_TXN_OP_TRUNCATE_ROW */ struct { WT_ITEM start, stop; enum { - TXN_TRUNC_ALL, - TXN_TRUNC_BOTH, - TXN_TRUNC_START, - TXN_TRUNC_STOP + WT_TXN_TRUNC_ALL, + WT_TXN_TRUNC_BOTH, + WT_TXN_TRUNC_START, + WT_TXN_TRUNC_STOP } mode; } truncate_row; } u; @@ -140,10 +140,10 @@ struct __wt_txn { uint32_t ckpt_nsnapshot; WT_ITEM *ckpt_snapshot; -#define TXN_AUTOCOMMIT 0x01 -#define TXN_ERROR 0x02 -#define TXN_HAS_ID 0x04 -#define TXN_HAS_SNAPSHOT 0x08 -#define TXN_RUNNING 0x10 +#define WT_TXN_AUTOCOMMIT 0x01 +#define WT_TXN_ERROR 0x02 +#define WT_TXN_HAS_ID 0x04 +#define WT_TXN_HAS_SNAPSHOT 0x08 +#define WT_TXN_RUNNING 0x10 uint32_t flags; }; diff --git a/src/include/txn.i b/src/include/txn.i index b1cfba4257d..b06062fc483 100644 --- a/src/include/txn.i +++ b/src/include/txn.i @@ -26,7 +26,7 @@ __txn_next_op(WT_SESSION_IMPL *session, WT_TXN_OP **opp) * Make sure we have allocated a transaction ID. */ WT_RET(__wt_txn_id_check(session)); - WT_ASSERT(session, F_ISSET(txn, TXN_HAS_ID)); + WT_ASSERT(session, F_ISSET(txn, WT_TXN_HAS_ID)); WT_RET(__wt_realloc_def(session, &txn->mod_alloc, txn->mod_count + 1, &txn->mod)); @@ -49,7 +49,7 @@ __wt_txn_unmodify(WT_SESSION_IMPL *session) WT_TXN *txn; txn = &session->txn; - if (F_ISSET(txn, TXN_HAS_ID)) { + if (F_ISSET(txn, WT_TXN_HAS_ID)) { WT_ASSERT(session, txn->mod_count > 0); txn->mod_count--; } @@ -67,7 +67,7 @@ __wt_txn_modify(WT_SESSION_IMPL *session, WT_UPDATE *upd) WT_RET(__txn_next_op(session, &op)); op->type = F_ISSET(session, WT_SESSION_LOGGING_INMEM) ? - TXN_OP_INMEM : TXN_OP_BASIC; + WT_TXN_OP_INMEM : WT_TXN_OP_BASIC; op->u.upd = upd; upd->txnid = session->txn.id; return (ret); @@ -83,7 +83,7 @@ __wt_txn_modify_ref(WT_SESSION_IMPL *session, WT_REF *ref) WT_TXN_OP *op; WT_RET(__txn_next_op(session, &op)); - op->type = TXN_OP_REF; + op->type = WT_TXN_OP_REF; op->u.ref = ref; return (__wt_txn_log_op(session, NULL)); } @@ -118,14 +118,14 @@ __wt_txn_visible_all(WT_SESSION_IMPL *session, uint64_t id) */ if (checkpoint_snap_min != WT_TXN_NONE && (btree == NULL || btree->checkpoint_gen != txn_global->checkpoint_gen) && - TXNID_LT(checkpoint_snap_min, oldest_id)) + WT_TXNID_LT(checkpoint_snap_min, oldest_id)) /* * Use the checkpoint ID for the visibility check if it is the * oldest ID in the system. */ oldest_id = checkpoint_snap_min; - return (TXNID_LT(id, oldest_id)); + return (WT_TXNID_LT(id, oldest_id)); } /* @@ -151,7 +151,7 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) * Eviction only sees globally visible updates, or if there is a * checkpoint transaction running, use its transaction. */ - if (txn->isolation == TXN_ISO_EVICTION) + if (txn->isolation == WT_ISO_EVICTION) return (__wt_txn_visible_all(session, id)); /* @@ -164,7 +164,7 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) * Metadata updates use non-transactional techniques (such as the * schema and metadata locks) to protect access to in-flight updates. */ - if (txn->isolation == TXN_ISO_READ_UNCOMMITTED || + if (txn->isolation == WT_ISO_READ_UNCOMMITTED || session->dhandle == session->meta_dhandle) return (1); @@ -173,7 +173,7 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) return (1); /* - * TXN_ISO_SNAPSHOT, TXN_ISO_READ_COMMITTED: the ID is visible if it is + * WT_ISO_SNAPSHOT, WT_ISO_READ_COMMITTED: the ID is visible if it is * not the result of a concurrent transaction, that is, if was * committed before the snapshot was taken. * @@ -181,9 +181,9 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) * saw when taking the snapshot should be invisible, even if the * snapshot is empty. */ - if (TXNID_LE(txn->snap_max, id)) + if (WT_TXNID_LE(txn->snap_max, id)) return (0); - if (txn->snapshot_count == 0 || TXNID_LT(id, txn->snap_min)) + if (txn->snapshot_count == 0 || WT_TXNID_LT(id, txn->snap_min)) return (1); return (bsearch(&id, txn->snapshot, txn->snapshot_count, @@ -219,7 +219,7 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[]) if (cfg != NULL) WT_RET(__wt_txn_config(session, cfg)); - if (txn->isolation == TXN_ISO_SNAPSHOT) { + if (txn->isolation == WT_ISO_SNAPSHOT) { if (session->ncursors > 0) WT_RET(__wt_session_copy_values(session)); @@ -232,7 +232,7 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[]) __wt_txn_get_snapshot(session); } - F_SET(txn, TXN_RUNNING); + F_SET(txn, WT_TXN_RUNNING); return (0); } @@ -246,8 +246,8 @@ __wt_txn_autocommit_check(WT_SESSION_IMPL *session) WT_TXN *txn; txn = &session->txn; - if (F_ISSET(txn, TXN_AUTOCOMMIT)) { - F_CLR(txn, TXN_AUTOCOMMIT); + if (F_ISSET(txn, WT_TXN_AUTOCOMMIT)) { + F_CLR(txn, WT_TXN_AUTOCOMMIT); return (__wt_txn_begin(session, NULL)); } return (0); @@ -287,10 +287,10 @@ __wt_txn_idle_cache_check(WT_SESSION_IMPL *session) /* * Check the published snap_min because read-uncommitted never sets - * TXN_HAS_SNAPSHOT. + * WT_TXN_HAS_SNAPSHOT. */ - if (F_ISSET(txn, TXN_RUNNING) && - !F_ISSET(txn, TXN_HAS_ID) && txn_state->snap_min == WT_TXN_NONE) + if (F_ISSET(txn, WT_TXN_RUNNING) && + !F_ISSET(txn, WT_TXN_HAS_ID) && txn_state->snap_min == WT_TXN_NONE) WT_RET(__wt_cache_full_check(session)); return (0); @@ -311,12 +311,12 @@ __wt_txn_id_check(WT_SESSION_IMPL *session) txn = &session->txn; - WT_ASSERT(session, F_ISSET(txn, TXN_RUNNING)); + WT_ASSERT(session, F_ISSET(txn, WT_TXN_RUNNING)); /* If the transaction is idle, check that the cache isn't full. */ WT_RET(__wt_txn_idle_cache_check(session)); - if (!F_ISSET(txn, TXN_HAS_ID)) { + if (!F_ISSET(txn, WT_TXN_HAS_ID)) { conn = S2C(session); txn_global = &conn->txn_global; txn_state = &txn_global->states[session->id]; @@ -352,7 +352,7 @@ __wt_txn_id_check(WT_SESSION_IMPL *session) */ if (txn->id == WT_TXN_ABORTED) WT_RET_MSG(session, ENOMEM, "Out of transaction IDs"); - F_SET(txn, TXN_HAS_ID); + F_SET(txn, WT_TXN_HAS_ID); } return (0); @@ -368,7 +368,7 @@ __wt_txn_update_check(WT_SESSION_IMPL *session, WT_UPDATE *upd) WT_TXN *txn; txn = &session->txn; - if (txn->isolation == TXN_ISO_SNAPSHOT) + if (txn->isolation == WT_ISO_SNAPSHOT) while (upd != NULL && !__wt_txn_visible(session, upd->txnid)) { if (upd->txnid != WT_TXN_ABORTED) { WT_STAT_FAST_DATA_INCR( @@ -393,8 +393,8 @@ __wt_txn_read_last(WT_SESSION_IMPL *session) txn = &session->txn; /* Release the snap_min ID we put in the global table. */ - if (!F_ISSET(txn, TXN_RUNNING) || - txn->isolation != TXN_ISO_SNAPSHOT) + if (!F_ISSET(txn, WT_TXN_RUNNING) || + txn->isolation != WT_ISO_SNAPSHOT) __wt_txn_release_snapshot(session); } @@ -429,13 +429,13 @@ __wt_txn_cursor_op(WT_SESSION_IMPL *session) * further forward, so that once a read-uncommitted cursor is * positioned on a value, it can't be freed. */ - if (txn->isolation == TXN_ISO_READ_UNCOMMITTED && - !F_ISSET(txn, TXN_HAS_ID) && - TXNID_LT(txn_state->snap_min, txn_global->last_running)) + if (txn->isolation == WT_ISO_READ_UNCOMMITTED && + !F_ISSET(txn, WT_TXN_HAS_ID) && + WT_TXNID_LT(txn_state->snap_min, txn_global->last_running)) txn_state->snap_min = txn_global->last_running; - if (txn->isolation != TXN_ISO_READ_UNCOMMITTED && - !F_ISSET(txn, TXN_HAS_SNAPSHOT)) + if (txn->isolation != WT_ISO_READ_UNCOMMITTED && + !F_ISSET(txn, WT_TXN_HAS_SNAPSHOT)) __wt_txn_get_snapshot(session); } @@ -462,7 +462,7 @@ __wt_txn_am_oldest(WT_SESSION_IMPL *session) WT_ORDERED_READ(session_cnt, conn->session_cnt); for (i = 0, s = txn_global->states; i < session_cnt; i++, s++) - if ((id = s->id) != WT_TXN_NONE && TXNID_LT(id, txn->id)) + if ((id = s->id) != WT_TXN_NONE && WT_TXNID_LT(id, txn->id)) return (0); return (1); diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c index e97f4522f48..672e0db8233 100644 --- a/src/lsm/lsm_cursor.c +++ b/src/lsm/lsm_cursor.c @@ -112,10 +112,10 @@ __clsm_enter_update(WT_CURSOR_LSM *clsm) } else { primary = clsm->cursors[clsm->nchunks - 1]; primary_chunk = clsm->primary_chunk; - WT_ASSERT(session, F_ISSET(&session->txn, TXN_HAS_ID)); + WT_ASSERT(session, F_ISSET(&session->txn, WT_TXN_HAS_ID)); have_primary = (primary != NULL && primary_chunk != NULL && (primary_chunk->switch_txn == WT_TXN_NONE || - TXNID_LT(session->txn.id, primary_chunk->switch_txn))); + WT_TXNID_LT(session->txn.id, primary_chunk->switch_txn))); } /* @@ -165,11 +165,13 @@ __clsm_enter(WT_CURSOR_LSM *clsm, int reset, int update) WT_DECL_RET; WT_LSM_TREE *lsm_tree; WT_SESSION_IMPL *session; + WT_TXN *txn; uint64_t *switch_txnp; uint64_t snap_min; lsm_tree = clsm->lsm_tree; session = (WT_SESSION_IMPL *)clsm->iface.session; + txn = &session->txn; /* Merge cursors never update. */ if (F_ISSET(clsm, WT_CLSM_MERGE)) @@ -207,7 +209,7 @@ __clsm_enter(WT_CURSOR_LSM *clsm, int reset, int update) if (clsm->dsk_gen != clsm->lsm_tree->dsk_gen) goto open; - if (session->txn.isolation == TXN_ISO_SNAPSHOT) + if (txn->isolation == WT_ISO_SNAPSHOT) __wt_txn_cursor_op(session); /* @@ -220,16 +222,16 @@ __clsm_enter(WT_CURSOR_LSM *clsm, int reset, int update) * conflict. */ clsm->nupdates = 1; - if (session->txn.isolation == TXN_ISO_SNAPSHOT && + if (txn->isolation == WT_ISO_SNAPSHOT && F_ISSET(clsm, WT_CLSM_OPEN_SNAPSHOT)) { WT_ASSERT(session, - F_ISSET(&session->txn, TXN_HAS_SNAPSHOT)); - snap_min = session->txn.snap_min; + F_ISSET(txn, WT_TXN_HAS_SNAPSHOT)); + snap_min = txn->snap_min; for (switch_txnp = &clsm->switch_txn[clsm->nchunks - 2]; clsm->nupdates < clsm->nchunks; clsm->nupdates++, switch_txnp--) { - if (TXNID_LT(*switch_txnp, snap_min)) + if (WT_TXNID_LT(*switch_txnp, snap_min)) break; WT_ASSERT(session, !__wt_txn_visible_all( @@ -246,7 +248,7 @@ __clsm_enter(WT_CURSOR_LSM *clsm, int reset, int update) * - a read operation and the cursor is open for reading. */ if ((!update || - session->txn.isolation != TXN_ISO_SNAPSHOT || + txn->isolation != WT_ISO_SNAPSHOT || F_ISSET(clsm, WT_CLSM_OPEN_SNAPSHOT)) && ((update && clsm->primary_chunk != NULL) || (!update && F_ISSET(clsm, WT_CLSM_OPEN_READ)))) @@ -418,7 +420,7 @@ __clsm_open_cursors( * Ensure that any snapshot update has cursors on the right set of * chunks to guarantee visibility is correct. */ - if (update && txn->isolation == TXN_ISO_SNAPSHOT) + if (update && txn->isolation == WT_ISO_SNAPSHOT) F_SET(clsm, WT_CLSM_OPEN_SNAPSHOT); /* @@ -1286,10 +1288,10 @@ __clsm_put(WT_SESSION_IMPL *session, lsm_tree = clsm->lsm_tree; WT_ASSERT(session, - F_ISSET(&session->txn, TXN_HAS_ID) && + F_ISSET(&session->txn, WT_TXN_HAS_ID) && clsm->primary_chunk != NULL && (clsm->primary_chunk->switch_txn == WT_TXN_NONE || - TXNID_LE(session->txn.id, clsm->primary_chunk->switch_txn))); + WT_TXNID_LE(session->txn.id, clsm->primary_chunk->switch_txn))); /* * Clear the existing cursor position. Don't clear the primary cursor: diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c index 0533e628601..4be0cd2a09c 100644 --- a/src/lsm/lsm_manager.c +++ b/src/lsm/lsm_manager.c @@ -227,7 +227,7 @@ __wt_lsm_manager_start(WT_SESSION_IMPL *session) for (i = 0; i < WT_LSM_MAX_WORKERS; i++) { WT_ERR(__wt_open_internal_session( S2C(session), "lsm-worker", 1, 0, &worker_session)); - worker_session->isolation = TXN_ISO_READ_UNCOMMITTED; + worker_session->isolation = WT_ISO_READ_UNCOMMITTED; manager->lsm_worker_cookies[i].session = worker_session; } diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c index 1145c329639..33174c2d40d 100644 --- a/src/lsm/lsm_work_unit.c +++ b/src/lsm/lsm_work_unit.c @@ -307,7 +307,7 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session, if ((ret = __wt_session_get_btree( session, chunk->uri, NULL, NULL, 0)) == 0) { saved_isolation = session->txn.isolation; - session->txn.isolation = TXN_ISO_EVICTION; + session->txn.isolation = WT_ISO_EVICTION; ret = __wt_cache_op(session, NULL, WT_SYNC_WRITE_LEAVES); session->txn.isolation = saved_isolation; WT_TRET(__wt_session_release_btree(session)); diff --git a/src/reconcile/rec_track.c b/src/reconcile/rec_track.c index 2533ad9e201..e417dbfaa83 100644 --- a/src/reconcile/rec_track.c +++ b/src/reconcile/rec_track.c @@ -722,7 +722,7 @@ __ovfl_txnc_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page) */ for (i = WT_SKIP_MAXDEPTH - 1; i > 0; --i) for (e = &head[i]; (txnc = *e) != NULL;) { - if (TXNID_LE(oldest_txn, txnc->current)) { + if (WT_TXNID_LE(oldest_txn, txnc->current)) { e = &txnc->next[i]; continue; } @@ -732,7 +732,7 @@ __ovfl_txnc_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page) /* Second, discard any no longer needed transaction-cache records. */ decr = 0; for (e = &head[0]; (txnc = *e) != NULL;) { - if (TXNID_LE(oldest_txn, txnc->current)) { + if (WT_TXNID_LE(oldest_txn, txnc->current)) { e = &txnc->next[0]; continue; } diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index 76d61642bfd..809d18d74f5 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -862,11 +862,11 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r, continue; /* Track the largest/smallest transaction IDs on the list. */ - if (TXNID_LT(max_txn, txnid)) + if (WT_TXNID_LT(max_txn, txnid)) max_txn = txnid; - if (TXNID_LT(txnid, min_txn)) + if (WT_TXNID_LT(txnid, min_txn)) min_txn = txnid; - if (TXNID_LT(txnid, r->skipped_txn) && + if (WT_TXNID_LT(txnid, r->skipped_txn) && !__wt_txn_visible_all(session, txnid)) r->skipped_txn = txnid; @@ -894,7 +894,7 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r, * used to avoid evicting clean pages from memory with changes required * to satisfy a snapshot read. */ - if (TXNID_LT(r->max_txn, max_txn)) + if (WT_TXNID_LT(r->max_txn, max_txn)) r->max_txn = max_txn; /* diff --git a/src/session/session_api.c b/src/session/session_api.c index 2aa8e924302..7951b3ff50d 100644 --- a/src/session/session_api.c +++ b/src/session/session_api.c @@ -95,7 +95,7 @@ __session_close(WT_SESSION *wt_session, const char *config) WT_UNUSED(cfg); /* Rollback any active transaction. */ - if (F_ISSET(&session->txn, TXN_RUNNING)) + if (F_ISSET(&session->txn, WT_TXN_RUNNING)) WT_TRET(__session_rollback_transaction(wt_session, NULL)); /* @@ -193,7 +193,7 @@ __session_reconfigure(WT_SESSION *wt_session, const char *config) session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, reconfigure, config, cfg); - if (F_ISSET(&session->txn, TXN_RUNNING)) + if (F_ISSET(&session->txn, WT_TXN_RUNNING)) WT_ERR_MSG(session, EINVAL, "transaction in progress"); WT_TRET(__wt_session_reset_cursors(session)); @@ -202,9 +202,9 @@ __session_reconfigure(WT_SESSION *wt_session, const char *config) if (cval.len != 0) session->isolation = session->txn.isolation = WT_STRING_MATCH("snapshot", cval.str, cval.len) ? - TXN_ISO_SNAPSHOT : + WT_ISO_SNAPSHOT : WT_STRING_MATCH("read-uncommitted", cval.str, cval.len) ? - TXN_ISO_READ_UNCOMMITTED : TXN_ISO_READ_COMMITTED; + WT_ISO_READ_UNCOMMITTED : WT_ISO_READ_COMMITTED; err: API_END_RET_NOTFOUND_MAP(session, ret); } @@ -757,7 +757,7 @@ __session_begin_transaction(WT_SESSION *wt_session, const char *config) SESSION_API_CALL(session, begin_transaction, config, cfg); WT_STAT_FAST_CONN_INCR(session, txn_begin); - if (F_ISSET(&session->txn, TXN_RUNNING)) + if (F_ISSET(&session->txn, WT_TXN_RUNNING)) WT_ERR_MSG(session, EINVAL, "Transaction already running"); ret = __wt_txn_begin(session, cfg); @@ -781,7 +781,7 @@ __session_commit_transaction(WT_SESSION *wt_session, const char *config) WT_STAT_FAST_CONN_INCR(session, txn_commit); txn = &session->txn; - if (F_ISSET(txn, TXN_ERROR)) { + if (F_ISSET(txn, WT_TXN_ERROR)) { __wt_errx(session, "failed transaction requires rollback"); ret = EINVAL; } @@ -836,7 +836,7 @@ __session_transaction_pinned_range(WT_SESSION *wt_session, uint64_t *prange) /* Assign pinned to the lesser of id or snap_min */ if (txn_state->id != WT_TXN_NONE && - TXNID_LT(txn_state->id, txn_state->snap_min)) + WT_TXNID_LT(txn_state->id, txn_state->snap_min)) pinned = txn_state->id; else pinned = txn_state->snap_min; @@ -880,7 +880,7 @@ __session_checkpoint(WT_SESSION *wt_session, const char *config) * from evicting anything newer than this because we track the oldest * transaction ID in the system that is not visible to all readers. */ - if (F_ISSET(txn, TXN_RUNNING)) + if (F_ISSET(txn, WT_TXN_RUNNING)) WT_ERR_MSG(session, EINVAL, "Checkpoint not permitted in a transaction"); @@ -1066,7 +1066,7 @@ __wt_open_session(WT_CONNECTION_IMPL *conn, } /* Initialize transaction support: default to read-committed. */ - session_ret->isolation = TXN_ISO_READ_COMMITTED; + session_ret->isolation = WT_ISO_READ_COMMITTED; WT_ERR(__wt_txn_init(session_ret)); /* diff --git a/src/session/session_compact.c b/src/session/session_compact.c index 2a18eb3be93..d4fd52ec8bd 100644 --- a/src/session/session_compact.c +++ b/src/session/session_compact.c @@ -161,7 +161,7 @@ __compact_file(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]) * transactional context. Check now so the error message isn't * confusing. */ - if (session->compact->file_count != 0 && F_ISSET(txn, TXN_RUNNING)) + if (session->compact->file_count != 0 && F_ISSET(txn, WT_TXN_RUNNING)) WT_ERR_MSG(session, EINVAL, " File compaction not permitted in a transaction"); diff --git a/src/txn/txn.c b/src/txn/txn.c index 05b27cd9a56..0492e39342f 100644 --- a/src/txn/txn.c +++ b/src/txn/txn.c @@ -20,7 +20,7 @@ __wt_txnid_cmp(const void *v1, const void *v2) id1 = *(uint64_t *)v1; id2 = *(uint64_t *)v2; - return ((id1 == id2) ? 0 : TXNID_LT(id1, id2) ? -1 : 1); + return ((id1 == id2) ? 0 : WT_TXNID_LT(id1, id2) ? -1 : 1); } /* @@ -35,15 +35,15 @@ __txn_sort_snapshot(WT_SESSION_IMPL *session, uint32_t n, uint64_t snap_max) txn = &session->txn; if (n <= 10) - WT_INSERTION_SORT(txn->snapshot, n, uint64_t, TXNID_LT); + WT_INSERTION_SORT(txn->snapshot, n, uint64_t, WT_TXNID_LT); else qsort(txn->snapshot, n, sizeof(uint64_t), __wt_txnid_cmp); txn->snapshot_count = n; txn->snap_max = snap_max; - txn->snap_min = (n > 0 && TXNID_LE(txn->snapshot[0], snap_max)) ? + txn->snap_min = (n > 0 && WT_TXNID_LE(txn->snapshot[0], snap_max)) ? txn->snapshot[0] : snap_max; - F_SET(txn, TXN_HAS_SNAPSHOT); + F_SET(txn, WT_TXN_HAS_SNAPSHOT); WT_ASSERT(session, n == 0 || txn->snap_min != WT_TXN_NONE); } @@ -62,11 +62,11 @@ __wt_txn_release_snapshot(WT_SESSION_IMPL *session) WT_ASSERT(session, txn_state->snap_min == WT_TXN_NONE || - session->txn.isolation == TXN_ISO_READ_UNCOMMITTED || + session->txn.isolation == WT_ISO_READ_UNCOMMITTED || !__wt_txn_visible_all(session, txn_state->snap_min)); txn_state->snap_min = WT_TXN_NONE; - F_CLR(txn, TXN_HAS_SNAPSHOT); + F_CLR(txn, WT_TXN_HAS_SNAPSHOT); } /* @@ -139,9 +139,9 @@ __wt_txn_get_snapshot(WT_SESSION_IMPL *session) */ if (s != txn_state && (id = s->id) != WT_TXN_NONE && - TXNID_LE(prev_oldest_id, id)) { + WT_TXNID_LE(prev_oldest_id, id)) { txn->snapshot[n++] = id; - if (TXNID_LT(id, snap_min)) + if (WT_TXNID_LT(id, snap_min)) snap_min = id; } } @@ -150,7 +150,7 @@ __wt_txn_get_snapshot(WT_SESSION_IMPL *session) * If we got a new snapshot, update the published snap_min for this * session. */ - WT_ASSERT(session, TXNID_LE(prev_oldest_id, snap_min)); + WT_ASSERT(session, WT_TXNID_LE(prev_oldest_id, snap_min)); WT_ASSERT(session, prev_oldest_id == txn_global->oldest_id); txn_state->snap_min = snap_min; @@ -201,7 +201,7 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, int force) * oldest ID isn't too far behind, avoid scanning. */ if (prev_oldest_id == current_id || - (!force && TXNID_LT(current_id, prev_oldest_id + 100))) + (!force && WT_TXNID_LT(current_id, prev_oldest_id + 100))) return; /* @@ -236,7 +236,8 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, int force) * it gets a valid one. */ if ((id = s->id) != WT_TXN_NONE && - TXNID_LE(prev_oldest_id, id) && TXNID_LT(id, snap_min)) + WT_TXNID_LE(prev_oldest_id, id) && + WT_TXNID_LT(id, snap_min)) snap_min = id; /* @@ -248,24 +249,24 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, int force) * more details. */ if ((id = s->snap_min) != WT_TXN_NONE && - TXNID_LT(id, oldest_id)) { + WT_TXNID_LT(id, oldest_id)) { oldest_id = id; oldest_session = &conn->sessions[i]; } } - if (TXNID_LT(snap_min, oldest_id)) + if (WT_TXNID_LT(snap_min, oldest_id)) oldest_id = snap_min; /* Update the last running ID. */ - if (TXNID_LT(txn_global->last_running, snap_min)) { + if (WT_TXNID_LT(txn_global->last_running, snap_min)) { txn_global->last_running = snap_min; last_running_moved = 1; } else last_running_moved = 0; /* Update the oldest ID. */ - if (TXNID_LT(prev_oldest_id, oldest_id) && + if (WT_TXNID_LT(prev_oldest_id, oldest_id) && WT_ATOMIC_CAS4(txn_global->scan_count, 1, -1)) { WT_ORDERED_READ(session_cnt, conn->session_cnt); ckpt_id = txn_global->checkpoint_id; @@ -278,13 +279,13 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, int force) continue; if ((id = s->id) != WT_TXN_NONE && - TXNID_LT(id, oldest_id)) + WT_TXNID_LT(id, oldest_id)) oldest_id = id; if ((id = s->snap_min) != WT_TXN_NONE && - TXNID_LT(id, oldest_id)) + WT_TXNID_LT(id, oldest_id)) oldest_id = id; } - if (TXNID_LT(txn_global->oldest_id, oldest_id)) + if (WT_TXNID_LT(txn_global->oldest_id, oldest_id)) txn_global->oldest_id = oldest_id; txn_global->scan_count = 0; } else { @@ -320,9 +321,9 @@ __wt_txn_config(WT_SESSION_IMPL *session, const char *cfg[]) if (cval.len != 0) txn->isolation = WT_STRING_MATCH("snapshot", cval.str, cval.len) ? - TXN_ISO_SNAPSHOT : + WT_ISO_SNAPSHOT : WT_STRING_MATCH("read-committed", cval.str, cval.len) ? - TXN_ISO_READ_COMMITTED : TXN_ISO_READ_UNCOMMITTED; + WT_ISO_READ_COMMITTED : WT_ISO_READ_UNCOMMITTED; /* * The default sync setting is inherited from the connection, but can @@ -360,7 +361,7 @@ __wt_txn_release(WT_SESSION_IMPL *session) txn_state = &txn_global->states[session->id]; /* Clear the transaction's ID from the global table. */ - if (F_ISSET(txn, TXN_HAS_ID)) { + if (F_ISSET(txn, WT_TXN_HAS_ID)) { WT_ASSERT(session, txn_state->id != WT_TXN_NONE && txn->id != WT_TXN_NONE); WT_PUBLISH(txn_state->id, WT_TXN_NONE); @@ -380,7 +381,7 @@ __wt_txn_release(WT_SESSION_IMPL *session) */ __wt_txn_release_snapshot(session); txn->isolation = session->isolation; - F_CLR(txn, TXN_ERROR | TXN_HAS_ID | TXN_RUNNING); + F_CLR(txn, WT_TXN_ERROR | WT_TXN_HAS_ID | WT_TXN_RUNNING); } /* @@ -396,9 +397,9 @@ __wt_txn_commit(WT_SESSION_IMPL *session, const char *cfg[]) u_int i; txn = &session->txn; - WT_ASSERT(session, !F_ISSET(txn, TXN_ERROR)); + WT_ASSERT(session, !F_ISSET(txn, WT_TXN_ERROR)); - if (!F_ISSET(txn, TXN_RUNNING)) + if (!F_ISSET(txn, WT_TXN_RUNNING)) WT_RET_MSG(session, EINVAL, "No transaction is active"); /* Commit notification. */ @@ -462,7 +463,7 @@ __wt_txn_rollback(WT_SESSION_IMPL *session, const char *cfg[]) WT_UNUSED(cfg); txn = &session->txn; - if (!F_ISSET(txn, TXN_RUNNING)) + if (!F_ISSET(txn, WT_TXN_RUNNING)) WT_RET_MSG(session, EINVAL, "No transaction is active"); /* Rollback notification. */ @@ -477,20 +478,20 @@ __wt_txn_rollback(WT_SESSION_IMPL *session, const char *cfg[]) continue; switch (op->type) { - case TXN_OP_BASIC: - case TXN_OP_INMEM: + case WT_TXN_OP_BASIC: + case WT_TXN_OP_INMEM: op->u.upd->txnid = WT_TXN_ABORTED; break; - case TXN_OP_REF: + case WT_TXN_OP_REF: __wt_delete_page_rollback(session, op->u.ref); break; - case TXN_OP_TRUNCATE_COL: - case TXN_OP_TRUNCATE_ROW: + case WT_TXN_OP_TRUNCATE_COL: + case WT_TXN_OP_TRUNCATE_ROW: /* * Nothing to do: these operations are only logged for * recovery. The in-memory changes will be rolled back - * with a combination of TXN_OP_REF and TXN_OP_INMEM - * operations. + * with a combination of WT_TXN_OP_REF and + * WT_TXN_OP_INMEM operations. */ break; } diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c index 1ae593fd6be..8e2e55c5424 100644 --- a/src/txn/txn_ckpt.c +++ b/src/txn/txn_ckpt.c @@ -397,7 +397,7 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) "starting write leaves", &verb_timer)); /* Flush dirty leaf pages before we start the checkpoint. */ - session->isolation = txn->isolation = TXN_ISO_READ_COMMITTED; + session->isolation = txn->isolation = WT_ISO_READ_COMMITTED; WT_ERR(__checkpoint_apply(session, cfg, __checkpoint_write_leaves)); /* @@ -497,7 +497,7 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) * to open one. We are holding other handle locks, it is not safe to * lock conn->spinlock. */ - session->isolation = txn->isolation = TXN_ISO_READ_UNCOMMITTED; + session->isolation = txn->isolation = WT_ISO_READ_UNCOMMITTED; saved_meta_next = session->meta_track_next; session->meta_track_next = NULL; WT_WITH_DHANDLE(session, @@ -531,11 +531,11 @@ err: /* * overwritten the checkpoint, so what ends up on disk is not * consistent. */ - session->isolation = txn->isolation = TXN_ISO_READ_UNCOMMITTED; + session->isolation = txn->isolation = WT_ISO_READ_UNCOMMITTED; if (tracking) WT_TRET(__wt_meta_track_off(session, 0, ret != 0)); - if (F_ISSET(txn, TXN_RUNNING)) { + if (F_ISSET(txn, WT_TXN_RUNNING)) { /* * Clear the dhandle so the visibility check doesn't get * confused about the snap min. Don't bother restoring the diff --git a/src/txn/txn_ext.c b/src/txn/txn_ext.c index e35b6f16ea1..36d42a8996f 100644 --- a/src/txn/txn_ext.c +++ b/src/txn/txn_ext.c @@ -40,9 +40,9 @@ __wt_ext_transaction_isolation_level( session = (WT_SESSION_IMPL *)wt_session; txn = &session->txn; - if (txn->isolation == TXN_ISO_READ_COMMITTED) + if (txn->isolation == WT_ISO_READ_COMMITTED) return (WT_TXN_ISO_READ_COMMITTED); - if (txn->isolation == TXN_ISO_READ_UNCOMMITTED) + if (txn->isolation == WT_ISO_READ_UNCOMMITTED) return (WT_TXN_ISO_READ_UNCOMMITTED); return (WT_TXN_ISO_SNAPSHOT); } diff --git a/src/txn/txn_log.c b/src/txn/txn_log.c index 901785628e1..9b6a3d46014 100644 --- a/src/txn/txn_log.c +++ b/src/txn/txn_log.c @@ -97,13 +97,13 @@ void __wt_txn_op_free(WT_SESSION_IMPL *session, WT_TXN_OP *op) { switch (op->type) { - case TXN_OP_BASIC: - case TXN_OP_INMEM: - case TXN_OP_REF: - case TXN_OP_TRUNCATE_COL: + case WT_TXN_OP_BASIC: + case WT_TXN_OP_INMEM: + case WT_TXN_OP_REF: + case WT_TXN_OP_TRUNCATE_COL: break; - case TXN_OP_TRUNCATE_ROW: + case WT_TXN_OP_TRUNCATE_ROW: __wt_buf_free(session, &op->u.truncate_row.start); __wt_buf_free(session, &op->u.truncate_row.stop); break; @@ -163,7 +163,7 @@ __wt_txn_log_op(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) /* We'd better have a transaction. */ WT_ASSERT(session, - F_ISSET(txn, TXN_RUNNING) && F_ISSET(txn, TXN_HAS_ID)); + F_ISSET(txn, WT_TXN_RUNNING) && F_ISSET(txn, WT_TXN_HAS_ID)); WT_ASSERT(session, txn->mod_count > 0); op = txn->mod + txn->mod_count - 1; @@ -172,17 +172,17 @@ __wt_txn_log_op(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) logrec = txn->logrec; switch (op->type) { - case TXN_OP_BASIC: + case WT_TXN_OP_BASIC: return (__txn_op_log(session, logrec, op, cbt)); - case TXN_OP_INMEM: - case TXN_OP_REF: + case WT_TXN_OP_INMEM: + case WT_TXN_OP_REF: /* Nothing to log, we're done. */ return (0); - case TXN_OP_TRUNCATE_COL: + case WT_TXN_OP_TRUNCATE_COL: return (__wt_logop_col_truncate_pack(session, logrec, op->fileid, op->u.truncate_col.start, op->u.truncate_col.stop)); - case TXN_OP_TRUNCATE_ROW: + case WT_TXN_OP_TRUNCATE_ROW: return (__wt_logop_row_truncate_pack(session, txn->logrec, op->fileid, &op->u.truncate_row.start, &op->u.truncate_row.stop, @@ -387,12 +387,12 @@ __wt_txn_truncate_log( WT_RET(__txn_next_op(session, &op)); if (btree->type == BTREE_ROW) { - op->type = TXN_OP_TRUNCATE_ROW; - op->u.truncate_row.mode = TXN_TRUNC_ALL; + op->type = WT_TXN_OP_TRUNCATE_ROW; + op->u.truncate_row.mode = WT_TXN_TRUNC_ALL; WT_CLEAR(op->u.truncate_row.start); WT_CLEAR(op->u.truncate_row.stop); if (start != NULL) { - op->u.truncate_row.mode = TXN_TRUNC_START; + op->u.truncate_row.mode = WT_TXN_TRUNC_START; item = &op->u.truncate_row.start; WT_RET(__wt_cursor_get_raw_key(&start->iface, item)); WT_RET(__wt_buf_set( @@ -400,15 +400,15 @@ __wt_txn_truncate_log( } if (stop != NULL) { op->u.truncate_row.mode = - (op->u.truncate_row.mode == TXN_TRUNC_ALL) ? - TXN_TRUNC_STOP : TXN_TRUNC_BOTH; + (op->u.truncate_row.mode == WT_TXN_TRUNC_ALL) ? + WT_TXN_TRUNC_STOP : WT_TXN_TRUNC_BOTH; item = &op->u.truncate_row.stop; WT_RET(__wt_cursor_get_raw_key(&stop->iface, item)); WT_RET(__wt_buf_set( session, item, item->data, item->size)); } } else { - op->type = TXN_OP_TRUNCATE_COL; + op->type = WT_TXN_OP_TRUNCATE_COL; op->u.truncate_col.start = (start == NULL) ? 0 : start->recno; op->u.truncate_col.stop = diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c index 540b0528995..f11b585da1c 100644 --- a/src/txn/txn_recover.c +++ b/src/txn/txn_recover.c @@ -194,18 +194,18 @@ __txn_op_apply( /* Set up the cursors. */ start = stop = NULL; switch (mode) { - case TXN_TRUNC_ALL: + case WT_TXN_TRUNC_ALL: /* Both cursors stay NULL. */ break; - case TXN_TRUNC_BOTH: + case WT_TXN_TRUNC_BOTH: start = cursor; WT_ERR(__recovery_cursor( session, r, lsnp, fileid, 1, &stop)); break; - case TXN_TRUNC_START: + case WT_TXN_TRUNC_START: start = cursor; break; - case TXN_TRUNC_STOP: + case WT_TXN_TRUNC_STOP: stop = cursor; break; |