summaryrefslogtreecommitdiff
path: root/src/include/api.h
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2015-10-22 14:04:42 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2015-10-22 14:04:42 +1100
commit05d22cb131242de7238364fd8b50285de58a6b05 (patch)
treed06bdf50b629451e01313b8883692f31b6dbd383 /src/include/api.h
parent6cb1b5df2e05283b6f13fcdc9cef7c6970fcb9ce (diff)
downloadmongo-05d22cb131242de7238364fd8b50285de58a6b05.tar.gz
WT-2178 When running in memory return an error if an operation would
cause the cache size to be exceeded. This introduces a new WiredTiger error return code. This captures operations at the cursor boundary - that may be insufficient, it could be safer to catch this when allocating update structures. That check would lead to more complex internal error handling.
Diffstat (limited to 'src/include/api.h')
-rw-r--r--src/include/api.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/include/api.h b/src/include/api.h
index 8679b9510a8..84c215cdfd1 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -116,11 +116,18 @@
API_CALL_NOCONF(s, WT_CURSOR, n, cur, \
((bt) == NULL) ? NULL : ((WT_BTREE *)(bt))->dhandle)
+#define CURSOR_REMOVE_API_CALL(cur, s, bt) \
+ (s) = (WT_SESSION_IMPL *)(cur)->session; \
+ TXN_API_CALL_NOCONF(s, WT_CURSOR, remove, cur, \
+ ((bt) == NULL) ? NULL : ((WT_BTREE *)(bt))->dhandle);
+
#define CURSOR_UPDATE_API_CALL(cur, s, n, bt) \
(s) = (WT_SESSION_IMPL *)(cur)->session; \
TXN_API_CALL_NOCONF(s, WT_CURSOR, n, cur, \
- ((bt) == NULL) ? NULL : ((WT_BTREE *)(bt))->dhandle)
-
+ ((bt) == NULL) ? NULL : ((WT_BTREE *)(bt))->dhandle); \
+ if (F_ISSET(S2C(s), WT_CONN_IN_MEMORY) && __wt_cache_full(s)) \
+ return (WT_CACHE_FULL);
+
#define CURSOR_UPDATE_API_END(s, ret) \
TXN_API_END(s, ret)