diff options
author | Luke Chen <luke.chen@mongodb.com> | 2020-03-24 16:34:23 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-24 06:16:46 +0000 |
commit | b7d015ba4e8730ddcfcf7c5258b9ffa5cfb0949a (patch) | |
tree | ae407d81714508df63eba1a1d536bf4e547c01e2 /src/third_party/wiredtiger/test/format | |
parent | 81c6113198d2f5debf3da38a42bf61d7a079de2e (diff) | |
download | mongo-b7d015ba4e8730ddcfcf7c5258b9ffa5cfb0949a.tar.gz |
Import wiredtiger: 4500a8ed93af91b15901d00a9f9c2587f94275f9 from branch mongodb-4.4
ref: f6ab94b43b..4500a8ed93
for: 4.4.0-rc0
WT-5616 Coverity: Memory leak
WT-5669 Prepare support with durable history: backport data format changes to 4.2
WT-5672 Prepare support with durable history: implement rollback_to_stable
WT-5674 Prepare support with durable history: add/debug functional tests
WT-5754 Ensure the value is globally visible before encode it into WT_ROW
WT-5813 Fix heap-use-after-free in __split_parent
WT-5855 Clean up operation tracking documentation
WT-5880 test/format backup missing expected log file
WT-5885 Improve WT rollback to stable verbose output for better debugging
WT-5887 Turn off verbose output when test/format output is redirected to a file
WT-5890 Bump log/WT version to facilitate upgrade/downgrade floor for MongoDB
WT-5894 Don't persist durable timestamp if it is same as commit timestamp
WT-5896 Recovery sometimes attempts rollback to stable with an absent history store file
WT-5898 Fix memory leak in verifying history store
WT-5899 Restore WT_PAGE_LAS_UPDATE on-disk page flag value to avoid break backward compatibility
WT-5900 Display failed version numbers in error message for version mismatch failures
WT-5910 Fix start_durable_ts when handling out-of-order updates
Diffstat (limited to 'src/third_party/wiredtiger/test/format')
-rw-r--r-- | src/third_party/wiredtiger/test/format/backup.c | 25 | ||||
-rw-r--r-- | src/third_party/wiredtiger/test/format/t.c | 19 |
2 files changed, 14 insertions, 30 deletions
diff --git a/src/third_party/wiredtiger/test/format/backup.c b/src/third_party/wiredtiger/test/format/backup.c index 46b6e7b879c..f0123418888 100644 --- a/src/third_party/wiredtiger/test/format/backup.c +++ b/src/third_party/wiredtiger/test/format/backup.c @@ -327,8 +327,8 @@ backup(void *arg) WT_CURSOR *backup_cursor; WT_DECL_RET; WT_SESSION *session; - uint32_t src_id, src_prev; u_int incremental, period; + uint32_t src_id; const char *config, *key; char cfg[512]; bool full, incr_full; @@ -382,28 +382,11 @@ backup(void *arg) full = true; incr_full = false; } else { - /* - * 75% of the time, use the most recent source id. 25% of the time, use the id - * that is from two incremental backups prior. The handling of the active files for - * the source one or two incrementals prior is unpleasant but necessary. - */ - src_prev = mmrand(NULL, 1, 4) == 2 && g.backup_id >= 2 && full == false ? 2 : 1; - if (src_prev == 2) { - /* - * If we're going back two incrementals ago, set active_prev to the other list - * of active files (i.e. the active list that is not the immediate previous - * list) and overwrite active_prev with the current one. - */ - active_now = active_prev; - if (active_prev == &active[0]) - active_prev = &active[1]; - else - active_prev = &active[0]; - } else if (active_prev == &active[0]) + if (active_prev == &active[0]) active_now = &active[1]; else active_now = &active[0]; - src_id = g.backup_id - src_prev; + src_id = g.backup_id - 1; testutil_check(__wt_snprintf(cfg, sizeof(cfg), "incremental=(enabled,src_id=ID%u,this_id=ID%" PRIu32 ")", src_id, g.backup_id++)); @@ -476,7 +459,7 @@ backup(void *arg) * more incremental backups). */ if (full) - incremental = g.c_logging_archive ? 1 : mmrand(NULL, 1, 5); + incremental = g.c_logging_archive ? 1 : mmrand(NULL, 1, 8); if (--incremental == 0) { check_copy(); /* We ran recovery in the backup directory, so next time it must be a full backup. */ diff --git a/src/third_party/wiredtiger/test/format/t.c b/src/third_party/wiredtiger/test/format/t.c index 8b7ba07fe9e..67e2821f52d 100644 --- a/src/third_party/wiredtiger/test/format/t.c +++ b/src/third_party/wiredtiger/test/format/t.c @@ -116,8 +116,9 @@ main(int argc, char *argv[]) { uint64_t now, start; u_int ops_seconds; - int ch, onerun, reps; + int ch, reps; const char *config, *home; + bool one_flag, quiet_flag; custom_die = format_die; /* Local death handler. */ @@ -148,16 +149,13 @@ main(int argc, char *argv[]) (void)setenv("MALLOC_OPTIONS", "AJ", 1); #endif - /* Track progress unless we're re-directing output to a file. */ - g.c_quiet = isatty(1) ? 0 : 1; - /* Set values from the command line. */ home = NULL; - onerun = 0; + one_flag = quiet_flag = false; while ((ch = __wt_getopt(progname, argc, argv, "1C:c:h:lqrt:")) != EOF) switch (ch) { case '1': /* One run */ - onerun = 1; + one_flag = true; break; case 'C': /* wiredtiger_open config */ g.config_open = __wt_optarg; @@ -172,7 +170,7 @@ main(int argc, char *argv[]) g.logging = true; break; case 'q': /* Quiet */ - g.c_quiet = 1; + quiet_flag = true; break; case 'r': /* Replay a run */ g.replay = true; @@ -229,10 +227,13 @@ main(int argc, char *argv[]) g.c_runs = 1; /* - * Let the command line -1 flag override runs configured from other sources. + * Let the command line -1 and -q flags override values configured from other sources. + * Regardless, don't go all verbose if we're not talking to a terminal. */ - if (onerun) + if (one_flag) g.c_runs = 1; + if (quiet_flag || !isatty(1)) + g.c_quiet = 1; /* * Initialize locks to single-thread named checkpoints and backups, last last-record updates, |