summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-09-17 17:04:05 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-09-17 17:04:05 +1000
commitacd82388d8cb4fea297151921771364b15e16067 (patch)
tree663dccce1352728128dc40564dd7940fed161903
parenta41e390920d160f0a179d47ec2cf829dcfd64ef4 (diff)
downloadmongo-acd82388d8cb4fea297151921771364b15e16067.tar.gz
When fiddling with isolation during phases of __wt_checkpoint, be careful to restore it correctly.
-rw-r--r--src/txn/txn_ckpt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index 8c2ce77a9e3..e873e1affd4 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -276,6 +276,7 @@ __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
WT_TXN *txn;
+ WT_TXN_ISOLATION saved_isolation;
const char *name;
char *name_alloc;
int deleted, is_checkpoint;
@@ -284,6 +285,8 @@ __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
btree = session->btree;
ckpt = ckptbase = NULL;
name_alloc = NULL;
+ txn = &session->txn;
+ saved_isolation = txn->isolation;
/*
* We're called in two ways: either because a handle is closing or
@@ -493,7 +496,7 @@ __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
/* If closing a handle, include everything in the checkpoint. */
if (!is_checkpoint)
- session->txn.isolation = TXN_ISO_READ_UNCOMMITTED;
+ txn->isolation = TXN_ISO_READ_UNCOMMITTED;
/* Flush the file from the cache, creating the checkpoint. */
WT_ERR(__wt_bt_cache_flush(session,
@@ -503,7 +506,6 @@ __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
txn = &session->txn;
txn->isolation = TXN_ISO_READ_UNCOMMITTED;
ret = __wt_meta_ckptlist_set(session, btree->name, ckptbase);
- txn->isolation = TXN_ISO_SNAPSHOT;
WT_ERR(ret);
/*
@@ -520,9 +522,7 @@ __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
err:
skip: __wt_meta_ckptlist_free(session, ckptbase);
__wt_free(session, name_alloc);
-
- if (!is_checkpoint)
- session->txn.isolation = session->isolation;
+ txn->isolation = saved_isolation;
return (ret);
}