summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/session/session_api.c
diff options
context:
space:
mode:
authorChenhao Qu <chenhao.qu@mongodb.com>2022-12-14 17:01:30 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-14 06:31:43 +0000
commitc1bb17a37a50796ef31ec65d91ffb02c7eb84427 (patch)
tree17982abaa462d9bb6b86816987ba57cea81c7dbe /src/third_party/wiredtiger/src/session/session_api.c
parent8edf44dfc61517bd9a7a3c10561b73777ab996cd (diff)
downloadmongo-c1bb17a37a50796ef31ec65d91ffb02c7eb84427.tar.gz
Import wiredtiger: c9b01cfc9e9e064ba9f51903eb084527ed4671d4 from branch mongodb-master
ref: 13e6e4b7b6..c9b01cfc9e for: 6.3.0-rc0 WT-10330 Merge codify-timestamps project
Diffstat (limited to 'src/third_party/wiredtiger/src/session/session_api.c')
-rw-r--r--src/third_party/wiredtiger/src/session/session_api.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c
index b498fc5146e..ecc2e00d6b1 100644
--- a/src/third_party/wiredtiger/src/session/session_api.c
+++ b/src/third_party/wiredtiger/src/session/session_api.c
@@ -322,9 +322,23 @@ __wt_session_close_internal(WT_SESSION_IMPL *session)
{
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
+#ifdef HAVE_CALL_LOG
+ bool internal_session;
+#endif
conn = S2C(session);
+#ifdef HAVE_CALL_LOG
+ internal_session = F_ISSET(session, WT_SESSION_INTERNAL);
+ if (!internal_session)
+ /*
+ * The call log entry for the session_close API is generated by two functions. The reason is
+ * that the first function (called below) requires session's variables and the second
+ * function (called at the end) requires the ret value.
+ */
+ WT_TRET(__wt_call_log_close_session(session));
+#endif
+
/* Close all open cursors while the cursor cache is disabled. */
F_CLR(session, WT_SESSION_CACHE_CURSORS);
@@ -407,6 +421,11 @@ __wt_session_close_internal(WT_SESSION_IMPL *session)
__wt_spin_unlock(session, &conn->api_lock);
+#ifdef HAVE_CALL_LOG
+ if (!internal_session)
+ WT_TRET(__wt_call_log_print_return(conn, session, ret, ""));
+#endif
+
return (ret);
}
@@ -1846,6 +1865,9 @@ __session_begin_transaction(WT_SESSION *wt_session, const char *config)
ret = __wt_txn_begin(session, cfg);
err:
+#ifdef HAVE_CALL_LOG
+ WT_TRET(__wt_call_log_begin_transaction(session, config, ret));
+#endif
API_END_RET(session, ret);
}
@@ -1916,7 +1938,9 @@ err:
WT_TRET(__wt_txn_rollback(session, cfg));
F_CLR(session, WT_SESSION_RESOLVING_TXN);
}
-
+#ifdef HAVE_CALL_LOG
+ WT_TRET(__wt_call_log_commit_transaction(session, config, ret));
+#endif
API_END_RET(session, ret);
}
@@ -1961,6 +1985,9 @@ __session_prepare_transaction(WT_SESSION *wt_session, const char *config)
F_CLR(session, WT_SESSION_RESOLVING_TXN);
err:
+#ifdef HAVE_CALL_LOG
+ WT_TRET(__wt_call_log_prepare_transaction(session, config, ret));
+#endif
API_END_RET(session, ret);
}
@@ -2014,6 +2041,9 @@ __session_rollback_transaction(WT_SESSION *wt_session, const char *config)
F_CLR(session, WT_SESSION_RESOLVING_TXN);
err:
+#ifdef HAVE_CALL_LOG
+ WT_TRET(__wt_call_log_rollback_transaction(session, config, ret));
+#endif
API_END_RET(session, ret);
}
@@ -2057,6 +2087,9 @@ __session_timestamp_transaction(WT_SESSION *wt_session, const char *config)
ret = __wt_txn_set_timestamp(session, cfg, false);
err:
+#ifdef HAVE_CALL_LOG
+ WT_TRET(__wt_call_log_timestamp_transaction(session, config, ret));
+#endif
API_END_RET(session, ret);
}
@@ -2094,6 +2127,9 @@ __session_timestamp_transaction_uint(WT_SESSION *wt_session, WT_TS_TXN_TYPE whic
ret = __wt_txn_set_timestamp_uint(session, which, (wt_timestamp_t)ts);
err:
+#ifdef HAVE_CALL_LOG
+ WT_TRET(__wt_call_log_timestamp_transaction_uint(session, which, ts, ret));
+#endif
API_END_RET(session, ret);
}
@@ -2133,6 +2169,9 @@ __session_query_timestamp(WT_SESSION *wt_session, char *hex_timestamp, const cha
ret = __wt_txn_query_timestamp(session, hex_timestamp, cfg, false);
err:
+#ifdef HAVE_CALL_LOG
+ WT_TRET(__wt_call_log_query_timestamp(session, config, hex_timestamp, ret, false));
+#endif
API_END_RET(session, ret);
}