summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/conn
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/conn')
-rw-r--r--src/third_party/wiredtiger/src/conn/api_strerror.c16
-rw-r--r--src/third_party/wiredtiger/src/conn/api_version.c2
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_api.c26
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_cache.c4
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_cache_pool.c23
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_ckpt.c4
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_dhandle.c22
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_handle.c28
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_log.c33
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_open.c4
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_stat.c8
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_sweep.c11
12 files changed, 86 insertions, 95 deletions
diff --git a/src/third_party/wiredtiger/src/conn/api_strerror.c b/src/third_party/wiredtiger/src/conn/api_strerror.c
index edb11957556..63f982deb07 100644
--- a/src/third_party/wiredtiger/src/conn/api_strerror.c
+++ b/src/third_party/wiredtiger/src/conn/api_strerror.c
@@ -18,8 +18,6 @@
const char *
__wt_wiredtiger_error(int error)
{
- const char *p;
-
/*
* Check for WiredTiger specific errors.
*/
@@ -42,14 +40,20 @@ __wt_wiredtiger_error(int error)
return ("WT_CACHE_FULL: operation would overflow cache");
}
+ /* Windows strerror doesn't support ENOTSUP. */
+ if (error == ENOTSUP)
+ return ("Operation not supported");
+
/*
- * POSIX errors are non-negative integers; check for 0 explicitly incase
- * the underlying strerror doesn't handle 0, some historically didn't.
+ * Check for 0 in case the underlying strerror doesn't handle it, some
+ * historically didn't.
*/
if (error == 0)
return ("Successful return: 0");
- if (error > 0 && (p = strerror(error)) != NULL)
- return (p);
+
+ /* POSIX errors are non-negative integers. */
+ if (error > 0)
+ return (strerror(error));
return (NULL);
}
diff --git a/src/third_party/wiredtiger/src/conn/api_version.c b/src/third_party/wiredtiger/src/conn/api_version.c
index a36cdb8d8eb..c4f3d978c1e 100644
--- a/src/third_party/wiredtiger/src/conn/api_version.c
+++ b/src/third_party/wiredtiger/src/conn/api_version.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c
index 68d45678965..c0a1f5c0920 100644
--- a/src/third_party/wiredtiger/src/conn/conn_api.c
+++ b/src/third_party/wiredtiger/src/conn/conn_api.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -175,13 +175,13 @@ __wt_conn_remove_collator(WT_SESSION_IMPL *session)
conn = S2C(session);
while ((ncoll = TAILQ_FIRST(&conn->collqh)) != NULL) {
+ /* Remove from the connection's list, free memory. */
+ TAILQ_REMOVE(&conn->collqh, ncoll, q);
/* Call any termination method. */
if (ncoll->collator->terminate != NULL)
WT_TRET(ncoll->collator->terminate(
ncoll->collator, (WT_SESSION *)session));
- /* Remove from the connection's list, free memory. */
- TAILQ_REMOVE(&conn->collqh, ncoll, q);
__wt_free(session, ncoll->name);
__wt_free(session, ncoll);
}
@@ -281,13 +281,13 @@ __wt_conn_remove_compressor(WT_SESSION_IMPL *session)
conn = S2C(session);
while ((ncomp = TAILQ_FIRST(&conn->compqh)) != NULL) {
+ /* Remove from the connection's list, free memory. */
+ TAILQ_REMOVE(&conn->compqh, ncomp, q);
/* Call any termination method. */
if (ncomp->compressor->terminate != NULL)
WT_TRET(ncomp->compressor->terminate(
ncomp->compressor, (WT_SESSION *)session));
- /* Remove from the connection's list, free memory. */
- TAILQ_REMOVE(&conn->compqh, ncomp, q);
__wt_free(session, ncomp->name);
__wt_free(session, ncomp);
}
@@ -346,13 +346,13 @@ __wt_conn_remove_data_source(WT_SESSION_IMPL *session)
conn = S2C(session);
while ((ndsrc = TAILQ_FIRST(&conn->dsrcqh)) != NULL) {
+ /* Remove from the connection's list, free memory. */
+ TAILQ_REMOVE(&conn->dsrcqh, ndsrc, q);
/* Call any termination method. */
if (ndsrc->dsrc->terminate != NULL)
WT_TRET(ndsrc->dsrc->terminate(
ndsrc->dsrc, (WT_SESSION *)session));
- /* Remove from the connection's list, free memory. */
- TAILQ_REMOVE(&conn->dsrcqh, ndsrc, q);
__wt_free(session, ndsrc->prefix);
__wt_free(session, ndsrc);
}
@@ -536,14 +536,16 @@ __wt_conn_remove_encryptor(WT_SESSION_IMPL *session)
conn = S2C(session);
while ((nenc = TAILQ_FIRST(&conn->encryptqh)) != NULL) {
+ /* Remove from the connection's list, free memory. */
+ TAILQ_REMOVE(&conn->encryptqh, nenc, q);
while ((kenc = TAILQ_FIRST(&nenc->keyedqh)) != NULL) {
+ /* Remove from the connection's list, free memory. */
+ TAILQ_REMOVE(&nenc->keyedqh, kenc, q);
/* Call any termination method. */
if (kenc->owned && kenc->encryptor->terminate != NULL)
WT_TRET(kenc->encryptor->terminate(
kenc->encryptor, (WT_SESSION *)session));
- /* Remove from the connection's list, free memory. */
- TAILQ_REMOVE(&nenc->keyedqh, kenc, q);
__wt_free(session, kenc->keyid);
__wt_free(session, kenc);
}
@@ -553,8 +555,6 @@ __wt_conn_remove_encryptor(WT_SESSION_IMPL *session)
WT_TRET(nenc->encryptor->terminate(
nenc->encryptor, (WT_SESSION *)session));
- /* Remove from the connection's list, free memory. */
- TAILQ_REMOVE(&conn->encryptqh, nenc, q);
__wt_free(session, nenc->name);
__wt_free(session, nenc);
}
@@ -680,13 +680,13 @@ __wt_conn_remove_extractor(WT_SESSION_IMPL *session)
conn = S2C(session);
while ((nextractor = TAILQ_FIRST(&conn->extractorqh)) != NULL) {
+ /* Remove from the connection's list, free memory. */
+ TAILQ_REMOVE(&conn->extractorqh, nextractor, q);
/* Call any termination method. */
if (nextractor->extractor->terminate != NULL)
WT_TRET(nextractor->extractor->terminate(
nextractor->extractor, (WT_SESSION *)session));
- /* Remove from the connection's list, free memory. */
- TAILQ_REMOVE(&conn->extractorqh, nextractor, q);
__wt_free(session, nextractor->name);
__wt_free(session, nextractor);
}
diff --git a/src/third_party/wiredtiger/src/conn/conn_cache.c b/src/third_party/wiredtiger/src/conn/conn_cache.c
index 28dd06332e0..5515eb026ca 100644
--- a/src/third_party/wiredtiger/src/conn/conn_cache.c
+++ b/src/third_party/wiredtiger/src/conn/conn_cache.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -312,7 +312,7 @@ __wt_cache_destroy(WT_SESSION_IMPL *session)
cache->bytes_dirty_intl + cache->bytes_dirty_leaf,
cache->pages_dirty_intl + cache->pages_dirty_leaf);
- WT_TRET(__wt_cond_destroy(session, &cache->evict_cond));
+ __wt_cond_destroy(session, &cache->evict_cond);
__wt_spin_destroy(session, &cache->evict_pass_lock);
__wt_spin_destroy(session, &cache->evict_queue_lock);
__wt_spin_destroy(session, &cache->evict_walk_lock);
diff --git a/src/third_party/wiredtiger/src/conn/conn_cache_pool.c b/src/third_party/wiredtiger/src/conn/conn_cache_pool.c
index ed078991581..adc2e2bffc3 100644
--- a/src/third_party/wiredtiger/src/conn/conn_cache_pool.c
+++ b/src/third_party/wiredtiger/src/conn/conn_cache_pool.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -225,7 +225,7 @@ err: __wt_spin_unlock(session, &__wt_process.spinlock);
__wt_free(session, pool_name);
if (ret != 0 && created) {
__wt_free(session, cp->name);
- WT_TRET(__wt_cond_destroy(session, &cp->cache_pool_cond));
+ __wt_cond_destroy(session, &cp->cache_pool_cond);
__wt_free(session, cp);
}
return (ret);
@@ -277,7 +277,7 @@ __wt_conn_cache_pool_open(WT_SESSION_IMPL *session)
* the active connection shuts down.
*/
F_SET(cp, WT_CACHE_POOL_ACTIVE);
- F_SET(cache, WT_CACHE_POOL_RUN);
+ FLD_SET(cache->pool_flags, WT_CACHE_POOL_RUN);
WT_RET(__wt_thread_create(session, &cache->cp_tid,
__wt_cache_pool_server, cache->cp_session));
@@ -340,7 +340,7 @@ __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session)
__wt_spin_unlock(session, &cp->cache_pool_lock);
cp_locked = false;
- F_CLR(cache, WT_CACHE_POOL_RUN);
+ FLD_CLR(cache->pool_flags, WT_CACHE_POOL_RUN);
__wt_cond_signal(session, cp->cache_pool_cond);
WT_TRET(__wt_thread_join(session, cache->cp_tid));
@@ -391,7 +391,7 @@ __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session)
__wt_free(session, cp->name);
__wt_spin_destroy(session, &cp->cache_pool_lock);
- WT_TRET(__wt_cond_destroy(session, &cp->cache_pool_cond));
+ __wt_cond_destroy(session, &cp->cache_pool_cond);
__wt_free(session, cp);
}
@@ -399,7 +399,7 @@ __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session)
__wt_spin_unlock(session, &cp->cache_pool_lock);
/* Notify other participants if we were managing */
- if (F_ISSET(cache, WT_CACHE_POOL_MANAGER)) {
+ if (FLD_ISSET(cache->pool_flags, WT_CACHE_POOL_MANAGER)) {
cp->pool_managed = 0;
__wt_verbose(session, WT_VERB_SHARED_CACHE,
"Shutting down shared cache manager connection");
@@ -449,7 +449,8 @@ __cache_pool_balance(WT_SESSION_IMPL *session, bool forward)
for (i = 0;
i < 2 * WT_CACHE_POOL_BUMP_THRESHOLD &&
F_ISSET(cp, WT_CACHE_POOL_ACTIVE) &&
- F_ISSET(S2C(session)->cache, WT_CACHE_POOL_RUN); i++) {
+ FLD_ISSET(S2C(session)->cache->pool_flags, WT_CACHE_POOL_RUN);
+ i++) {
__cache_pool_adjust(
session, highest, bump_threshold, forward, &adjusted);
/*
@@ -760,7 +761,7 @@ __wt_cache_pool_server(void *arg)
forward = true;
while (F_ISSET(cp, WT_CACHE_POOL_ACTIVE) &&
- F_ISSET(cache, WT_CACHE_POOL_RUN)) {
+ FLD_ISSET(cache->pool_flags, WT_CACHE_POOL_RUN)) {
if (cp->currently_used <= cp->size)
__wt_cond_wait(
session, cp->cache_pool_cond, WT_MILLION, NULL);
@@ -770,12 +771,12 @@ __wt_cache_pool_server(void *arg)
* lock on shutdown.
*/
if (!F_ISSET(cp, WT_CACHE_POOL_ACTIVE) &&
- F_ISSET(cache, WT_CACHE_POOL_RUN))
+ FLD_ISSET(cache->pool_flags, WT_CACHE_POOL_RUN))
break;
/* Try to become the managing thread */
if (__wt_atomic_cas8(&cp->pool_managed, 0, 1)) {
- F_SET(cache, WT_CACHE_POOL_MANAGER);
+ FLD_SET(cache->pool_flags, WT_CACHE_POOL_MANAGER);
__wt_verbose(session, WT_VERB_SHARED_CACHE,
"Cache pool switched manager thread");
}
@@ -784,7 +785,7 @@ __wt_cache_pool_server(void *arg)
* Continue even if there was an error. Details of errors are
* reported in the balance function.
*/
- if (F_ISSET(cache, WT_CACHE_POOL_MANAGER)) {
+ if (FLD_ISSET(cache->pool_flags, WT_CACHE_POOL_MANAGER)) {
__cache_pool_balance(session, forward);
forward = !forward;
}
diff --git a/src/third_party/wiredtiger/src/conn/conn_ckpt.c b/src/third_party/wiredtiger/src/conn/conn_ckpt.c
index 7797ed4421c..a47524af2d7 100644
--- a/src/third_party/wiredtiger/src/conn/conn_ckpt.c
+++ b/src/third_party/wiredtiger/src/conn/conn_ckpt.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -231,7 +231,7 @@ __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session)
WT_TRET(__wt_thread_join(session, conn->ckpt_tid));
conn->ckpt_tid_set = false;
}
- WT_TRET(__wt_cond_destroy(session, &conn->ckpt_cond));
+ __wt_cond_destroy(session, &conn->ckpt_cond);
/* Close the server thread's session. */
if (conn->ckpt_session != NULL) {
diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
index 657cdebf7ee..d4670562eb8 100644
--- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c
+++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -52,7 +52,7 @@ __wt_conn_dhandle_alloc(
WT_RET(__wt_calloc_one(session, &dhandle));
- __wt_rwlock_init(session, &dhandle->rwlock);
+ WT_ERR(__wt_rwlock_init(session, &dhandle->rwlock));
dhandle->name_hash = __wt_hash_city64(uri, strlen(uri));
WT_ERR(__wt_strdup(session, uri, &dhandle->name));
WT_ERR(__wt_strdup(session, checkpoint, &dhandle->checkpoint));
@@ -199,8 +199,13 @@ __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force)
/* Reset the tree's eviction priority (if any). */
__wt_evict_priority_clear(session);
}
- if (!marked_dead || final)
- WT_ERR(__wt_checkpoint_close(session, final));
+ if (!marked_dead || final) {
+ if ((ret = __wt_checkpoint_close(
+ session, final)) == EBUSY)
+ WT_ERR(ret);
+ else
+ WT_TRET(ret);
+ }
}
WT_TRET(__wt_btree_close(session));
@@ -364,8 +369,8 @@ __wt_conn_btree_open(
F_SET(dhandle, WT_DHANDLE_OPEN);
/*
- * Checkpoint handles are read only, so eviction calculations
- * based on the number of btrees are better to ignore them.
+ * Checkpoint handles are read-only, so eviction calculations based on
+ * the number of btrees are better to ignore them.
*/
if (dhandle->checkpoint == NULL)
++S2C(session)->open_btree_count;
@@ -634,7 +639,7 @@ int
__wt_conn_dhandle_discard(WT_SESSION_IMPL *session)
{
WT_CONNECTION_IMPL *conn;
- WT_DATA_HANDLE *dhandle;
+ WT_DATA_HANDLE *dhandle, *dhandle_tmp;
WT_DECL_RET;
conn = S2C(session);
@@ -680,10 +685,11 @@ restart:
WT_TRET(session->meta_cursor->close(session->meta_cursor));
/* Close the metadata file handle. */
- while ((dhandle = TAILQ_FIRST(&conn->dhqh)) != NULL)
+ WT_TAILQ_SAFE_REMOVE_BEGIN(dhandle, &conn->dhqh, q, dhandle_tmp) {
WT_WITH_DHANDLE(session, dhandle,
WT_TRET(__wt_conn_dhandle_discard_single(
session, true, F_ISSET(conn, WT_CONN_IN_MEMORY))));
+ } WT_TAILQ_SAFE_REMOVE_END
return (ret);
}
diff --git a/src/third_party/wiredtiger/src/conn/conn_handle.c b/src/third_party/wiredtiger/src/conn/conn_handle.c
index 287e9ca7b99..32a0d80c1f3 100644
--- a/src/third_party/wiredtiger/src/conn/conn_handle.c
+++ b/src/third_party/wiredtiger/src/conn/conn_handle.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -62,14 +62,9 @@ __wt_connection_init(WT_CONNECTION_IMPL *conn)
WT_RET(__wt_spin_init(session, &conn->turtle_lock, "turtle file"));
/* Read-write locks */
- __wt_rwlock_init(session, &conn->dhandle_lock);
- __wt_rwlock_init(session, &conn->hot_backup_lock);
- __wt_rwlock_init(session, &conn->table_lock);
-
- WT_RET(__wt_calloc_def(session, WT_PAGE_LOCKS, &conn->page_lock));
- for (i = 0; i < WT_PAGE_LOCKS; ++i)
- WT_RET(
- __wt_spin_init(session, &conn->page_lock[i], "btree page"));
+ WT_RET(__wt_rwlock_init(session, &conn->dhandle_lock));
+ WT_RET(__wt_rwlock_init(session, &conn->hot_backup_lock));
+ WT_RET(__wt_rwlock_init(session, &conn->table_lock));
/* Setup the spin locks for the LSM manager queues. */
WT_RET(__wt_spin_init(session,
@@ -81,15 +76,8 @@ __wt_connection_init(WT_CONNECTION_IMPL *conn)
WT_RET(__wt_cond_alloc(
session, "LSM worker cond", &conn->lsm_manager.work_cond));
- /*
- * Generation numbers.
- *
- * Start split generations at one. Threads publish this generation
- * number before examining tree structures, and zero when they leave.
- * We need to distinguish between threads that are in a tree before the
- * first split has happened, and threads that are not in a tree.
- */
- conn->split_gen = 1;
+ /* Initialize the generation manager. */
+ __wt_gen_init(session);
/*
* Block manager.
@@ -113,7 +101,6 @@ void
__wt_connection_destroy(WT_CONNECTION_IMPL *conn)
{
WT_SESSION_IMPL *session;
- u_int i;
/* Check there's something to destroy. */
if (conn == NULL)
@@ -144,9 +131,6 @@ __wt_connection_destroy(WT_CONNECTION_IMPL *conn)
__wt_spin_destroy(session, &conn->schema_lock);
__wt_rwlock_destroy(session, &conn->table_lock);
__wt_spin_destroy(session, &conn->turtle_lock);
- for (i = 0; i < WT_PAGE_LOCKS; ++i)
- __wt_spin_destroy(session, &conn->page_lock[i]);
- __wt_free(session, conn->page_lock);
/* Free allocated memory. */
__wt_free(session, conn->cfg);
diff --git a/src/third_party/wiredtiger/src/conn/conn_log.c b/src/third_party/wiredtiger/src/conn/conn_log.c
index b8b5bd2a908..37acbe4a1a4 100644
--- a/src/third_party/wiredtiger/src/conn/conn_log.c
+++ b/src/third_party/wiredtiger/src/conn/conn_log.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -391,13 +391,11 @@ __log_file_server(void *arg)
WT_ERR(__wt_log_extract_lognum(session, close_fh->name,
&filenum));
/*
- * We update the close file handle before updating the
- * close LSN when changing files. It is possible we
- * could see mismatched settings. If we do, yield
- * until it is set. This should rarely happen.
+ * The closing file handle should have a correct close
+ * LSN.
*/
- while (log->log_close_lsn.l.file < filenum)
- __wt_yield();
+ WT_ASSERT(session,
+ log->log_close_lsn.l.file == filenum);
if (__wt_log_cmp(
&log->write_lsn, &log->log_close_lsn) >= 0) {
@@ -522,7 +520,7 @@ __log_file_server(void *arg)
}
if (0) {
-err: __wt_err(session, ret, "log close server error");
+err: WT_PANIC_MSG(session, ret, "log close server error");
}
if (locked)
__wt_spin_unlock(session, &log->log_sync_lock);
@@ -740,7 +738,8 @@ __log_wrlsn_server(void *arg)
WT_ERR(__wt_log_force_write(session, 1, NULL));
__wt_log_wrlsn(session, NULL);
if (0) {
-err: __wt_err(session, ret, "log wrlsn server error");
+err: WT_PANIC_MSG(session, ret, "log wrlsn server error");
+
}
return (WT_THREAD_RET_VALUE);
}
@@ -844,7 +843,7 @@ __log_server(void *arg)
}
if (0) {
-err: __wt_err(session, ret, "log server error");
+err: WT_PANIC_MSG(session, ret, "log server error");
}
return (WT_THREAD_RET_VALUE);
}
@@ -880,7 +879,7 @@ __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[])
WT_RET(__wt_spin_init(session, &log->log_sync_lock, "log sync"));
WT_RET(__wt_spin_init(session, &log->log_writelsn_lock,
"log write LSN"));
- __wt_rwlock_init(session, &log->log_archive_lock);
+ WT_RET(__wt_rwlock_init(session, &log->log_archive_lock));
if (FLD_ISSET(conn->direct_io, WT_DIRECT_IO_LOG))
log->allocsize = (uint32_t)
WT_MAX(conn->buffer_alignment, WT_LOG_ALIGN);
@@ -902,7 +901,7 @@ __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[])
WT_RET(__wt_cond_alloc(session, "log sync", &log->log_sync_cond));
WT_RET(__wt_cond_alloc(session, "log write", &log->log_write_cond));
WT_RET(__wt_log_open(session));
- WT_RET(__wt_log_slot_init(session));
+ WT_RET(__wt_log_slot_init(session, true));
return (0);
}
@@ -1043,12 +1042,12 @@ __wt_logmgr_destroy(WT_SESSION_IMPL *session)
}
/* Destroy the condition variables now that all threads are stopped */
- WT_TRET(__wt_cond_destroy(session, &conn->log_cond));
- WT_TRET(__wt_cond_destroy(session, &conn->log_file_cond));
- WT_TRET(__wt_cond_destroy(session, &conn->log_wrlsn_cond));
+ __wt_cond_destroy(session, &conn->log_cond);
+ __wt_cond_destroy(session, &conn->log_file_cond);
+ __wt_cond_destroy(session, &conn->log_wrlsn_cond);
- WT_TRET(__wt_cond_destroy(session, &conn->log->log_sync_cond));
- WT_TRET(__wt_cond_destroy(session, &conn->log->log_write_cond));
+ __wt_cond_destroy(session, &conn->log->log_sync_cond);
+ __wt_cond_destroy(session, &conn->log->log_write_cond);
__wt_rwlock_destroy(session, &conn->log->log_archive_lock);
__wt_spin_destroy(session, &conn->log->log_lock);
__wt_spin_destroy(session, &conn->log->log_slot_lock);
diff --git a/src/third_party/wiredtiger/src/conn/conn_open.c b/src/third_party/wiredtiger/src/conn/conn_open.c
index eb3c79422a0..ab7253c2828 100644
--- a/src/third_party/wiredtiger/src/conn/conn_open.c
+++ b/src/third_party/wiredtiger/src/conn/conn_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -192,7 +192,7 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn)
for (i = 0; i < conn->session_size; ++s, ++i) {
__wt_free(session, s->dhhash);
__wt_free(session, s->tablehash);
- __wt_split_stash_discard_all(session, s);
+ __wt_stash_discard_all(session, s);
__wt_free(session, s->hazard);
}
diff --git a/src/third_party/wiredtiger/src/conn/conn_stat.c b/src/third_party/wiredtiger/src/conn/conn_stat.c
index d89392b66c6..f38d81a7f7a 100644
--- a/src/third_party/wiredtiger/src/conn/conn_stat.c
+++ b/src/third_party/wiredtiger/src/conn/conn_stat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -83,9 +83,9 @@ __wt_conn_stat_init(WT_SESSION_IMPL *session)
stats, session_cursor_open, conn->open_cursor_count);
WT_STAT_SET(session, stats, dh_conn_handle_count, conn->dhandle_count);
WT_STAT_SET(session,
- stats, rec_split_stashed_objects, conn->split_stashed_objects);
+ stats, rec_split_stashed_objects, conn->stashed_objects);
WT_STAT_SET(session,
- stats, rec_split_stashed_bytes, conn->split_stashed_bytes);
+ stats, rec_split_stashed_bytes, conn->stashed_bytes);
}
/*
@@ -648,7 +648,7 @@ __wt_statlog_destroy(WT_SESSION_IMPL *session, bool is_close)
WT_TRET(__wt_thread_join(session, conn->stat_tid));
conn->stat_tid_set = false;
}
- WT_TRET(__wt_cond_destroy(session, &conn->stat_cond));
+ __wt_cond_destroy(session, &conn->stat_cond);
/* Log a set of statistics on shutdown if configured. */
if (is_close)
diff --git a/src/third_party/wiredtiger/src/conn/conn_sweep.c b/src/third_party/wiredtiger/src/conn/conn_sweep.c
index 22d90b08438..df60a3c784d 100644
--- a/src/third_party/wiredtiger/src/conn/conn_sweep.c
+++ b/src/third_party/wiredtiger/src/conn/conn_sweep.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2014-2017 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -219,15 +219,12 @@ static int
__sweep_remove_handles(WT_SESSION_IMPL *session)
{
WT_CONNECTION_IMPL *conn;
- WT_DATA_HANDLE *dhandle, *dhandle_next;
+ WT_DATA_HANDLE *dhandle, *dhandle_tmp;
WT_DECL_RET;
conn = S2C(session);
- for (dhandle = TAILQ_FIRST(&conn->dhqh);
- dhandle != NULL;
- dhandle = dhandle_next) {
- dhandle_next = TAILQ_NEXT(dhandle, q);
+ TAILQ_FOREACH_SAFE(dhandle, &conn->dhqh, q, dhandle_tmp) {
if (WT_IS_METADATA(dhandle))
continue;
if (!WT_DHANDLE_CAN_DISCARD(dhandle))
@@ -432,7 +429,7 @@ __wt_sweep_destroy(WT_SESSION_IMPL *session)
WT_TRET(__wt_thread_join(session, conn->sweep_tid));
conn->sweep_tid_set = 0;
}
- WT_TRET(__wt_cond_destroy(session, &conn->sweep_cond));
+ __wt_cond_destroy(session, &conn->sweep_cond);
if (conn->sweep_session != NULL) {
wt_session = &conn->sweep_session->iface;