summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-11-16 16:50:01 +1100
committerGitHub <noreply@github.com>2016-11-16 16:50:01 +1100
commit1ce36af292fd0317021091a0523376b0533ac3bf (patch)
tree2ded23c60276ab8daec2a56c11bf20fd64ad9236
parent9be507a869760c6adff119e6ea3be9e0e67135dd (diff)
downloadmongo-1ce36af292fd0317021091a0523376b0533ac3bf.tar.gz
WT-3024 Fix a hang on close caused by leaving a transaction ID pinned. (#3152)
-rw-r--r--src/include/txn.h3
-rw-r--r--src/txn/txn_ckpt.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/include/txn.h b/src/include/txn.h
index 774f635d7ba..344275e23d0 100644
--- a/src/include/txn.h
+++ b/src/include/txn.h
@@ -49,8 +49,11 @@
WT_ASSERT((s), (s)->txn.forced_iso > 0); \
(s)->txn.forced_iso--; \
WT_ASSERT((s), txn_state->id == saved_state.id && \
+ (txn_state->metadata_pinned == saved_state.metadata_pinned ||\
+ saved_state.metadata_pinned == WT_TXN_NONE) && \
(txn_state->pinned_id == saved_state.pinned_id || \
saved_state.pinned_id == WT_TXN_NONE)); \
+ txn_state->metadata_pinned = saved_state.metadata_pinned; \
txn_state->pinned_id = saved_state.pinned_id; \
} while (0)
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index 698cae23562..802ccd84915 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -701,7 +701,8 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
* can safely ignore the checkpoint ID (see the visible all check for
* details).
*/
- txn_state->id = txn_state->pinned_id = WT_TXN_NONE;
+ txn_state->id = txn_state->pinned_id =
+ txn_state->metadata_pinned = WT_TXN_NONE;
__wt_writeunlock(session, txn_global->scan_rwlock);
/*