diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2017-01-22 17:38:06 -0500 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-01-23 09:38:06 +1100 |
commit | 573bc1a8027e21176c1f3e27483b0abc719131a0 (patch) | |
tree | 394dbfcd45c88f0397ab5af4269a5eb9191e65bd | |
parent | 3ac01b8a147ed5652199c0e577f3300bf4d78a57 (diff) | |
download | mongo-573bc1a8027e21176c1f3e27483b0abc719131a0.tar.gz |
Set the database home and configure error handling before (#3256)
loading extensions, custom filesystems (for example) needs to know the database home.
-rw-r--r-- | src/conn/conn_api.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index 50617240d38..f691a76b1f2 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -2175,6 +2175,15 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, if (cval.val) F_SET(conn, WT_CONN_READONLY); + /* Configure error messages so we get them right early. */ + WT_ERR(__wt_config_gets(session, cfg, "error_prefix", &cval)); + if (cval.len != 0) + WT_ERR(__wt_strndup( + session, cval.str, cval.len, &conn->error_prefix)); + + /* Set the database home so extensions have access to it. */ + WT_ERR(__conn_home(session, home, cfg)); + /* * Load early extensions before doing further initialization (one early * extension is to configure a file system). @@ -2198,6 +2207,9 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, WT_ERR( __conn_chk_file_system(session, F_ISSET(conn, WT_CONN_READONLY))); + /* Make sure no other thread of control already owns this database. */ + WT_ERR(__conn_single(session, cfg)); + /* * Capture the config_base setting file for later use. Again, if the * application doesn't want us to read the base configuration file, @@ -2207,18 +2219,6 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler, WT_ERR(__wt_config_gets(session, cfg, "config_base", &cval)); config_base_set = cval.val != 0; - /* Configure error messages so we get them right early. */ - WT_ERR(__wt_config_gets(session, cfg, "error_prefix", &cval)); - if (cval.len != 0) - WT_ERR(__wt_strndup( - session, cval.str, cval.len, &conn->error_prefix)); - - /* Get the database home. */ - WT_ERR(__conn_home(session, home, cfg)); - - /* Make sure no other thread of control already owns this database. */ - WT_ERR(__conn_single(session, cfg)); - /* * Build the real configuration stack, in the following order (where * later entries override earlier entries): |