summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2016-02-16 15:23:25 +1100
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-02-16 15:23:25 +1100
commit711a07877131ccc3aa94b0cc0bfb68313efdb252 (patch)
tree40d35b0bb1dd2dac5d3af664fe439be0405efb43
parent275da68d2223042f3adadd8ac716a57ef33031f5 (diff)
parent8a95c6eed396d0e837e36fc33a5378be85c8b978 (diff)
downloadmongo-711a07877131ccc3aa94b0cc0bfb68313efdb252.tar.gz
Merge pull request #2496 from wiredtiger/wt-2396-drop-checkpoint-lock
WT-2396 Grab the checkpoint lock around drops and renames.
-rw-r--r--src/session/session_api.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/session/session_api.c b/src/session/session_api.c
index c03b5fdc044..5511674dc5e 100644
--- a/src/session/session_api.c
+++ b/src/session/session_api.c
@@ -597,9 +597,10 @@ __session_rename(WT_SESSION *wt_session,
WT_ERR(__wt_str_name_check(session, uri));
WT_ERR(__wt_str_name_check(session, newuri));
- WT_WITH_SCHEMA_LOCK(session, ret,
- WT_WITH_TABLE_LOCK(session, ret,
- ret = __wt_schema_rename(session, uri, newuri, cfg)));
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_TABLE_LOCK(session, ret,
+ ret = __wt_schema_rename(session, uri, newuri, cfg))));
err: API_END_RET_NOTFOUND_MAP(session, ret);
}
@@ -646,9 +647,10 @@ __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
if (!lock_wait)
F_SET(session, WT_SESSION_LOCK_NO_WAIT);
- WT_WITH_SCHEMA_LOCK(session, ret,
- WT_WITH_TABLE_LOCK(session, ret,
- ret = __wt_schema_drop(session, uri, cfg)));
+ 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))));
if (!lock_wait)
F_CLR(session, WT_SESSION_LOCK_NO_WAIT);