summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-05-29 11:41:45 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-05-29 11:41:45 -0400
commit07f8ccf2b5350128d42319992cda0624b9811c10 (patch)
tree03dff25803f44b5ee6fecfd8095ef8a05e5ed846
parentc07a82945380041833c85ad4e40254a09db30221 (diff)
downloadmongo-07f8ccf2b5350128d42319992cda0624b9811c10.tar.gz
Because the way the code was last written, the variable logging was
never set unless doing a full checkpoint, and the change in 32de75 to set logging earlier in the function broke that semantic. Fix it all up.
-rw-r--r--src/txn/txn_ckpt.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index 7ba118b585f..16a7aa86754 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -359,8 +359,7 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
txn = &session->txn;
txn_global = &conn->txn_global;
saved_isolation = session->isolation;
- logging = FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED) ? 1 : 0;
- full = idle = tracking = 0;
+ full = idle = logging = tracking = 0;
/* Ensure the metadata table is open before taking any locks. */
WT_RET(__wt_metadata_open(session));
@@ -371,6 +370,9 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
*/
WT_RET(__checkpoint_apply_all(session, cfg, NULL, &full));
+ /* Configure logging. */
+ logging = full && FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED);
+
/*
* Get a list of handles we want to flush; this may pull closed objects
* into the session cache, but we're going to do that eventually anyway.
@@ -419,7 +421,7 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
tracking = 1;
/* Tell logging that we are about to start a database checkpoint. */
- if (logging && full)
+ if (logging)
WT_ERR(__wt_txn_checkpoint_log(
session, full, WT_TXN_LOG_CKPT_PREPARE, NULL));
@@ -456,7 +458,7 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
txn_checkpoint_generation, txn_global->checkpoint_gen);
/* Tell logging that we have started a database checkpoint. */
- if (logging && full)
+ if (logging)
WT_ERR(__wt_txn_checkpoint_log(
session, full, WT_TXN_LOG_CKPT_START, NULL));
@@ -561,7 +563,7 @@ err: /*
* write a log record if the database was idle.
*/
if (logging) {
- if (ret == 0 && full &&
+ if (ret == 0 &&
F_ISSET((WT_BTREE *)session->meta_dhandle->handle,
WT_BTREE_SKIP_CKPT))
idle = 1;