summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/session/session_compact.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2018-11-02 16:36:36 +1100
committerLuke Chen <luke.chen@mongodb.com>2018-11-02 16:36:36 +1100
commita19da30a1bf7462c9a8a0533c43f98bd13fbb190 (patch)
tree090e8225ea84e4971a077dd26dadf3c61068bf33 /src/third_party/wiredtiger/src/session/session_compact.c
parent1559bd33d108e58ffdc0df5fa2af4cc163ae9721 (diff)
downloadmongo-a19da30a1bf7462c9a8a0533c43f98bd13fbb190.tar.gz
Import wiredtiger: e8cf194d813096cc2b30c0dd2d9d9c93ade79756 from branch mongodb-4.2
ref: 22b1224ee0..e8cf194d81 for: 4.1.5 WT-4298 Fix workgen to retry on WT_ROLLBACK and clear ops after warmup WT-4343 Unlock when sleeping to allow other log threads to make progress WT-4371 Workgen improvements to create a MongoDB-like workload WT-4376 Fix a bug where table index open can race WT-4385 Prepare-conflict during a cursor scan can return the wrong key WT-4392 A large lint change WT-4395 Seg fault walking corrupted log with log cursor WT-4396 When retrying after prepare-conflict, cursor unable to find a valid update WT-4400 Fix workgen use of PRIxxx macros, needed for old C++ compilers
Diffstat (limited to 'src/third_party/wiredtiger/src/session/session_compact.c')
-rw-r--r--src/third_party/wiredtiger/src/session/session_compact.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/session/session_compact.c b/src/third_party/wiredtiger/src/session/session_compact.c
index 96761ff8745..af93576084f 100644
--- a/src/third_party/wiredtiger/src/session/session_compact.c
+++ b/src/third_party/wiredtiger/src/session/session_compact.c
@@ -405,10 +405,15 @@ __wt_session_compact(
session->compact->max_time = (uint64_t)cval.val;
__wt_epoch(session, &session->compact->begin);
- /* Find the types of data sources being compacted. */
+ /*
+ * Find the types of data sources being compacted. This could involve
+ * opening indexes for a table, so acquire the table lock in write
+ * mode.
+ */
WT_WITH_SCHEMA_LOCK(session,
- ret = __wt_schema_worker(session, uri,
- __compact_handle_append, __compact_uri_analyze, cfg, 0));
+ WT_WITH_TABLE_WRITE_LOCK(session,
+ ret = __wt_schema_worker(session, uri,
+ __compact_handle_append, __compact_uri_analyze, cfg, 0)));
WT_ERR(ret);
if (session->compact->lsm_count != 0)