diff options
author | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2023-04-17 11:09:03 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-17 01:57:50 +0000 |
commit | e65b0cf4686f853c0d92ea9e255447b70f1e304a (patch) | |
tree | ec6ef1953d813f28a507aa8266b00614b151a626 /src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c | |
parent | 933bc96f18f527eed32a57f4cbc70a0d8b94cc60 (diff) | |
download | mongo-e65b0cf4686f853c0d92ea9e255447b70f1e304a.tar.gz |
Import wiredtiger: ac320a657e7b39abc8fba594a8ede25cd1a41080 from branch mongodb-master
ref: 5850afdc2c..ac320a657e
for: 7.0.0-rc0
WT-10912 Handle EINVAL and no backup existing.
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) { |