summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/session/session_api.c
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2016-05-27 15:51:43 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-05-27 15:51:52 +1000
commitf5be31696774455a67ca8c3f6268252d1d4086a4 (patch)
tree9ab8d44354f28d9e2db7309ab81fc4ae71dc102e /src/third_party/wiredtiger/src/session/session_api.c
parent832d65c6eec6eb4314b2700a18a332185b5baa36 (diff)
downloadmongo-f5be31696774455a67ca8c3f6268252d1d4086a4.tar.gz
Import wiredtiger-wiredtiger-2.8.0-441-g6f9a7a4.tar.gz from wiredtiger branch mongodb-3.4
ref: 636a7b2..6f9a7a4 WT-2554 Implement a framework for adding C test cases WT-2610 Investigate eviction hazard pointer check WT-2611 wtperf and/or WT_CONFIG_PARSER do not allow escaped double quotes WT-2617 Bug in pluggable file system example WT-2624 snprintf unsupported on MSVC 2013 WT-2626 snprintf errors with macro redefinition on MSVC2015 WT-2627 Coverity complaints WT-2628 reconciliation can return without unlocking the page lock WT-2629 Introduction of ppc64le crc32c assembly file has made the stack executable WT-2630 Rename WT_FSTREAM methods to avoid using C99 reserved names WT-2632 Test format failures due to "checkpoints cannot be dropped when in-use" WT-2637 The file-extension documentation doesn't cover not-supported cases WT-2644 'wt load -r' (rename) fails with LSM WT-2646 Split the lock_wait flag into two, adding a checkpoint_wait flag WT-2651 Coverity 1355591 resource leak WT-2653 the custom file-system example should show device configuration WT-2656 Builds failing on GCC 4.7 builder WT-2659 csuite tests, assorted lint and cleanup. WT-2660 Hang between eviction and connection close WT-2661 Coverity failures: 1356050-1356053 WT-2662 For internal spell checking, strip out double quote literals, they confuse aspell SERVER-24151 WiredTiger changes for MongoDB 3.3.7
Diffstat (limited to 'src/third_party/wiredtiger/src/session/session_api.c')
-rw-r--r--src/third_party/wiredtiger/src/session/session_api.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c
index 933f2273902..77d1dc74c84 100644
--- a/src/third_party/wiredtiger/src/session/session_api.c
+++ b/src/third_party/wiredtiger/src/session/session_api.c
@@ -722,18 +722,29 @@ __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
{
WT_DECL_RET;
WT_CONFIG_ITEM cval;
- bool lock_wait;
+ bool checkpoint_wait, lock_wait;
+ WT_RET(__wt_config_gets_def(session, cfg, "checkpoint_wait", 1, &cval));
+ checkpoint_wait = cval.val != 0;
WT_RET(__wt_config_gets_def(session, cfg, "lock_wait", 1, &cval));
lock_wait = cval.val != 0 || F_ISSET(session, WT_SESSION_LOCK_NO_WAIT);
if (!lock_wait)
F_SET(session, WT_SESSION_LOCK_NO_WAIT);
- WT_WITH_CHECKPOINT_LOCK(session, ret,
- WT_WITH_SCHEMA_LOCK(session, ret,
- WT_WITH_TABLE_LOCK(session, ret,
- ret = __wt_schema_drop(session, uri, cfg))));
+ /*
+ * The checkpoint lock only is needed to avoid a spurious EBUSY error
+ * return.
+ */
+ if (checkpoint_wait)
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_TABLE_LOCK(session, ret,
+ ret = __wt_schema_drop(session, uri, cfg))));
+ else
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_TABLE_LOCK(session, ret,
+ ret = __wt_schema_drop(session, uri, cfg)));
if (!lock_wait)
F_CLR(session, WT_SESSION_LOCK_NO_WAIT);
@@ -1512,11 +1523,11 @@ err: WT_TRET(__wt_writeunlock(session, txn_global->nsnap_rwlock));
}
/*
- * __session_strerror --
+ * __wt_session_strerror --
* WT_SESSION->strerror method.
*/
-static const char *
-__session_strerror(WT_SESSION *wt_session, int error)
+const char *
+__wt_session_strerror(WT_SESSION *wt_session, int error)
{
WT_SESSION_IMPL *session;
@@ -1539,7 +1550,7 @@ __open_session(WT_CONNECTION_IMPL *conn,
NULL,
__session_close,
__session_reconfigure,
- __session_strerror,
+ __wt_session_strerror,
__session_open_cursor,
__session_create,
__wt_session_compact,
@@ -1566,7 +1577,7 @@ __open_session(WT_CONNECTION_IMPL *conn,
NULL,
__session_close,
__session_reconfigure,
- __session_strerror,
+ __wt_session_strerror,
__session_open_cursor,
__session_create_readonly,
__wt_session_compact_readonly,
@@ -1675,7 +1686,7 @@ __open_session(WT_CONNECTION_IMPL *conn,
* __wt_hazard_close ensures the array is cleared - so it is safe to
* reset the starting size on each open.
*/
- session_ret->hazard_size = WT_HAZARD_INCR;
+ session_ret->hazard_size = 0;
/*
* Configuration: currently, the configuration for open_session is the