summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/api.h4
-rw-r--r--src/include/stat.h1
-rw-r--r--src/include/txn.h6
-rw-r--r--src/include/wiredtiger.in8
4 files changed, 15 insertions, 4 deletions
diff --git a/src/include/api.h b/src/include/api.h
index 5bc5f751163..47129ee8291 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -330,8 +330,10 @@ struct __wt_connection_impl {
__wt_txn_read_first(session); \
} \
ret = __wt_txn_commit((s), NULL); \
- } else \
+ } else { \
+ WT_TRET(WT_DEADLOCK); \
(void)__wt_txn_rollback((s), NULL); \
+ } \
} else if ((ret) != 0 && \
(ret) != WT_NOTFOUND && \
(ret) != WT_DUPLICATE_KEY) \
diff --git a/src/include/stat.h b/src/include/stat.h
index 4e2360f1d31..c7a7ed13983 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -119,6 +119,7 @@ struct __wt_connection_stats {
WT_STATS memfree;
WT_STATS total_read_io;
WT_STATS total_write_io;
+ WT_STATS txn_fail_cache;
WT_STATS txn_begin;
WT_STATS txn_commit;
WT_STATS txn_rollback;
diff --git a/src/include/txn.h b/src/include/txn.h
index b5c418881ab..1adc68e0caf 100644
--- a/src/include/txn.h
+++ b/src/include/txn.h
@@ -89,6 +89,12 @@ struct __wt_txn {
size_t modref_alloc;
u_int modref_count;
+ /*
+ * Count of unsuccessful eviction attempts, used to abort if the cache
+ * is full and no progress can be made.
+ */
+ u_int eviction_fails;
+
#define TXN_AUTOCOMMIT 0x01
#define TXN_ERROR 0x02
#define TXN_RUNNING 0x04
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index abedb83e8bd..edd24a483ff 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -1668,12 +1668,14 @@ extern int wiredtiger_extension_init(WT_SESSION *session,
#define WT_STAT_total_read_io 18
/*! total write I/Os */
#define WT_STAT_total_write_io 19
+/*! transaction failures due to cache overflow */
+#define WT_STAT_txn_fail_cache 20
/*! transactions */
-#define WT_STAT_txn_begin 20
+#define WT_STAT_txn_begin 21
/*! transactions committed */
-#define WT_STAT_txn_commit 21
+#define WT_STAT_txn_commit 22
/*! transactions rolled-back */
-#define WT_STAT_txn_rollback 22
+#define WT_STAT_txn_rollback 23
/*!
* @}