From 534acf779eedf07144c3845287555501f7e27901 Mon Sep 17 00:00:00 2001 From: Etienne Petrel Date: Wed, 31 Aug 2022 14:05:32 +0000 Subject: Import wiredtiger: 0ac82ac3fb889ed948dcb23ef77b3cd82d6de935 from branch mongodb-master ref: e605c3eee1..0ac82ac3fb for: 6.2.0-rc0 WT-9799 Only reconfigure every 2+ seconds. (#8233) --- src/third_party/wiredtiger/import.data | 2 +- .../wiredtiger/test/csuite/timestamp_abort/main.c | 42 ++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 4f74cebe3d4..2c0c864275e 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-master", - "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) -- cgit v1.2.1