summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-03-11 11:49:15 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-03-11 11:49:15 +1100
commit0ebbbca520297c82ef5447b2d6a12efaa08e14ab (patch)
tree5bd3c1063e5fa5fbdc0fb62bcbbbfef862f6f451
parent6616eb0c6f6e8817a095dd5b7220376f98f68839 (diff)
downloadmongo-0ebbbca520297c82ef5447b2d6a12efaa08e14ab.tar.gz
Wait for application threads in LRU eviction to drain before walking a file.
-rw-r--r--src/btree/bt_evict.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/btree/bt_evict.c b/src/btree/bt_evict.c
index 7bee6a3e587..fa8885b36bb 100644
--- a/src/btree/bt_evict.c
+++ b/src/btree/bt_evict.c
@@ -569,6 +569,13 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp)
cache = S2C(session)->cache;
/*
+ * Wait for application threads doing eviction in this file to drain:
+ * we're examining pages without holding hazard references.
+ */
+ while (btree->lru_count > 0)
+ __wt_yield();
+
+ /*
* Get the next WT_EVICT_WALK_PER_TABLE entries.
*
* We can't evict the page just returned to us, it marks our place in