summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/include/api.h
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-05-19 15:49:07 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-19 06:02:30 +0000
commit1d20af63ae5e95e0ed1219809c5af571de8e3ae3 (patch)
tree8b046a8403a959b712715fdfd296a38f0c4b1fb4 /src/third_party/wiredtiger/src/include/api.h
parentcc1640581318df61a5fedc5c7ddd1a91c13e0712 (diff)
downloadmongo-1d20af63ae5e95e0ed1219809c5af571de8e3ae3.tar.gz
Import wiredtiger: bae0c1c914bc0fa92f3775c08650b65663094034 from branch mongodb-4.4
ref: aadac22242..bae0c1c914 for: 4.4.7 WT-6403 Restore format non-timestamp transactional testing WT-6576 Fix the aborted on-disk prepared key WT-7106 Increase how often delta encoding is used for history store records WT-7204 Update cursor-backward walks key instantiation support WT-7234 Prefix-compressed keys and memory amplification WT-7296 Merge default configuration with supplied test configuration in test framework WT-7325 Created a script to generate a new test in the WT test framework WT-7381 Cache btree's ckptlist between checkpoints WT-7382 Refactor of database validation in the test framework WT-7407 test/format failure classifier WT-7411 Stats and counter to track prepared updates WT-7416 Imported table requires full copy between incremental backups WT-7446 Fix incorrect duration_seconds value in test framework WT-7486 Coverity explcit NULL dereferenced WT-7487 Coverity explcit NULL dereferenced WT-7497 Add flush component to object metadata WT-7499 Change WT_STORAGE_SOURCE.flush API and add flush_finish WT-7503 Change default compressor for WT HS to Zstandard WT-7506 Allow single and double quotes inside auto-formatted comments WT-7511 Add assert to ensure the history store page is pinned before search WT-7519 Fix flags field overflow in WT_DATA_HANDLE WT-7525 Add key order check right after history store insert WT-7537 Change local tier object suffix to .wtobj WT-7546 Coverity: Minor issues in CppSuite test harness
Diffstat (limited to 'src/third_party/wiredtiger/src/include/api.h')
-rw-r--r--src/third_party/wiredtiger/src/include/api.h59
1 files changed, 29 insertions, 30 deletions
diff --git a/src/third_party/wiredtiger/src/include/api.h b/src/third_party/wiredtiger/src/include/api.h
index 2a2bd5aca2f..20a86779a91 100644
--- a/src/third_party/wiredtiger/src/include/api.h
+++ b/src/third_party/wiredtiger/src/include/api.h
@@ -123,34 +123,31 @@
if (__update) \
F_SET((s)->txn, WT_TXN_UPDATE);
-/* End a transactional API call, optional retry on deadlock. */
-#define TXN_API_END_RETRY(s, ret, retry) \
- API_END(s, ret); \
- if (__update) \
- F_CLR((s)->txn, WT_TXN_UPDATE); \
- if (__autotxn) { \
- if (F_ISSET((s)->txn, WT_TXN_AUTOCOMMIT)) \
- F_CLR((s)->txn, WT_TXN_AUTOCOMMIT); \
- else if ((ret) == 0) \
- (ret) = __wt_txn_commit((s), NULL); \
- else { \
- if (retry) \
- WT_TRET(__wt_session_copy_values(s)); \
- WT_TRET(__wt_txn_rollback((s), NULL)); \
- if (((ret) == 0 || (ret) == WT_ROLLBACK) && (retry)) { \
- (ret) = 0; \
- continue; \
- } \
- WT_TRET(__wt_session_reset_cursors(s, false)); \
- } \
- } \
- break; \
- } \
+/* End a transactional API call, optional retry on rollback. */
+#define TXN_API_END(s, ret, retry) \
+ API_END(s, ret); \
+ if (__update) \
+ F_CLR((s)->txn, WT_TXN_UPDATE); \
+ if (__autotxn) { \
+ if (F_ISSET((s)->txn, WT_TXN_AUTOCOMMIT)) \
+ F_CLR((s)->txn, WT_TXN_AUTOCOMMIT); \
+ else if ((ret) == 0) \
+ (ret) = __wt_txn_commit((s), NULL); \
+ else { \
+ if (retry) \
+ WT_TRET(__wt_session_copy_values(s)); \
+ WT_TRET(__wt_txn_rollback((s), NULL)); \
+ if ((retry) && (ret) == WT_ROLLBACK) { \
+ (ret) = 0; \
+ continue; \
+ } \
+ WT_TRET(__wt_session_reset_cursors(s, false)); \
+ } \
+ } \
+ break; \
+ } \
while (1)
-/* End a transactional API call, retry on deadlock. */
-#define TXN_API_END(s, ret) TXN_API_END_RETRY(s, ret, 1)
-
/*
* In almost all cases, API_END is returning immediately, make it simple. If a session or connection
* method is about to return WT_NOTFOUND (some underlying object was not found), map it to ENOENT,
@@ -265,7 +262,9 @@
CURSOR_UPDATE_API_CALL(cur, s, n); \
JOINABLE_CURSOR_CALL_CHECK(cur)
-#define CURSOR_UPDATE_API_END(s, ret) \
- if ((ret) == WT_PREPARE_CONFLICT) \
- (ret) = WT_ROLLBACK; \
- TXN_API_END(s, ret)
+#define CURSOR_UPDATE_API_END_RETRY(s, ret, retry) \
+ if ((ret) == WT_PREPARE_CONFLICT) \
+ (ret) = WT_ROLLBACK; \
+ TXN_API_END(s, ret, retry)
+
+#define CURSOR_UPDATE_API_END(s, ret) CURSOR_UPDATE_API_END_RETRY(s, ret, true)