summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-03-22 14:54:39 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-03-22 14:54:39 +1100
commit95750c25c8d484dd3b739e3de226217a97fc47eb (patch)
tree28dd01d6a45595f1d56886d57c44ed4b13d0dc79
parent2d0e768a6c24e846863d0c8b6555a98ab201ea4a (diff)
downloadmongo-95750c25c8d484dd3b739e3de226217a97fc47eb.tar.gz
Move the cache full check for autocommit transactions out of the rollback path (since we don't reset cursors there), to after we close a curso.
refs #486
-rw-r--r--src/include/api.h5
-rw-r--r--src/include/cursor.i9
2 files changed, 10 insertions, 4 deletions
diff --git a/src/include/api.h b/src/include/api.h
index 47538b5c383..e298fc86413 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -64,10 +64,7 @@
ret = __wt_txn_commit((s), NULL); \
else { \
WT_TRET(__wt_txn_rollback((s), NULL)); \
- if (ret == 0 || ret == WT_DEADLOCK) { \
- ret = __wt_cache_full_check(s); \
- continue; \
- } \
+ continue; \
} \
} else if (F_ISSET(&(s)->txn, TXN_RUNNING) && (ret) != 0 && \
(ret) != WT_NOTFOUND && \
diff --git a/src/include/cursor.i b/src/include/cursor.i
index 6ffaac5e1c4..eeff8e4d727 100644
--- a/src/include/cursor.i
+++ b/src/include/cursor.i
@@ -78,6 +78,15 @@ __cursor_leave(WT_CURSOR_BTREE *cbt)
if (--session->ncursors == 0)
__wt_txn_read_last(session);
F_CLR(cbt, WT_CBT_ACTIVE);
+
+ /*
+ * If this is an autocommit operation that is just getting
+ * started, check that the cache isn't full. We may have other
+ * cursors open, but the one we just closed might help eviction
+ * make progress.
+ */
+ if (F_ISSET(&session->txn, TXN_AUTOCOMMIT))
+ __wt_cache_full_check(session);
}
return (0);
}