summaryrefslogtreecommitdiff
path: root/src/session/session_compact.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/session/session_compact.c')
-rw-r--r--src/session/session_compact.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/session/session_compact.c b/src/session/session_compact.c
index 456fcd3ce03..5abccbd1366 100644
--- a/src/session/session_compact.c
+++ b/src/session/session_compact.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -172,12 +172,12 @@ __compact_file(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
for (i = 0; i < 100; ++i) {
WT_ERR(__wt_txn_checkpoint(session, checkpoint_cfg));
- session->compaction = false;
- WT_WITH_SCHEMA_LOCK(session,
+ session->compact_state = WT_COMPACT_RUNNING;
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_schema_worker(
session, uri, __wt_compact, NULL, cfg, 0));
WT_ERR(ret);
- if (!session->compaction)
+ if (session->compact_state != WT_COMPACT_SUCCESS)
break;
WT_ERR(__wt_txn_checkpoint(session, checkpoint_cfg));
@@ -185,7 +185,9 @@ __compact_file(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
WT_ERR(__session_compact_check_timeout(session, start_time));
}
-err: __wt_scr_free(session, &t);
+err: session->compact_state = WT_COMPACT_NONE;
+
+ __wt_scr_free(session, &t);
return (ret);
}
@@ -226,7 +228,8 @@ __wt_session_compact(
session->compact->max_time = (uint64_t)cval.val;
/* Find the types of data sources are being compacted. */
- WT_WITH_SCHEMA_LOCK(session, ret = __wt_schema_worker(
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ ret = __wt_schema_worker(
session, uri, NULL, __wt_compact_uri_analyze, cfg, 0));
WT_ERR(ret);