diff options
Diffstat (limited to 'src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c')
-rw-r--r-- | src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c | 21 |
1 files changed, 13 insertions, 8 deletions
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 f285e084685..0821349544c 100644 --- a/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c +++ b/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c @@ -735,9 +735,9 @@ thread_backup_run(void *arg) struct stat sb; THREAD_DATA *td; WT_CURSOR *cursor; + WT_DECL_RET; WT_SESSION *session; uint32_t i, last_backup, last_full, sleep_time, u; - int ret; char *str; char buf[1024]; @@ -750,7 +750,14 @@ thread_backup_run(void *arg) * Find the last successful backup. */ if (td->workload_iteration > 1) { - testutil_check(session->open_cursor(session, "backup:query_id", NULL, NULL, &cursor)); + ret = session->open_cursor(session, "backup:query_id", NULL, NULL, &cursor); + /* + * If the query indicates no previous backup exists, then we only want to create a full + * backup this iteration. + */ + if (ret == EINVAL) + goto create; + testutil_check(ret); while ((ret = cursor->next(cursor)) == 0) { testutil_check(cursor->get_key(cursor, &str)); testutil_assert(strncmp(str, "ID", 2) == 0); @@ -780,6 +787,7 @@ thread_backup_run(void *arg) testutil_check(cursor->close(cursor)); } +create: /* * Create backups until we get killed. */ @@ -1236,12 +1244,9 @@ backup_exists(WT_CONNECTION *conn, uint32_t index) */ found = false; ret = session->open_cursor(session, "backup:query_id", NULL, NULL, &cursor); - if (ret != 0) { - if (ret == EINVAL) - goto done; - else - testutil_check(ret); - } + if (ret == EINVAL) + goto done; + testutil_check(ret); while (cursor->next(cursor) == 0) { testutil_check(cursor->get_key(cursor, &idstr)); if (strcmp(idstr, backup_id) == 0) { |