diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2015-10-22 14:04:42 +1100 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2015-10-22 14:04:42 +1100 |
commit | 05d22cb131242de7238364fd8b50285de58a6b05 (patch) | |
tree | d06bdf50b629451e01313b8883692f31b6dbd383 /src/include/api.h | |
parent | 6cb1b5df2e05283b6f13fcdc9cef7c6970fcb9ce (diff) | |
download | mongo-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.h | 11 |
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) |