summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/session/session_api.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-09-24 15:18:52 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-24 06:25:16 +0000
commitdcdd27376de36e0f6c036d681900525d5d28a55f (patch)
treed5df5aa2f6fcf39aa894467ca5810286fb1a1ddf /src/third_party/wiredtiger/src/session/session_api.c
parent952631861a6dbebd8069b465574ce4f9cbb9144b (diff)
downloadmongo-dcdd27376de36e0f6c036d681900525d5d28a55f.tar.gz
Import wiredtiger: 4466ce2af978e716ab852f805b53a29383187dae from branch mongodb-master
ref: 28ebf78d2d..4466ce2af9 for: 5.1.0 WT-8055 Fix issue when compact quits when running at the same time as a checkpoint
Diffstat (limited to 'src/third_party/wiredtiger/src/session/session_api.c')
-rw-r--r--src/third_party/wiredtiger/src/session/session_api.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c
index 5a4320b493e..8353a6e9d5a 100644
--- a/src/third_party/wiredtiger/src/session/session_api.c
+++ b/src/third_party/wiredtiger/src/session/session_api.c
@@ -672,22 +672,18 @@ err:
}
/*
- * __wt_session_blocking_checkpoint --
+ * __session_blocking_checkpoint --
* Perform a checkpoint or wait if it is already running to resolve an EBUSY error.
*/
-int
-__wt_session_blocking_checkpoint(WT_SESSION_IMPL *session, bool force, uint64_t seconds)
+static int
+__session_blocking_checkpoint(WT_SESSION_IMPL *session)
{
WT_DECL_RET;
WT_TXN_GLOBAL *txn_global;
uint64_t txn_gen;
- const char *cfg[3] = {NULL, NULL, NULL};
+ const char *checkpoint_cfg[] = {WT_CONFIG_BASE(session, WT_SESSION_checkpoint), NULL};
- cfg[0] = WT_CONFIG_BASE(session, WT_SESSION_checkpoint);
- if (force)
- cfg[1] = "force=1";
-
- if ((ret = __wt_txn_checkpoint(session, cfg, false)) == 0)
+ if ((ret = __wt_txn_checkpoint(session, checkpoint_cfg, false)) == 0)
return (0);
WT_RET_BUSY_OK(ret);
@@ -704,13 +700,6 @@ __wt_session_blocking_checkpoint(WT_SESSION_IMPL *session, bool force, uint64_t
*/
if (!txn_global->checkpoint_running || txn_gen != __wt_gen(session, WT_GEN_CHECKPOINT))
break;
-
- /* If there's a timeout, give up. */
- if (seconds == 0)
- continue;
- if (seconds <= WT_CKPT_WAIT)
- return (EBUSY);
- seconds -= WT_CKPT_WAIT;
}
return (0);
@@ -735,7 +724,7 @@ __session_alter(WT_SESSION *wt_session, const char *uri, const char *config)
*/
ret = __session_alter_internal(session, uri, config);
if (ret == EBUSY) {
- WT_RET(__wt_session_blocking_checkpoint(session, false, 0));
+ WT_RET(__session_blocking_checkpoint(session));
WT_STAT_CONN_INCR(session, session_table_alter_trigger_checkpoint);
ret = __session_alter_internal(session, uri, config);
}