summaryrefslogtreecommitdiff
path: root/src/conn/conn_open.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2016-03-18 14:04:39 -0400
committerKeith Bostic <keith@wiredtiger.com>2016-03-18 14:04:39 -0400
commitf663a6dec51c7510ef10b2835983190fb84b0ebf (patch)
treed550127c7b73fbcb7228d8fc73048740c61c4df9 /src/conn/conn_open.c
parentf81298c6d0610389b2e97420bc4ffda9fc466e1c (diff)
downloadmongo-f663a6dec51c7510ef10b2835983190fb84b0ebf.tar.gz
WT-2330: in-memory configurations should not create on-disk collection files
Create a pluggable OS layer, add in-memory version so in-memory configurations don't create on-disk files. Notes: The WiredTiger library no longer uses FILE * objects, the file descriptor and stream functions now use the same open and close functions, and both have a WT_FH handle. The sync/async versions of __wt_fsync have been merged, there's now a boolean flag that indicates wait/no-wait on the flush. The transaction log's print-log function no longer supports unspecified handles, output is always to stdout (which the wt utility redirects into another file as needed).
Diffstat (limited to 'src/conn/conn_open.c')
-rw-r--r--src/conn/conn_open.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/conn/conn_open.c b/src/conn/conn_open.c
index 58577b4587d..f682ab1ce77 100644
--- a/src/conn/conn_open.c
+++ b/src/conn/conn_open.c
@@ -76,7 +76,6 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn)
WT_CONNECTION *wt_conn;
WT_DECL_RET;
WT_DLH *dlh;
- WT_FH *fh;
WT_SESSION_IMPL *s, *session;
WT_TXN_GLOBAL *txn_global;
u_int i;
@@ -150,20 +149,6 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn)
WT_TRET(__wt_conn_remove_encryptor(session));
WT_TRET(__wt_conn_remove_extractor(session));
- /*
- * Complain if files weren't closed, ignoring the lock file, we'll
- * close it in a minute.
- */
- TAILQ_FOREACH(fh, &conn->fhqh, q) {
- if (fh == conn->lock_fh)
- continue;
-
- __wt_errx(session,
- "Connection has open file handles: %s", fh->name);
- WT_TRET(__wt_close(session, &fh));
- fh = TAILQ_FIRST(&conn->fhqh);
- }
-
/* Disconnect from shared cache - must be before cache destroy. */
WT_TRET(__wt_conn_cache_pool_destroy(session));
@@ -182,6 +167,13 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn)
WT_TRET(__wt_dlclose(session, dlh));
}
+ /* Close the lock file, opening up the database to other connections. */
+ if (conn->lock_fh != NULL)
+ WT_TRET(__wt_close(session, &conn->lock_fh));
+
+ /* Close any file handles left open. */
+ WT_TRET(__wt_close_connection_close(session));
+
/*
* Close the internal (default) session, and switch back to the dummy
* session in case of any error messages from the remaining operations