summaryrefslogtreecommitdiff
path: root/src/include/txn.i
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2017-03-10 14:00:13 +1100
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-03-10 14:00:13 +1100
commita67019791436f1dfaca9cffda17e2fa9935296db (patch)
tree8f4aba0fc085862037aeb7b377b3c768bf62a1b8 /src/include/txn.i
parent9e3f71ef55b906b25c63e1000cf39949a587550d (diff)
downloadmongo-a67019791436f1dfaca9cffda17e2fa9935296db.tar.gz
WT-3207 Don't hold clean handles during checkpoints. (#3319)
Previously, we gathered handles, then started a transaction, then figured out which handles were clean and released them. However, * checkpoints were keeping every handle in both its handle list and in the meta_tracking list because the *_apply_all functions were saving all handles when meta_tracking was active; and * we had acquired exclusive locks on checkpoints to be dropped before determining that we could skip a checkpoint in a clean tree. These locks blocked drops (among other things) until the checkpoint completed. The solution here is to first start the transaction, then check for clean handles as checkpoint visits them. However, this has to cope with races where a handle changes state in between the transaction starting and getting the handle (e.g., table creates, bulk loads completing).
Diffstat (limited to 'src/include/txn.i')
-rw-r--r--src/include/txn.i3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/txn.i b/src/include/txn.i
index 0cc4a6f8439..314c948e4d1 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -125,7 +125,8 @@ __wt_txn_oldest_id(WT_SESSION_IMPL *session)
* minimum of it with the oldest ID, which is what we want.
*/
oldest_id = txn_global->oldest_id;
- include_checkpoint_txn = btree == NULL || btree->include_checkpoint_txn;
+ include_checkpoint_txn = btree == NULL ||
+ btree->checkpoint_gen != txn_global->checkpoint_gen;
WT_READ_BARRIER();
checkpoint_pinned = txn_global->checkpoint_pinned;