summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-09-09 16:04:50 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-09 06:34:13 +0000
commitf01a90978ad005fe95103aa30322c614e5e81009 (patch)
tree86ec1eb48eb0fd6a341cb4b69ebeebb045832aa7
parent907fc9e6cd7de15307f78aaea1994d40ec717f3a (diff)
downloadmongo-f01a90978ad005fe95103aa30322c614e5e81009.tar.gz
Import wiredtiger: 0ac82ac3fb889ed948dcb23ef77b3cd82d6de935 from branch mongodb-6.1
ref: e605c3eee1..0ac82ac3fb for: 6.1.0-rc2 WT-9799 Only reconfigure every 2+ seconds. (#8233)
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c42
2 files changed, 28 insertions, 16 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 57bf4d949d3..913b1ffbd6a 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-6.1",
- "commit": "e605c3eee1daaf355d7a498dd3dc89036c43c2d8"
+ "commit": "0ac82ac3fb889ed948dcb23ef77b3cd82d6de935"
}
diff --git a/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c b/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c
index 66769c008ff..0782168ec5f 100644
--- a/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c
+++ b/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c
@@ -70,6 +70,7 @@ static char home[1024]; /* Program working dir */
#define RECORDS_FILE "records-%" PRIu32
/* Include worker threads and prepare extra sessions */
#define SESSION_MAX (MAX_TH + 3 + MAX_TH * PREPARE_PCT)
+#define STAT_WAIT 1
static const char *table_pfx = "table";
static const char *const uri_collection = "collection";
@@ -99,7 +100,7 @@ static uint64_t global_ts = 1;
"debug_mode=(table_logging=true,checkpoint_retention=5)," \
"eviction_updates_target=20,eviction_updates_trigger=90," \
"log=(enabled,file_max=10M,remove=true),session_max=%d," \
- "statistics=(fast),statistics_log=(wait=1,json=true)"
+ "statistics=(fast),statistics_log=(wait=%d,json=true)"
#define ENV_CONFIG_TXNSYNC \
ENV_CONFIG_DEF \
",transaction_sync=(enabled,method=none)"
@@ -155,6 +156,7 @@ thread_ts_run(void *arg)
WT_SESSION *session;
THREAD_DATA *td;
wt_timestamp_t last_ts, ts;
+ uint64_t last_reconfig, now;
uint32_t rand_op;
int dbg;
char tscfg[64];
@@ -165,6 +167,7 @@ thread_ts_run(void *arg)
testutil_check(conn->open_session(conn, NULL, NULL, &session));
__wt_random_init_seed((WT_SESSION_IMPL *)session, &rnd);
+ __wt_seconds((WT_SESSION_IMPL *)session, &last_reconfig);
/* Update the oldest/stable timestamps every 1 millisecond. */
for (last_ts = 0;; __wt_sleep(0, 1000)) {
/* Get the last committed timestamp periodically in order to update the oldest timestamp. */
@@ -183,17 +186,26 @@ thread_ts_run(void *arg)
testutil_check(conn->set_timestamp(conn, tscfg));
/*
- * Set and reset the checkpoint retention setting on a regular basis. We want to test racing
- * with the internal log removal thread while we're here.
+ * Only perform the reconfigure test after statistics have a chance to run. If we do it too
+ * frequently then internal servers like the statistics server get destroyed and restarted
+ * too fast to do any work.
*/
- dbg = __wt_random(&rnd) % 2;
- if (dbg == 0)
- testutil_check(
- __wt_snprintf(tscfg, sizeof(tscfg), "debug_mode=(checkpoint_retention=0)"));
- else
- testutil_check(
- __wt_snprintf(tscfg, sizeof(tscfg), "debug_mode=(checkpoint_retention=5)"));
- testutil_check(conn->reconfigure(conn, tscfg));
+ __wt_seconds((WT_SESSION_IMPL *)session, &now);
+ if (now > last_reconfig + STAT_WAIT + 1) {
+ /*
+ * Set and reset the checkpoint retention setting on a regular basis. We want to test
+ * racing with the internal log removal thread while we're here.
+ */
+ dbg = __wt_random(&rnd) % 2;
+ if (dbg == 0)
+ testutil_check(
+ __wt_snprintf(tscfg, sizeof(tscfg), "debug_mode=(checkpoint_retention=0)"));
+ else
+ testutil_check(
+ __wt_snprintf(tscfg, sizeof(tscfg), "debug_mode=(checkpoint_retention=5)"));
+ testutil_check(conn->reconfigure(conn, tscfg));
+ last_reconfig = now;
+ }
}
/* NOTREACHED */
}
@@ -491,11 +503,11 @@ run_workload(void)
if (chdir(home) != 0)
testutil_die(errno, "Child chdir: %s", home);
if (inmem)
- testutil_check(
- __wt_snprintf(envconf, sizeof(envconf), ENV_CONFIG_DEF, cache_mb, SESSION_MAX));
+ testutil_check(__wt_snprintf(
+ envconf, sizeof(envconf), ENV_CONFIG_DEF, cache_mb, SESSION_MAX, STAT_WAIT));
else
- testutil_check(
- __wt_snprintf(envconf, sizeof(envconf), ENV_CONFIG_TXNSYNC, cache_mb, SESSION_MAX));
+ testutil_check(__wt_snprintf(
+ envconf, sizeof(envconf), ENV_CONFIG_TXNSYNC, cache_mb, SESSION_MAX, STAT_WAIT));
if (compat)
strcat(envconf, ENV_CONFIG_ADD_COMPAT);
if (stress)