diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-10-08 13:12:32 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-08 02:34:40 +0000 |
commit | f313cc48426080bc9519d3301845acc2badd36fc (patch) | |
tree | 1b9259f1a39b6cc688959fe947944ee5d966d01c | |
parent | 061abbb5843a6ce48a6cb3979c6d94691e2daf9c (diff) | |
download | mongo-f313cc48426080bc9519d3301845acc2badd36fc.tar.gz |
Import wiredtiger: 794298374cc334ed611934143809cedd735b7f9b from branch mongodb-master
ref: 0349a673d5..794298374c
for: 5.1.1
WT-8146 Stop the tracking component when a CPP test ends
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/test/cppsuite/test_harness/workload/workload_tracking.cxx | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 66a3fd75f0b..7c7c304d2de 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": "0349a673d5f61d16cf81eb697b7774457596cda7" + "commit": "794298374cc334ed611934143809cedd735b7f9b" } diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/workload_tracking.cxx b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/workload_tracking.cxx index 1211749ec28..e0e7738590d 100644 --- a/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/workload_tracking.cxx +++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/workload/workload_tracking.cxx @@ -99,7 +99,8 @@ workload_tracking::do_work() /* Take a copy of the oldest so that we sweep with a consistent timestamp. */ oldest_ts = _tsm.get_oldest_ts(); - while ((ret = _sweep_cursor->prev(_sweep_cursor.get())) == 0) { + /* We need to check if the component is still running to avoid unecessary iterations. */ + while (_running && (ret = _sweep_cursor->prev(_sweep_cursor.get())) == 0) { testutil_check(_sweep_cursor->get_key(_sweep_cursor.get(), &collection_id, &key, &ts)); testutil_check(_sweep_cursor->get_value(_sweep_cursor.get(), &op_type, &value)); /* @@ -137,7 +138,13 @@ workload_tracking::do_work() free(sweep_key); - if (ret != WT_NOTFOUND) + /* + * If we get here and the test is still running, it means we must have reached the end of the + * table. We can also get here because the test is no longer running. In this case, the cursor + * can either be at the end of the table or still on a valid entry since we interrupted the + * work. + */ + if (ret != 0 && ret != WT_NOTFOUND) testutil_die(LOG_ERROR, "Tracking table sweep failed: cursor->next() returned an unexpected error %d.", ret); |