summaryrefslogtreecommitdiff
path: root/src/session/session_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/session/session_api.c')
-rw-r--r--src/session/session_api.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/session/session_api.c b/src/session/session_api.c
index ed6339aa66e..88a3c32ee11 100644
--- a/src/session/session_api.c
+++ b/src/session/session_api.c
@@ -129,9 +129,11 @@ __session_clear(WT_SESSION_IMPL *session)
* For these reasons, be careful when clearing the session structure.
*/
memset(session, 0, WT_SESSION_CLEAR_SIZE(session));
- session->hazard_size = 0;
- session->nhazard = 0;
+
WT_INIT_LSN(&session->bg_sync_lsn);
+
+ session->hazard_inuse = 0;
+ session->nhazard = 0;
}
/*
@@ -1819,17 +1821,13 @@ __open_session(WT_CONNECTION_IMPL *conn,
* session close because access to it isn't serialized. Allocate the
* first time we open this session.
*/
- if (WT_SESSION_FIRST_USE(session_ret))
- WT_ERR(__wt_calloc_def(
- session, conn->hazard_max, &session_ret->hazard));
-
- /*
- * Set an initial size for the hazard array. It will be grown as
- * required up to hazard_max. The hazard_size is reset on close, since
- * __wt_hazard_close ensures the array is cleared - so it is safe to
- * reset the starting size on each open.
- */
- session_ret->hazard_size = 0;
+ if (WT_SESSION_FIRST_USE(session_ret)) {
+ WT_ERR(__wt_calloc_def(session,
+ WT_SESSION_INITIAL_HAZARD_SLOTS, &session_ret->hazard));
+ session_ret->hazard_size = WT_SESSION_INITIAL_HAZARD_SLOTS;
+ session_ret->hazard_inuse = 0;
+ session_ret->nhazard = 0;
+ }
/* Cache the offset of this session's statistics bucket. */
session_ret->stat_bucket = WT_STATS_SLOT_ID(session);