summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/bt_compact.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_compact.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_compact.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_compact.c b/src/third_party/wiredtiger/src/btree/bt_compact.c
index e005674762d..2edcac76d0b 100644
--- a/src/third_party/wiredtiger/src/btree/bt_compact.c
+++ b/src/third_party/wiredtiger/src/btree/bt_compact.c
@@ -90,16 +90,15 @@ __compact_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp)
* Compact a file.
*/
int
-__wt_compact(WT_SESSION_IMPL *session, const char *cfg[])
+__wt_compact(WT_SESSION_IMPL *session)
{
WT_BM *bm;
WT_BTREE *btree;
WT_DECL_RET;
WT_REF *ref;
+ u_int i;
bool skip;
- WT_UNUSED(cfg);
-
btree = S2BT(session);
bm = btree->bm;
ref = NULL;
@@ -129,7 +128,13 @@ __wt_compact(WT_SESSION_IMPL *session, const char *cfg[])
__wt_spin_lock(session, &btree->flush_lock);
/* Walk the tree reviewing pages to see if they should be re-written. */
- for (;;) {
+ for (i = 0;;) {
+ /* Periodically check if we've run out of time. */
+ if (++i > 100) {
+ WT_ERR(__wt_session_compact_check_timeout(session));
+ i = 0;
+ }
+
/*
* Pages read for compaction aren't "useful"; don't update the
* read generation of pages already in memory, and if a page is