summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2016-06-20 16:18:35 +1000
committerDavid Hows <howsdav@gmail.com>2016-06-22 11:47:23 +1000
commit7de0e11ea9c8a0ad2772e75d960927592532566b (patch)
tree983c2e622440d4253c114805fb564b0a4498231e /src/third_party/wiredtiger
parent7ebc2695ae310260c4706834c25e34489b57c72e (diff)
downloadmongo-7de0e11ea9c8a0ad2772e75d960927592532566b.tar.gz
Import wiredtiger-wiredtiger-2.8.0-210-ga6a64e9.tar.gz from wiredtiger branch mongodb-3.2
ref: 234b68b..a6a64e9 WT-2646 Split the lock_wait flag into two, adding a checkpoint_wait flag SERVER-24428 WiredTiger changes for MongoDB 3.2.8
Diffstat (limited to 'src/third_party/wiredtiger')
-rw-r--r--src/third_party/wiredtiger/dist/api_data.py10
-rw-r--r--src/third_party/wiredtiger/src/config/config_def.c5
-rw-r--r--src/third_party/wiredtiger/src/include/wiredtiger.in3
-rw-r--r--src/third_party/wiredtiger/src/session/session_api.c21
4 files changed, 26 insertions, 13 deletions
diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py
index 5ca294a5d60..8cfa83dadc4 100644
--- a/src/third_party/wiredtiger/dist/api_data.py
+++ b/src/third_party/wiredtiger/dist/api_data.py
@@ -787,15 +787,19 @@ methods = {
]),
'WT_SESSION.drop' : Method([
+ Config('checkpoint_wait', 'true', r'''
+ wait for the checkpoint lock, if \c checkpoint_wait=false, fail if
+ this lock is not available immediately''',
+ type='boolean', undoc=True),
Config('force', 'false', r'''
return success if the object does not exist''',
type='boolean'),
- Config('remove_files', 'true', r'''
- should the underlying files be removed?''',
- type='boolean'),
Config('lock_wait', 'true', r'''
wait for locks, if \c lock_wait=false, fail if any required locks are
not available immediately''',
+ type='boolean', undoc=True),
+ Config('remove_files', 'true', r'''
+ should the underlying files be removed?''',
type='boolean'),
]),
diff --git a/src/third_party/wiredtiger/src/config/config_def.c b/src/third_party/wiredtiger/src/config/config_def.c
index 5b6f0bac323..4b601fbc53a 100644
--- a/src/third_party/wiredtiger/src/config/config_def.c
+++ b/src/third_party/wiredtiger/src/config/config_def.c
@@ -291,6 +291,7 @@ static const WT_CONFIG_CHECK confchk_WT_SESSION_create[] = {
};
static const WT_CONFIG_CHECK confchk_WT_SESSION_drop[] = {
+ { "checkpoint_wait", "boolean", NULL, NULL, NULL, 0 },
{ "force", "boolean", NULL, NULL, NULL, 0 },
{ "lock_wait", "boolean", NULL, NULL, NULL, 0 },
{ "remove_files", "boolean", NULL, NULL, NULL, 0 },
@@ -1026,8 +1027,8 @@ static const WT_CONFIG_ENTRY config_entries[] = {
confchk_WT_SESSION_create, 40
},
{ "WT_SESSION.drop",
- "force=0,lock_wait=,remove_files=",
- confchk_WT_SESSION_drop, 3
+ "checkpoint_wait=,force=0,lock_wait=,remove_files=",
+ confchk_WT_SESSION_drop, 4
},
{ "WT_SESSION.join",
"bloom_bit_count=16,bloom_hash_count=8,compare=\"eq\",count=,"
diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in
index 279858a808e..5c2efad77e0 100644
--- a/src/third_party/wiredtiger/src/include/wiredtiger.in
+++ b/src/third_party/wiredtiger/src/include/wiredtiger.in
@@ -1221,9 +1221,6 @@ struct __wt_session {
* @configstart{WT_SESSION.drop, see dist/api_data.py}
* @config{force, return success if the object does not exist., a
* boolean flag; default \c false.}
- * @config{lock_wait, wait for locks\, if \c lock_wait=false\, fail if
- * any required locks are not available immediately., a boolean flag;
- * default \c true.}
* @config{remove_files, should the underlying files be removed?., a
* boolean flag; default \c true.}
* @configend
diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c
index bb496494234..eaa3781169b 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);