diff options
author | Etienne Petrel <etienne.petrel@mongodb.com> | 2022-09-22 16:36:33 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-22 17:42:18 +0000 |
commit | 2f2d776a7291ceb79d6ebb8dc214f8887300cc56 (patch) | |
tree | 5029aa7f1844b20cb0b9fda94d6c531a85177c54 | |
parent | 708f8b2b148575d49e8564f0ba9e3d912f0c153e (diff) | |
download | mongo-2f2d776a7291ceb79d6ebb8dc214f8887300cc56.tar.gz |
Import wiredtiger: 8670ce2dec70063c06becb0c8b060e8c559e0b1b from branch mongodb-master
ref: c53541a3c0..8670ce2dec
for: 6.2.0-rc0
Revert "WT-9670 Add early statistics access via a general event handler. (#8243)" (#8298)
25 files changed, 56 insertions, 494 deletions
diff --git a/src/third_party/wiredtiger/dist/s_void b/src/third_party/wiredtiger/dist/s_void index 48690d10fc6..412606bea65 100755 --- a/src/third_party/wiredtiger/dist/s_void +++ b/src/third_party/wiredtiger/dist/s_void @@ -40,7 +40,6 @@ func_ok() -e '/int __cursor_fix_implicit$/d' \ -e '/int __delete_redo_window_cleanup_skip$/d' \ -e '/int __handle_close_default$/d' \ - -e '/int __handle_general_default$/d' \ -e '/int __handle_progress_default$/d' \ -e '/int __im_file_close$/d' \ -e '/int __im_file_lock$/d' \ @@ -109,7 +108,6 @@ func_ok() -e '/int fail_fs_exist$/d' \ -e '/int fail_fs_simulate_fail$/d' \ -e '/int fail_fs_terminate$/d' \ - -e '/int handle_general$/d' \ -e '/int handle_message$/d' \ -e '/int handle_progress$/d' \ -e '/int index_compare_S$/d' \ diff --git a/src/third_party/wiredtiger/examples/c/ex_event_handler.c b/src/third_party/wiredtiger/examples/c/ex_event_handler.c index bbe969b6196..002eda961ff 100644 --- a/src/third_party/wiredtiger/examples/c/ex_event_handler.c +++ b/src/third_party/wiredtiger/examples/c/ex_event_handler.c @@ -99,7 +99,6 @@ config_event_handler(void) /* Set handlers to NULL to use the default handler. */ event_handler.h.handle_progress = NULL; event_handler.h.handle_close = NULL; - event_handler.h.handle_general = NULL; event_handler.app_id = "example_event_handler"; error_check(wiredtiger_open(home, (WT_EVENT_HANDLER *)&event_handler, "create", &conn)); diff --git a/src/third_party/wiredtiger/examples/c/ex_verbose.c b/src/third_party/wiredtiger/examples/c/ex_verbose.c index 57a0c4b3cb6..b5e628a7cf2 100644 --- a/src/third_party/wiredtiger/examples/c/ex_verbose.c +++ b/src/third_party/wiredtiger/examples/c/ex_verbose.c @@ -61,7 +61,6 @@ config_verbose(void) event_handler.handle_error = NULL; event_handler.handle_progress = NULL; event_handler.handle_close = NULL; - event_handler.handle_general = NULL; /*! [Configure verbose_messaging] */ error_check(wiredtiger_open( diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index d0646055c3f..1669bc8c012 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "c53541a3c025469432cb097d2574bd8398483195" + "commit": "8670ce2dec70063c06becb0c8b060e8c559e0b1b" } diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c index 9f2f68b099e..eb43ab1ab82 100644 --- a/src/third_party/wiredtiger/src/conn/conn_api.c +++ b/src/third_party/wiredtiger/src/conn/conn_api.c @@ -1115,12 +1115,6 @@ err: conn->cache->eviction_dirty_trigger = 1.0; conn->cache->eviction_dirty_target = 0.1; - if (conn->default_session->event_handler->handle_general != NULL && - F_ISSET(conn, WT_CONN_MINIMAL | WT_CONN_READY)) - WT_TRET(conn->default_session->event_handler->handle_general( - conn->default_session->event_handler, &conn->iface, NULL, WT_EVENT_CONN_CLOSE)); - F_CLR(conn, WT_CONN_MINIMAL | WT_CONN_READY); - /* * Rollback all running transactions. We do this as a separate pass because an active * transaction in one session could cause trouble when closing a file, even if that session @@ -1145,15 +1139,6 @@ err: WT_TRET(__wt_session_close_internal(s)); } - /* - * Set MINIMAL again and call the event handler so that statistics can monitor any end of - * connection activity (like the final checkpoint). - */ - F_SET(conn, WT_CONN_MINIMAL); - if (conn->default_session->event_handler->handle_general != NULL) - WT_TRET(conn->default_session->event_handler->handle_general( - conn->default_session->event_handler, wt_conn, NULL, WT_EVENT_CONN_READY)); - /* Wait for in-flight operations to complete. */ WT_TRET(__wt_txn_activity_drain(session)); @@ -1183,12 +1168,6 @@ err: /* Perform a final checkpoint and shut down the global transaction state. */ WT_TRET(__wt_txn_global_shutdown(session, cfg)); - /* We know WT_CONN_MINIMAL is set a few lines above no need to check again. */ - if (conn->default_session->event_handler->handle_general != NULL) - WT_TRET(conn->default_session->event_handler->handle_general( - conn->default_session->event_handler, wt_conn, NULL, WT_EVENT_CONN_CLOSE)); - F_CLR(conn, WT_CONN_MINIMAL); - /* * See if close should wait for tiered storage to finish any flushing after the final * checkpoint. @@ -3040,11 +3019,6 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, const char *c */ WT_ERR(__wt_backup_open(session)); - F_SET(conn, WT_CONN_MINIMAL); - if (event_handler != NULL && event_handler->handle_general != NULL) - WT_ERR( - event_handler->handle_general(event_handler, &conn->iface, NULL, WT_EVENT_CONN_READY)); - /* Start the worker threads and run recovery. */ WT_ERR(__wt_connection_workers(session, cfg)); @@ -3062,8 +3036,6 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, const char *c F_SET(session, WT_SESSION_NO_DATA_HANDLES); WT_STATIC_ASSERT(offsetof(WT_CONNECTION_IMPL, iface) == 0); - F_SET(conn, WT_CONN_READY); - F_CLR(conn, WT_CONN_MINIMAL); *connectionp = &conn->iface; err: @@ -3092,12 +3064,6 @@ err: __wt_free(session, conn->partial_backup_remove_ids); if (ret != 0) { - if (conn->default_session->event_handler->handle_general != NULL && - F_ISSET(conn, WT_CONN_MINIMAL | WT_CONN_READY)) - WT_TRET(conn->default_session->event_handler->handle_general( - conn->default_session->event_handler, &conn->iface, NULL, WT_EVENT_CONN_CLOSE)); - F_CLR(conn, WT_CONN_MINIMAL | WT_CONN_READY); - /* * Set panic if we're returning the run recovery error or if recovery did not complete so * that we don't try to checkpoint data handles. We need an explicit flag instead of diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h index 5a8408fb474..18d5ddd6e73 100644 --- a/src/third_party/wiredtiger/src/include/connection.h +++ b/src/third_party/wiredtiger/src/include/connection.h @@ -634,32 +634,30 @@ struct __wt_connection_impl { uint32_t server_flags; /* AUTOMATIC FLAG VALUE GENERATION START 0 */ -#define WT_CONN_BACKUP_PARTIAL_RESTORE 0x0000001u -#define WT_CONN_CACHE_CURSORS 0x0000002u -#define WT_CONN_CACHE_POOL 0x0000004u -#define WT_CONN_CKPT_GATHER 0x0000008u -#define WT_CONN_CKPT_SYNC 0x0000010u -#define WT_CONN_CLOSING 0x0000020u -#define WT_CONN_CLOSING_CHECKPOINT 0x0000040u -#define WT_CONN_CLOSING_NO_MORE_OPENS 0x0000080u -#define WT_CONN_COMPATIBILITY 0x0000100u -#define WT_CONN_DATA_CORRUPTION 0x0000200u -#define WT_CONN_EVICTION_RUN 0x0000400u -#define WT_CONN_HS_OPEN 0x0000800u -#define WT_CONN_INCR_BACKUP 0x0001000u -#define WT_CONN_IN_MEMORY 0x0002000u -#define WT_CONN_LEAK_MEMORY 0x0004000u -#define WT_CONN_LSM_MERGE 0x0008000u -#define WT_CONN_MINIMAL 0x0010000u -#define WT_CONN_OPTRACK 0x0020000u -#define WT_CONN_PANIC 0x0040000u -#define WT_CONN_READONLY 0x0080000u -#define WT_CONN_READY 0x0100000u -#define WT_CONN_RECONFIGURING 0x0200000u -#define WT_CONN_RECOVERING 0x0400000u -#define WT_CONN_SALVAGE 0x0800000u -#define WT_CONN_TIERED_FIRST_FLUSH 0x1000000u -#define WT_CONN_WAS_BACKUP 0x2000000u +#define WT_CONN_BACKUP_PARTIAL_RESTORE 0x000001u +#define WT_CONN_CACHE_CURSORS 0x000002u +#define WT_CONN_CACHE_POOL 0x000004u +#define WT_CONN_CKPT_GATHER 0x000008u +#define WT_CONN_CKPT_SYNC 0x000010u +#define WT_CONN_CLOSING 0x000020u +#define WT_CONN_CLOSING_CHECKPOINT 0x000040u +#define WT_CONN_CLOSING_NO_MORE_OPENS 0x000080u +#define WT_CONN_COMPATIBILITY 0x000100u +#define WT_CONN_DATA_CORRUPTION 0x000200u +#define WT_CONN_EVICTION_RUN 0x000400u +#define WT_CONN_HS_OPEN 0x000800u +#define WT_CONN_INCR_BACKUP 0x001000u +#define WT_CONN_IN_MEMORY 0x002000u +#define WT_CONN_LEAK_MEMORY 0x004000u +#define WT_CONN_LSM_MERGE 0x008000u +#define WT_CONN_OPTRACK 0x010000u +#define WT_CONN_PANIC 0x020000u +#define WT_CONN_READONLY 0x040000u +#define WT_CONN_RECONFIGURING 0x080000u +#define WT_CONN_RECOVERING 0x100000u +#define WT_CONN_SALVAGE 0x200000u +#define WT_CONN_TIERED_FIRST_FLUSH 0x400000u +#define WT_CONN_WAS_BACKUP 0x800000u /* AUTOMATIC FLAG VALUE GENERATION STOP 32 */ uint32_t flags; }; diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index c7727afcb14..56c8e026575 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -3290,12 +3290,6 @@ int wiredtiger_open(const char *home, */ const char *wiredtiger_strerror(int error) WT_ATTRIBUTE_LIBRARY_VISIBLE; -/*! WT_EVENT_HANDLER::special event types */ -typedef enum { - WT_EVENT_CONN_CLOSE, /*!< Connection closing. */ - WT_EVENT_CONN_READY /*!< Connection is ready. */ -} WT_EVENT_TYPE; - /*! * The interface implemented by applications to handle error, informational and * progress messages. Entries set to NULL are ignored and the default handlers @@ -3376,24 +3370,6 @@ struct __wt_event_handler { */ int (*handle_close)(WT_EVENT_HANDLER *handler, WT_SESSION *session, WT_CURSOR *cursor); - - /*! - * Callback to handle general events. The application may choose to handle - * only some types of events. An unhandled event should return 0. - * - * General event returns are not ignored in most cases. If the handler - * returns non-zero, the error may cause the WiredTiger function posting - * the event to fail. - * - * @param wt_conn The connection handle for the database. - * @param session the WiredTiger session handle in use when the - * progress message was generated. The handle may have been created by - * the application or automatically by WiredTiger or may be NULL. - * @param type A type indicator for what special event occurred. - * (see ::WT_EVENT_TYPE for available options.) - */ - int (*handle_general)(WT_EVENT_HANDLER *handler, - WT_CONNECTION *wt_conn, WT_SESSION *session, WT_EVENT_TYPE type); }; /*! diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c index 38bafdae4b0..f9eefc9e536 100644 --- a/src/third_party/wiredtiger/src/session/session_api.c +++ b/src/third_party/wiredtiger/src/session/session_api.c @@ -450,25 +450,6 @@ err: } /* - * __session_reconfigure_notsup -- - * WT_SESSION->reconfigure method; not supported version. - */ -static int -__session_reconfigure_notsup(WT_SESSION *wt_session, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, reconfigure); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_open_cursor_int -- * Internal version of WT_SESSION::open_cursor, with second cursor arg. */ @@ -638,19 +619,6 @@ __session_open_cursor(WT_SESSION *wt_session, const char *uri, WT_CURSOR *to_dup session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, open_cursor, config, cfg); - /* - * Check for early usage of a user session to collect statistics. If the connection is not fully - * ready but can be used, then only allow a cursor uri of "statistics:" only. The conditional is - * complicated. Allow the cursor to open if any of these conditions are met: - * - The connection is ready - * - The session is an internal session - * - The connection is minimally ready and the URI is "statistics:" - */ - if (!F_ISSET(S2C(session), WT_CONN_READY) && !F_ISSET(session, WT_SESSION_INTERNAL) && - (!F_ISSET(S2C(session), WT_CONN_MINIMAL) || strcmp(uri, "statistics:") != 0)) - WT_ERR_MSG( - session, EINVAL, "cannot open a non-statistics cursor before connection is opened"); - statjoin = (to_dup != NULL && uri != NULL && strcmp(uri, "statistics:join") == 0); if (!statjoin) { if ((to_dup == NULL && uri == NULL) || (to_dup != NULL && uri != NULL)) @@ -1106,23 +1074,6 @@ err: } /* - * __session_reset_notsup -- - * WT_SESSION->reset method; not supported version. - */ -static int -__session_reset_notsup(WT_SESSION *wt_session) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, reset); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_drop -- * WT_SESSION->drop method. */ @@ -1327,28 +1278,6 @@ err: } /* - * __session_join_notsup -- - * WT_SESSION->join method; not supported version. - */ -static int -__session_join_notsup( - WT_SESSION *wt_session, WT_CURSOR *join_cursor, WT_CURSOR *ref_cursor, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(join_cursor); - WT_UNUSED(ref_cursor); - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, join); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_salvage_worker -- * Wrapper function for salvage processing. */ @@ -1710,26 +1639,6 @@ err: } /* - * __session_verify_notsup -- - * WT_SESSION->verify method; not supported version. - */ -static int -__session_verify_notsup(WT_SESSION *wt_session, const char *uri, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(uri); - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, verify); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_begin_transaction -- * WT_SESSION->begin_transaction method. */ @@ -1753,25 +1662,6 @@ err: } /* - * __session_begin_transaction_notsup -- - * WT_SESSION->begin_transaction method; not supported version. - */ -static int -__session_begin_transaction_notsup(WT_SESSION *wt_session, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, begin_transaction); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_commit_transaction -- * WT_SESSION->commit_transaction method. */ @@ -1824,25 +1714,6 @@ err: } /* - * __session_commit_transaction_notsup -- - * WT_SESSION->commit_transaction method; not supported version. - */ -static int -__session_commit_transaction_notsup(WT_SESSION *wt_session, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, commit_transaction); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_prepare_transaction -- * WT_SESSION->prepare_transaction method. */ @@ -1921,25 +1792,6 @@ err: } /* - * __session_rollback_transaction_notsup -- - * WT_SESSION->rollback_transaction method; not supported version. - */ -static int -__session_rollback_transaction_notsup(WT_SESSION *wt_session, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, rollback_transaction); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_timestamp_transaction -- * WT_SESSION->timestamp_transaction method. Also see __session_timestamp_transaction_uint if * config parsing is a performance issue. @@ -1964,25 +1816,6 @@ err: } /* - * __session_timestamp_transaction_notsup -- - * WT_SESSION->timestamp_transaction method; not supported version. - */ -static int -__session_timestamp_transaction_notsup(WT_SESSION *wt_session, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, timestamp_transaction); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_timestamp_transaction_uint -- * WT_SESSION->timestamp_transaction_uint method. */ @@ -2001,27 +1834,6 @@ err: } /* - * __session_timestamp_transaction_uint_notsup -- - * WT_SESSION->timestamp_transaction_uint_ method; not supported version. - */ -static int -__session_timestamp_transaction_uint_notsup( - WT_SESSION *wt_session, WT_TS_TXN_TYPE which, uint64_t ts) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(which); - WT_UNUSED(ts); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, timestamp_transaction_uint); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_query_timestamp -- * WT_SESSION->query_timestamp method. */ @@ -2040,26 +1852,6 @@ err: } /* - * __session_query_timestamp_notsup -- - * WT_SESSION->query_timestamp method; not supported version. - */ -static int -__session_query_timestamp_notsup(WT_SESSION *wt_session, char *hex_timestamp, const char *config) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(hex_timestamp); - WT_UNUSED(config); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, query_timestamp); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_reset_snapshot -- * WT_SESSION->reset_snapshot method. */ @@ -2088,23 +1880,6 @@ __session_reset_snapshot(WT_SESSION *wt_session) } /* - * __session_reset_snapshot_notsup -- - * WT_SESSION->reset_snapshot method; not supported version. - */ -static int -__session_reset_snapshot_notsup(WT_SESSION *wt_session) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, reset_snapshot); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_transaction_pinned_range -- * WT_SESSION->transaction_pinned_range method. */ @@ -2137,25 +1912,6 @@ err: } /* - * __session_transaction_pinned_range_notsup -- - * WT_SESSION->transaction_pinned_range method; not supported version. - */ -static int -__session_transaction_pinned_range_notsup(WT_SESSION *wt_session, uint64_t *prange) -{ - WT_DECL_RET; - WT_SESSION_IMPL *session; - - WT_UNUSED(prange); - - session = (WT_SESSION_IMPL *)wt_session; - SESSION_API_CALL_NOCONF(session, transaction_pinned_range); - ret = __wt_session_notsup(session); -err: - API_END_RET(session, ret); -} - -/* * __session_get_rollback_reason -- * WT_SESSION->get_rollback_reason method. */ @@ -2313,19 +2069,6 @@ __open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const __session_query_timestamp, __session_timestamp_transaction, __session_timestamp_transaction_uint, __session_checkpoint, __session_reset_snapshot, __session_transaction_pinned_range, __session_get_rollback_reason, __wt_session_breakpoint}, - stds_min = {NULL, NULL, __session_close, __session_reconfigure_notsup, - __session_flush_tier_readonly, __wt_session_strerror, __session_open_cursor, - __session_alter_readonly, __session_create_readonly, __wt_session_compact_readonly, - __session_drop_readonly, __session_join_notsup, __session_log_flush_readonly, - __session_log_printf_readonly, __session_rename_readonly, __session_reset_notsup, - __session_salvage_readonly, __session_truncate_readonly, __session_upgrade_readonly, - __session_verify_notsup, __session_begin_transaction_notsup, - __session_commit_transaction_notsup, __session_prepare_transaction_readonly, - __session_rollback_transaction_notsup, __session_query_timestamp_notsup, - __session_timestamp_transaction_notsup, __session_timestamp_transaction_uint_notsup, - __session_checkpoint_readonly, __session_reset_snapshot_notsup, - __session_transaction_pinned_range_notsup, __session_get_rollback_reason, - __wt_session_breakpoint}, stds_readonly = {NULL, NULL, __session_close, __session_reconfigure, __session_flush_tier_readonly, __wt_session_strerror, __session_open_cursor, __session_alter_readonly, __session_create_readonly, __wt_session_compact_readonly, @@ -2372,11 +2115,7 @@ __open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const if (i >= conn->session_cnt) /* Defend against off-by-one errors. */ conn->session_cnt = i + 1; - /* Find the set of methods appropriate to this session. */ - if (F_ISSET(conn, WT_CONN_MINIMAL) && !F_ISSET(session, WT_SESSION_INTERNAL)) - session_ret->iface = stds_min; - else - session_ret->iface = F_ISSET(conn, WT_CONN_READONLY) ? stds_readonly : stds; + session_ret->iface = F_ISSET(conn, WT_CONN_READONLY) ? stds_readonly : stds; session_ret->iface.connection = &conn->iface; session_ret->name = NULL; diff --git a/src/third_party/wiredtiger/src/support/err.c b/src/third_party/wiredtiger/src/support/err.c index 4b7597bad40..287a59b4c41 100644 --- a/src/third_party/wiredtiger/src/support/err.c +++ b/src/third_party/wiredtiger/src/support/err.c @@ -78,24 +78,8 @@ __handle_close_default(WT_EVENT_HANDLER *handler, WT_SESSION *wt_session, WT_CUR return (0); } -/* - * __handle_general_default -- - * Default WT_EVENT_HANDLER->handle_general implementation: ignore. - */ -static int -__handle_general_default( - WT_EVENT_HANDLER *handler, WT_CONNECTION *wt_conn, WT_SESSION *wt_session, WT_EVENT_TYPE type) -{ - WT_UNUSED(handler); - WT_UNUSED(wt_conn); - WT_UNUSED(wt_session); - WT_UNUSED(type); - - return (0); -} - static WT_EVENT_HANDLER __event_handler_default = {__handle_error_default, __handle_message_default, - __handle_progress_default, __handle_close_default, __handle_general_default}; + __handle_progress_default, __handle_close_default}; /* * __handler_failure -- diff --git a/src/third_party/wiredtiger/src/utilities/util_verbose.c b/src/third_party/wiredtiger/src/utilities/util_verbose.c index 7093d89ceaf..66c0420d986 100644 --- a/src/third_party/wiredtiger/src/utilities/util_verbose.c +++ b/src/third_party/wiredtiger/src/utilities/util_verbose.c @@ -52,8 +52,8 @@ __handle_progress_verbose( static WT_EVENT_HANDLER __event_handler_verbose = { __handle_error_verbose, __handle_message_verbose, __handle_progress_verbose, - NULL, /* Session close handler. */ - NULL /* General handler. */ + NULL /* Close handler. */ + }; WT_EVENT_HANDLER *verbose_handler = &__event_handler_verbose; diff --git a/src/third_party/wiredtiger/test/checkpoint/test_checkpoint.c b/src/third_party/wiredtiger/test/checkpoint/test_checkpoint.c index 7e0f8b8b03b..3ffeb0bf262 100644 --- a/src/third_party/wiredtiger/test/checkpoint/test_checkpoint.c +++ b/src/third_party/wiredtiger/test/checkpoint/test_checkpoint.c @@ -275,7 +275,9 @@ run_complete: static int wt_connect(const char *config_open) { - static WT_EVENT_HANDLER event_handler = {handle_error, handle_message, NULL, NULL, NULL}; + static WT_EVENT_HANDLER event_handler = { + handle_error, handle_message, NULL, NULL /* Close handler. */ + }; WT_RAND_STATE rnd; int ret; char buf[512], config[1024]; diff --git a/src/third_party/wiredtiger/test/csuite/schema_abort/main.c b/src/third_party/wiredtiger/test/csuite/schema_abort/main.c index 5d3da58863d..2f92a0a3585 100644 --- a/src/third_party/wiredtiger/test/csuite/schema_abort/main.c +++ b/src/third_party/wiredtiger/test/csuite/schema_abort/main.c @@ -171,8 +171,7 @@ subtest_error_handler( static WT_EVENT_HANDLER event_handler = { subtest_error_handler, NULL, /* Message handler */ NULL, /* Progress handler */ - NULL, /* Close handler */ - NULL /* General handler */ + NULL /* Close handler */ }; /* diff --git a/src/third_party/wiredtiger/test/csuite/scope/main.c b/src/third_party/wiredtiger/test/csuite/scope/main.c index 78b9694ac9f..66e88a15c9c 100644 --- a/src/third_party/wiredtiger/test/csuite/scope/main.c +++ b/src/third_party/wiredtiger/test/csuite/scope/main.c @@ -53,7 +53,7 @@ handle_error(WT_EVENT_HANDLER *handler, WT_SESSION *session, int error, const ch return (0); } -static WT_EVENT_HANDLER event_handler = {handle_error, NULL, NULL, NULL, NULL}; +static WT_EVENT_HANDLER event_handler = {handle_error, NULL, NULL, NULL}; #define SET_KEY \ do { \ diff --git a/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c b/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c index 4c76a4ae2e2..96494830d1b 100644 --- a/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c +++ b/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c @@ -71,7 +71,6 @@ static char home[1024]; /* Program working dir */ /* Include worker threads and prepare extra sessions */ #define SESSION_MAX (MAX_TH + 3 + MAX_TH * PREPARE_PCT) #define STAT_WAIT 1 -#define USEC_STAT 10000 static const char *table_pfx = "table"; static const char *const uri_collection = "collection"; @@ -134,105 +133,6 @@ static wt_timestamp_t *active_timestamps; /* Oldest timestamps still in use. */ static void handler(int) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)); static void usage(void) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)); -static void handle_conn_close(void); -static void handle_conn_ready(WT_CONNECTION *); -static int handle_general(WT_EVENT_HANDLER *, WT_CONNECTION *, WT_SESSION *, WT_EVENT_TYPE); - -static WT_CONNECTION *stat_conn = NULL; -static WT_SESSION *stat_session = NULL; -static volatile bool stat_run = false; -static wt_thread_t stat_th; - -static WT_EVENT_HANDLER my_event = {NULL, NULL, NULL, NULL, handle_general}; -/* - * stat_func -- - * Function to run with the early connection and gather statistics. - */ -static WT_THREAD_RET -stat_func(void *arg) -{ - WT_CURSOR *stat_c; - int64_t last, value; - const char *desc, *pvalue; - - WT_UNUSED(arg); - testutil_assert(stat_conn != NULL); - testutil_check(stat_conn->open_session(stat_conn, NULL, NULL, &stat_session)); - desc = pvalue = NULL; - /* Start last and value at different numbers so we print the first value, likely 0. */ - last = -1; - value = 0; - while (stat_run) { - testutil_check(stat_session->open_cursor(stat_session, "statistics:", NULL, NULL, &stat_c)); - - /* Pick some statistic that is likely changed during recovery RTS. */ - stat_c->set_key(stat_c, WT_STAT_CONN_TXN_RTS_PAGES_VISITED); - testutil_check(stat_c->search(stat_c)); - testutil_check(stat_c->get_value(stat_c, &desc, &pvalue, &value)); - testutil_check(stat_c->close(stat_c)); - if (desc != NULL && value != last) - printf("%s: %" PRId64 "\n", desc, value); - last = value; - usleep(USEC_STAT); - } - testutil_check(stat_session->close(stat_session, NULL)); - return (WT_THREAD_RET_VALUE); -} - -/* - * handle_conn_close -- - * Function to handle connection close callbacks from WiredTiger. - */ -static void -handle_conn_close(void) -{ - /* - * Signal the statistics thread to exit and clear the global connection. This function cannot - * return until the user thread stops using the connection. - */ - stat_run = false; - testutil_check(__wt_thread_join(NULL, &stat_th)); - stat_conn = NULL; -} - -/* - * handle_conn_ready -- - * Function to handle connection ready callbacks from WiredTiger. - */ -static void -handle_conn_ready(WT_CONNECTION *conn) -{ - int unused; - - /* - * Set the global connection for statistics and then start a statistics thread. - */ - unused = 0; - testutil_assert(stat_conn == NULL); - memset(&stat_th, 0, sizeof(stat_th)); - stat_conn = conn; - stat_run = true; - testutil_check(__wt_thread_create(NULL, &stat_th, stat_func, (void *)&unused)); -} - -/* - * handle_general -- - * Function to handle general event callbacks. - */ -static int -handle_general( - WT_EVENT_HANDLER *handler, WT_CONNECTION *conn, WT_SESSION *session, WT_EVENT_TYPE type) -{ - WT_UNUSED(handler); - WT_UNUSED(session); - - if (type == WT_EVENT_CONN_CLOSE) - handle_conn_close(); - else if (type == WT_EVENT_CONN_READY) - handle_conn_ready(conn); - return (0); -} - /* * usage -- * TODO: Add a comment describing this function. @@ -270,8 +170,7 @@ thread_ts_run(void *arg) __wt_seconds((WT_SESSION_IMPL *)session, &last_reconfig); /* Update the oldest/stable timestamps every 1 millisecond. */ for (last_ts = 0;; __wt_sleep(0, 1000)) { - /* Get the last committed timestamp periodically in order to update the oldest - * timestamp. */ + /* Get the last committed timestamp periodically in order to update the oldest timestamp. */ ts = maximum_stable_ts(active_timestamps, nth); if (ts == last_ts) continue; @@ -898,15 +797,12 @@ main(int argc, char *argv[]) /* Copy the data to a separate folder for debugging purpose. */ testutil_copy_data(home); - printf("Open database and run recovery\n"); + printf("Open database, run recovery and verify content\n"); /* * Open the connection which forces recovery to be run. */ - testutil_check(wiredtiger_open(NULL, &my_event, ENV_CONFIG_REC, &conn)); - printf("Connection open and recovery complete. Verify content\n"); - /* Sleep to guarantee the statistics thread has enough time to run. */ - usleep(USEC_STAT + 10); + testutil_check(wiredtiger_open(NULL, NULL, ENV_CONFIG_REC, &conn)); testutil_check(conn->open_session(conn, NULL, NULL, &session)); /* * Open a cursor on all the tables. diff --git a/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c b/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c index 610913e227d..195f61b05e9 100644 --- a/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c @@ -111,7 +111,7 @@ handle_message(WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *messa return (0); } -static WT_EVENT_HANDLER event_handler = {NULL, handle_message, NULL, NULL, NULL}; +static WT_EVENT_HANDLER event_handler = {NULL, handle_message, NULL, NULL}; static const char *current; /* Current test configuration */ diff --git a/src/third_party/wiredtiger/test/csuite/wt2909_checkpoint_integrity/main.c b/src/third_party/wiredtiger/test/csuite/wt2909_checkpoint_integrity/main.c index abff8420eed..afbb3ca5986 100644 --- a/src/third_party/wiredtiger/test/csuite/wt2909_checkpoint_integrity/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt2909_checkpoint_integrity/main.c @@ -485,8 +485,7 @@ subtest_error_handler( static WT_EVENT_HANDLER event_handler = { subtest_error_handler, NULL, /* Message handler */ NULL, /* Progress handler */ - NULL, /* Close handler */ - NULL /* General handler */ + NULL /* Close handler */ }; /* diff --git a/src/third_party/wiredtiger/test/csuite/wt3363_checkpoint_op_races/main.c b/src/third_party/wiredtiger/test/csuite/wt3363_checkpoint_op_races/main.c index 24db947628b..9e6205935d8 100644 --- a/src/third_party/wiredtiger/test/csuite/wt3363_checkpoint_op_races/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt3363_checkpoint_op_races/main.c @@ -66,7 +66,7 @@ static WT_THREAD_RET monitor(void *); */ #define RUNTIME 900.0 -static WT_EVENT_HANDLER event_handler = {handle_op_error, handle_op_message, NULL, NULL, NULL}; +static WT_EVENT_HANDLER event_handler = {handle_op_error, handle_op_message, NULL, NULL}; /* * main -- diff --git a/src/third_party/wiredtiger/test/csuite/wt4105_large_doc_small_upd/main.c b/src/third_party/wiredtiger/test/csuite/wt4105_large_doc_small_upd/main.c index cab313f515d..5c236c65e5d 100644 --- a/src/third_party/wiredtiger/test/csuite/wt4105_large_doc_small_upd/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt4105_large_doc_small_upd/main.c @@ -74,7 +74,7 @@ handle_error(WT_EVENT_HANDLER *handler, WT_SESSION *session, int error, const ch return (0); } -static WT_EVENT_HANDLER event_handler = {handle_error, NULL, NULL, NULL, NULL}; +static WT_EVENT_HANDLER event_handler = {handle_error, NULL, NULL, NULL}; /* * main -- diff --git a/src/third_party/wiredtiger/test/csuite/wt4156_metadata_salvage/main.c b/src/third_party/wiredtiger/test/csuite/wt4156_metadata_salvage/main.c index e8879bbcad6..72362888423 100644 --- a/src/third_party/wiredtiger/test/csuite/wt4156_metadata_salvage/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt4156_metadata_salvage/main.c @@ -67,7 +67,7 @@ handle_message(WT_EVENT_HANDLER *handler, WT_SESSION *session, int error, const return (0); } -static WT_EVENT_HANDLER event_handler = {handle_message, NULL, NULL, NULL, NULL}; +static WT_EVENT_HANDLER event_handler = {handle_message, NULL, NULL, NULL}; typedef struct table_info { const char *name; diff --git a/src/third_party/wiredtiger/test/csuite/wt4803_history_store_abort/main.c b/src/third_party/wiredtiger/test/csuite/wt4803_history_store_abort/main.c index 963f6527b9e..6efbd3b51d4 100644 --- a/src/third_party/wiredtiger/test/csuite/wt4803_history_store_abort/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt4803_history_store_abort/main.c @@ -76,7 +76,7 @@ handle_message(WT_EVENT_HANDLER *handler, WT_SESSION *session, int error, const return (0); } -static WT_EVENT_HANDLER event_handler = {handle_message, NULL, NULL, NULL, NULL}; +static WT_EVENT_HANDLER event_handler = {handle_message, NULL, NULL, NULL}; /* * hs_workload -- diff --git a/src/third_party/wiredtiger/test/csuite/wt8057_compact_stress/main.c b/src/third_party/wiredtiger/test/csuite/wt8057_compact_stress/main.c index 91e3529cc33..dfcbe95c23b 100644 --- a/src/third_party/wiredtiger/test/csuite/wt8057_compact_stress/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt8057_compact_stress/main.c @@ -76,8 +76,7 @@ subtest_error_handler( static WT_EVENT_HANDLER event_handler = { subtest_error_handler, NULL, /* Message handler */ NULL, /* Progress handler */ - NULL, /* Close handler */ - NULL /* Special handler */ + NULL /* Close handler */ }; static void sig_handler(int) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)); diff --git a/src/third_party/wiredtiger/test/cursor_order/cursor_order.c b/src/third_party/wiredtiger/test/cursor_order/cursor_order.c index 2b4c1bc20e4..4cf99d20c5a 100644 --- a/src/third_party/wiredtiger/test/cursor_order/cursor_order.c +++ b/src/third_party/wiredtiger/test/cursor_order/cursor_order.c @@ -168,7 +168,9 @@ main(int argc, char *argv[]) static void wt_connect(SHARED_CONFIG *cfg, char *config_open) { - static WT_EVENT_HANDLER event_handler = {handle_error, handle_message, NULL, NULL, NULL}; + static WT_EVENT_HANDLER event_handler = { + handle_error, handle_message, NULL, NULL /* Close handler. */ + }; char config[512]; testutil_clean_work_dir(home); diff --git a/src/third_party/wiredtiger/test/fops/t.c b/src/third_party/wiredtiger/test/fops/t.c index 92de1f37e01..aa96682cd74 100644 --- a/src/third_party/wiredtiger/test/fops/t.c +++ b/src/third_party/wiredtiger/test/fops/t.c @@ -147,7 +147,9 @@ main(int argc, char *argv[]) static void wt_startup(char *config_open) { - static WT_EVENT_HANDLER event_handler = {handle_error, handle_message, NULL, NULL, NULL}; + static WT_EVENT_HANDLER event_handler = { + handle_error, handle_message, NULL, NULL /* Close handler. */ + }; char config_buf[128]; testutil_make_work_dir(home); diff --git a/src/third_party/wiredtiger/test/format/wts.c b/src/third_party/wiredtiger/test/format/wts.c index d1096347971..14417ff309f 100644 --- a/src/third_party/wiredtiger/test/format/wts.c +++ b/src/third_party/wiredtiger/test/format/wts.c @@ -137,7 +137,9 @@ handle_progress( return (0); } -static WT_EVENT_HANDLER event_handler = {NULL, handle_message, handle_progress, NULL, NULL}; +static WT_EVENT_HANDLER event_handler = { + NULL, handle_message, handle_progress, NULL /* Close handler. */ +}; #define CONFIG_APPEND(p, ...) \ do { \ diff --git a/src/third_party/wiredtiger/test/thread/t.c b/src/third_party/wiredtiger/test/thread/t.c index ab6d0b3e92c..9a0dd5fba20 100644 --- a/src/third_party/wiredtiger/test/thread/t.c +++ b/src/third_party/wiredtiger/test/thread/t.c @@ -174,7 +174,9 @@ main(int argc, char *argv[]) static void wt_connect(char *config_open) { - static WT_EVENT_HANDLER event_handler = {handle_error, handle_message, NULL, NULL, NULL}; + static WT_EVENT_HANDLER event_handler = { + handle_error, handle_message, NULL, NULL /* Close handler. */ + }; char config[512]; testutil_clean_work_dir(home); |